-
Notifications
You must be signed in to change notification settings - Fork 59
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
On duplication in LEM integration #639
Comments
Merged
Closed
Summarizing the story:
The present should close as soon as #717 and #718 are merged, because while we are indeed taking some duplication with those PRs, this is better than the alternative (worked out in #729) due to a lower complexity. The missing pieces are NIVC support from #677 and #725, which should also resolve soon. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think there are two factors of duplication in #629:
Misuse of genericity
This is essentially explained in a PR comment. That is, the types that depend on a generic
C: Coprocessor<F>
are redefined in #629 because the LEM logic cannot for now accomodate any coprocessor other thanDummyCoproc<F>
. However, for anyGenericType<Foo, Bar>
, there is nothing in Rust that prevents you from defining methods for typeGenericType<Foo, usize>
.I have a branch that starts working out the deduplication in https://github.com/huitseeker/lurk-rs/tree/lem-integration-experiment
The reason I think it's important to resolve this is that the methods we'd define today on
Foo<F, DummyCoproc<F>>
will eventually be able to be defined onFoo<F, C: Coproc<F>>
, which is going to be much easier to adapt to if they're not distinct types.Not abstracting the Multiframe, and failing to define provers in terms of that abstraction
The MultiFrame is the fundamental type that's defined starkly differently in LEM and Lurk:
This struct appears in the APIs of the prover:
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/mod.rs#L20
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/mod.rs#L33-L34
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/mod.rs#L107-L110
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/nova.rs#L121
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/nova.rs#L131-L141
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/nova.rs#L172-L181
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/nova.rs#L421-L428
morally speaking, the only thing we need (that is, the only thing Nova requires) in the position of this
MultiFrame
in the prover is some instance ofStepCircuit
. I suspect we could implement:Store
andPtr
,blank
,from_frames
andsynthesize_frames
(the later being expressed in terms of those associated types:https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/proof/nova.rs#L421-L428
https://github.com/lurk-lab/lurk-rs/blob/9aa8b75247066b70972f2806a1537c359f47c2c6/src/circuit/circuit_frame.rs#L183-L192
Note the apparent difference between the instances of this backend function are not key, since their only usage is in the
impl nova::StepCircuit for MultiFrame
andimpl bellpepper_core::Circuit for MultiFrame
. Whatever abstraction that allows implementing those two callsites on top of what the MultiFrame trait offers should be enough.The text was updated successfully, but these errors were encountered: