-
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
Finalize bus related tasks (afaik) #2485
Comments
Very cool :)
I'm not sure how this would work! Maybe there is some misunderstanding. Different machines have different number of rows, so they cannot interact directly using polynomial constraints. For example, the In essence, each machine has its own trace matrix (of different heights) and is proven independently (*). Each machine has its own "local" bus accumulator and the final value (just a single extension field element) is exposed as a public. So then, the verifier verifies all proofs individually, sums up the local bus accumulators (there is only one per machine, so this is not too much work), and asserts that the sum is zero.
We currently support exposing specific cells of the trace as publics, this is an example. I'm not sure what the support is for adding publics in PIL functions currently. So I think this task has two components: Exposing the final accumulator values (I think it's tricky because we don't know the number of rows at compile time?) and adding the verifier logic to add the check that they actually sum to 0. I think this task is has much less priority that the previous one, because while it is essential for soundness, I wouldn't expect this step to introduce significant overhead (as opposed to the bus accumulators). So, we can iterate on the design and get realistic performance estimates without implementing this task. I think we'll also want to change some things around publics (#1633), so it might make sense to do that first. (*): This is simplifying a bit; the backend might be able to share some work between these proofs, but there is no constraint between machines from the PoV of the proving backend. Our "composite" backend literary produces an independent proof per machine; but Plonky3 for example does this in a more integrated and efficient way. |
Thanks for the write up! I think from your answer I would push the first task towards the end, and then maybe work on the publics stuff you quoted. I'll postpone adding accumulator to publics. After that I'd do some random PR reviews, unless you think there are some other stuffs to be done on the bus front. |
There will be three tasks left TODO, with the second depending on the first and the third on the second.
First Task: one bus interaction per object/machine (DONE in #2486)
In bus linker, instead of using two sets of accumulator columns per object/machine, i.e. one for all bus sends (
BusInteraction::Send
inputs viabus_multi
) and one for all bus receives (both lookup and permutation viabus_multi_receive_batch_lookup_permutation
), we can batch all bus interactions. This will require adding another functionbus_multi_linker: (id, selector, payload[], type)[]
(note that this is not correct syntax just illustrative) where type has three potential values: 0 if it's a bus send, 1 if it's a bus receive for lookup, and 2 if it's a bus receive for permutation. This function will only be used by the linker and user should not tamper with it. This function will replacebus_multi
andbus_multi_receive_batch_lookup_permutation
as the sole function to be used in the linker.Second Task: one bus interaction for all objects (SEE A POC IN #2487)
Completing the first task yields results like this:
Because all columns names are absolute paths (except main), I'm hypothesizing that we can just have one bus interaction pil statement inside main that references all bus send and receives from all machines. Is this actually possible? @Schaeff. Doing this will require changing up the
LinkerBackend
trait (https://github.com/powdr-labs/powdr/blob/main/linker/src/lib.rs#L29-L60), because currently bus interaction statement is added withinprocess_object
, and we would need an extra statement within functionlink
that inserts the single bus interaction statement after processing objects, which obviously doesn't apply to the native linking mode.The end result will look like:
Third Task
Now that the second task is done, we need to constrain the accumulator to be zero. I remember seeing somewhere in the code base or a PR or an issue that we should expose the accumulator columns in the publics (honestly I have no idea what this means), and this might involve editing the backend, so would appreciate some thoughts from @Schaeff. Basically would you mind providing me some data structure/file to look at, so I can get some more grounded sense of the pipeline? Thanks! :)
The text was updated successfully, but these errors were encountered: