Skip to content
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

Nova vairants (Ova) NIFS abstraction #165

Merged
merged 4 commits into from
Oct 3, 2024
Merged

Conversation

arnaucube
Copy link
Collaborator

@arnaucube arnaucube commented Oct 2, 2024

The recent Ova NIFS PR #163 and Mova NIFS PR #161 PRs add Nova NIFS variants implementations which differ from Nova in the logic done for the E error terms of the instances.

The current Ova implementation is based on the existing Nova NIFS code base and adds the modifications to the E logic on top of it, and thus duplicating the code. Similarly for the Mova NIFS impl.

The rest of the Mova & Ova schemes logic that is not yet implemented is pretty similar to Nova one (ie. the IVC logic, the circuits and the Decider), so ideally that can be done reusing most of the already existing Nova code without duplicating it. This PR is a first step in that direction for the existing Ova NIFS code.

This PR:

  • introduces the NIFS trait abstraction (based on the needs for Nova, Mova, Ova), defining a common interface between the three Nova variants
  • adds the Ova variant on top of the new abstraction, which allows to shave off ~400 lines of code that were duplicated.

I'll track the Mova PR progress, and maybe will also port the Mova NIFS impl into this new abstraction already in this PR, but if Mova PR takes some day I think we can merge this one and I can port that Mova impl into this new abstraction once that one is ready.

@arnaucube arnaucube mentioned this pull request Oct 2, 2024
4 tasks
folding-schemes/src/folding/nova/ova.rs Outdated Show resolved Hide resolved
folding-schemes/src/folding/nova/ova.rs Outdated Show resolved Hide resolved
@CPerezz
Copy link
Member

CPerezz commented Oct 3, 2024

This is awesome.

Will definitely be helpful!

@arnaucube arnaucube force-pushed the nova-vairants-nifs-abstraction branch from 4a91528 to e939418 Compare October 3, 2024 08:44
@arnaucube arnaucube requested a review from CPerezz October 3, 2024 08:48
Copy link
Member

@CPerezz CPerezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change the hash thing. To duplicate the ChallengeGadget for Ova such that we don't hash Zero.

Anyways, don't want to annoy you. We can merge if you really want it this way.

@arnaucube
Copy link
Collaborator Author

Don't merge yet, I'll do some updates.
Regarding the ChallengeGadget hash thing that you mention: #165 (comment)

@arnaucube arnaucube force-pushed the nova-vairants-nifs-abstraction branch 4 times, most recently from b43000b to b45e6ea Compare October 3, 2024 10:18
@CPerezz CPerezz added this pull request to the merge queue Oct 3, 2024
@CPerezz CPerezz removed this pull request from the merge queue due to a manual request Oct 3, 2024
Copy link
Member

@CPerezz CPerezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!! Let's merge @arnaucube ?

…defining a common interface between the three Nova variants

The recent Ova NIFS PR #163 (#163)
and Mova NIFS PR #161 (#161)
PRs add Nova NIFS variants implementations which differ from Nova in the
logic done for the `E` error terms of the instances.

The current Ova implementation (#163)
is based on the existing Nova NIFS code base and adds the modifications
to the `E` logic on top of it, and thus duplicating the code. Similarly
for the Mova NIFS impl.

The rest of the Mova & Ova schemes logic that is not yet implemented is
pretty similar to Nova one (ie. the IVC logic, the circuits and the
Decider), so ideally that can be done reusing most of the already
existing Nova code without duplicating it. This PR is a first step in
that direction for the existing Ova NIFS code.

This commit adds the NIFS trait abstraction with the idea of allowing to
reduce the amount of duplicated code for the Ova's NIFS impl on top of
the Nova's code.
This is done from the existing Ova implementation at
`folding/ova/{mod.rs,nofs.rs}`, but removing when possible code that is not
needed or duplicated from the Nova logic.
This commit combined with the other ones (add nifs abstraction & port
Ova to the nifs abstraction) allows to effectively get rid of ~400 lines
of code that were duplicated in the Ova NIFS impl from the Nova impl.
@arnaucube arnaucube force-pushed the nova-vairants-nifs-abstraction branch from b45e6ea to 2e1039e Compare October 3, 2024 13:03
@arnaucube arnaucube added this pull request to the merge queue Oct 3, 2024
Merged via the queue into main with commit a07e17e Oct 3, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants