-
Notifications
You must be signed in to change notification settings - Fork 73
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
CompositeBackend
: Create proofs for each machine (working with Halo2)
#1470
Conversation
CompositeBackend
: Create proofs for each machine
c58c848
to
352696b
Compare
b502273
to
86c2ee7
Compare
86c2ee7
to
a965236
Compare
Pulled out of #1470. Receiving references, the `CompositeBackend` has no chance of changing the PIL or fixed columns before passing it to the wrapped backend. Using `Arc` fixed it, and is quite compatible with what is kept by `Pipeline` already.
b428d5d
to
f2dabfe
Compare
// Also test composite backend: | ||
pipeline | ||
.clone() | ||
.with_backend(powdr_backend::BackendType::EStarkStarkyComposite, None) | ||
.compute_proof() | ||
.unwrap(); | ||
|
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.
Removed for now, until the re-parsing is happening.
CompositeBackend
: Create proofs for each machineCompositeBackend
: Create proofs for each machine (working with Halo2)
…ce on either side
Includes #1511, but also removes the declarations of the challenges in the `permutation` and `lookup` modules. With these changes, we never declare a column or challenge outside a machine namespace. This greatly simplifies #1470. --------- Co-authored-by: schaeff <thibaut@schaeff.fr> Co-authored-by: chriseth <chris@ethereum.org>
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.
Awesome! Some small comments that don't necessarily need to be fixed. Can this PR be merged already or do we need to wait?
fn get_namespace(name: &str) -> String { | ||
let mut namespace = AbsoluteSymbolPath::default().join(SymbolPath::from_str(name).unwrap()); | ||
namespace.pop().unwrap(); | ||
namespace.relative_to(&Default::default()).to_string() |
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.
Is this always correct? I don't have a counterexample, but wondering if there are cases that would break this
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 think so! The code is inspired by our implementation of Display
:
powdr/ast/src/analyzed/display.rs
Lines 29 to 37 in 91d41df
let name = namespace.pop().unwrap(); | |
if namespace != current_namespace { | |
current_namespace = namespace; | |
writeln!( | |
f, | |
"namespace {}({degree});", | |
current_namespace.relative_to(&Default::default()) | |
)?; | |
}; |
pil: Analyzed<F>, | ||
statements: Vec<StatementIdentifier>, | ||
) -> Option<Analyzed<F>> { | ||
// TODO: After #1488 is fixed, we can implement this like so: |
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.
Is this PR going to wait for that, or should it be merged before?
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.
Should be merged before!
Yeah, I think it can be merged! |
Another step towards VadCoP (#1495)
With this PR, the
CompositeBackend
splits the given PIL into multiple machines and creates a proof for each machine.The rough algorithm is as follows:
This is an example:
Seems seems to work across the entire codebase and allows us to create Halo2 proofs by machine!
For STARK backends, we typically expect that IDs (e.g. Polynomial IDs, constraint IDs, ...) are re-assigned, which is not yet happening in this implementation. As mentioned in the comment, the easiest way to fix that would be to fix #1488 and re-parse the PIL file.