-
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
Add PhantomBusInteraction
#2183
Conversation
The following test seems to fail. Witgen ends in an infinite loop after the loop is detected in the main machine: export TEST=sum
cargo run -r --features plonky3 --bin powdr-rs compile riscv/tests/riscv_data/$TEST -o output --max-degree-log 15 --field gl
cargo run -r --features plonky3 pil output/$TEST.asm -o output -f --field gl --prove-with mock --linker-mode bus -i 1,1,1 Looks like removing the bus interaction fixes it. Gotta debug tomorrow. |
The commit above fixes the bug. |
@@ -313,6 +315,7 @@ impl<'a, T: FieldElement> MachineExtractor<'a, T> { | |||
} | |||
Identity::Polynomial(i) => self.fixed.polynomial_references(i), | |||
Identity::Connect(i) => self.fixed.polynomial_references(i), | |||
Identity::PhantomBusInteraction(i) => self.fixed.polynomial_references(&i.tuple), |
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 double checking we only need to visit the tuple?
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.
Right, I should add the multiplicity! I thought it was handled elsewhere, but it is also added when processing lookups. Good catch!
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: ``` $ 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/$TEST.asm -o output -f --field gl --prove-with mock --linker-mode bus ... Running main machine for 262144 rows [00:00:05 (ETA: 00:00:05)] █████████░░░░░░░░░░░ 48% - 24283 rows/s, 3169k identities/s, 92% progress Found loop with period 1 starting at row 127900 [00:00:05 (ETA: 00:00:00)] ████████████████████ 100% - 151125 rows/s, 16170k identities/s, 100% progress Witness generation took 5.748081s Writing output/commits.bin. Backend setup for mock... Setup took 0.54769236s Generating later-stage witnesses took 0.29s Proof generation took 2.0383847s ``` On `main`, second-stage witgen for the main machine alone takes about 5 minutes.
This PR adds a
Constr:: PhantomBusInteraction
variant. For now, it is ignored - if users want to use a bus, they need to express this in terms of phantom lookups / permutations as before this PR.I added a few
TODO(bus_interaction)
and opened #2184 to track support for phantom bus interactions.One use-case this could have before though is to trigger a "hand-written" witness generation for the bus, as discussed in the chat.