-
Notifications
You must be signed in to change notification settings - Fork 101
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
Hand-written bus witness generation #2191
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
0f9d13e
to
0110fe0
Compare
9f3af11
to
c8a7ab6
Compare
c8a7ab6
to
fe022f2
Compare
aa08a54
to
b60141c
Compare
fe022f2
to
e4d1053
Compare
b60141c
to
46ae0f1
Compare
e4d1053
to
7f131a4
Compare
46ae0f1
to
a7d9d7d
Compare
7f131a4
to
ce15e57
Compare
This was referenced Dec 4, 2024
61fdd88
to
b3a3169
Compare
Schaeff
previously approved these changes
Dec 6, 2024
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.
LGTM
b3a3169
to
98e22ba
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 9, 2024
This PR: - Renames the current `executor::witgen::ExpressionEvaluator` to `executor::witgen::evaluators::partial_expression_evaluator::PartialExpressionEvaluator` - It is used when solving and evaluates to a `AffineResult<AlgebraicVariable<'a>, T>`, which might still contain unknown variables. - Adds a new `ExpressionEvaluator` that simply evaluates to `T` - Changes `MockBackend` to use the new `ExpressionEvaluator` (previously wrapped what is now called the `PartialExpressionEvaluator`) As a result, the code in `MockBackend` can be simplified. Also, I'm building on this in #2191 for fast witness generation for the bus.
has conflicts now |
98e22ba
to
230f2f5
Compare
rebased |
leonardoalt
approved these changes
Dec 9, 2024
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.
Approving because @Schaeff had already approved before the rebase
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 9, 2024
This PR: - Removes the `acc_next` columns, which were only needed because of a limitation of prover functions. The prover function that existed is now removed entirely, because we use the hand written witgen anyway, see #2191. - Also this PR materializes the folded tuple. This lowers the degree of the constraints if the tuples being sent have a degree > 1. It also enables next references in the tuple being sent. As a result, we can now generate Plonky3 proofs with a bus! ```bash cargo run -r --features plonky3 --bin powdr-rs compile riscv/tests/riscv_data/keccak -o output --max-degree-log 18 --field gl cargo run -r --features plonky3 pil output/keccak.asm -o output -f --field gl --prove-with plonky3 --linker-mode bus ``` The proof generation takes 8.32s (of which 394ms are spent on generating the second-stage witness). This compares to 2.07s proof time without a bus.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Builds on #2194 and #2183.
This PR gives us (relatively) fast witness generation for the bus, by writing custom code instead of relying on the generic solver + prover functions:
On
main
, second-stage witgen for the main machine alone takes about 5 minutes.