-
Notifications
You must be signed in to change notification settings - Fork 3
[WIP] Design for recursive lookups (global and local interactions) #118
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
base: main
Are you sure you want to change the base?
Conversation
4l0n50
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just took a quick look. It would be nice to see an example, but I guess it needs non-recursive lookups first.
recursion/src/circuit_verifier.rs
Outdated
| >( | ||
| config: &SC, | ||
| air: &A, | ||
| air: &dyn RecursiveAirWithLookupVerification<SC::Challenge, Comm>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need dynamic dispatch now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so we can have &[&dyn A] in the multi-table verifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, I saw that later and forgot to remove the comment.
recursion/src/lookup.rs
Outdated
| folded_constraints, | ||
| ); | ||
|
|
||
| folded_constraints = self.eval_global_constraints( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you need to compute folded_constrais = folded_constraints + alpha * self.eval_global_constraints(..) in the circuit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eval_global_constraints takes folded_constraints as an argument, so what it should do is use that start of the accumulator to keep folding (so it adds the global constraints as though they were part of the AIR constraints themselves)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thkns!
This is still work in progress, but I am opening a draft PR so that we can decide early on whether we can agree on this design.
The goal is to create a design for recursive lookups.
The trait
RecursiveAirLookupVerificationcontains the methods necessary for an AIR to check its own lookup constraints. Thus, it enables aRecursiveAirto:Note that for global lookups (= global interactions), we need the index of the table with which we are interacting, as well as the direction of the lookup (sending or receiving), to determine whether the multiplicities should be negated. This is why I introduced
DirectionandTable.In order to facilitate the use of airs without lookups, I introduced a wrapper
AirWithoutLookupswhich implementsRecursiveAirLookupVerification.