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

Simplify relations code #720

Closed
codygunton opened this issue Sep 7, 2023 · 2 comments
Closed

Simplify relations code #720

codygunton opened this issue Sep 7, 2023 · 2 comments
Assignees

Comments

@codygunton
Copy link
Collaborator

Each relation implements a bit of polynomial arithmetic applied to univariate polynomials. As an optimization, we would like that the univariates have the minimum allowable length (the length is the number of evaluations representing the polynomial; this is equals the degree of the polynomial + 1). To accomplish this, each relation defines a container for univariates of different lengths. To avoid code duplication, we have taken a somewhat complicated approach to doing this: each relation is split into

  • an implementation, which records these lengths in a template, and
  • a uniform 'wrapping'/completion step where this template is used to create the corresponding containers.

This solutions works, but it would be beneficial to simplify this structure. Some possibilities:

  • Each RelationImpl puts its lengths in an array which is somehow treated as a parameter pack in order to create the desired containers.
  • We accept duplication and just define the containers in each relation. We can enforce that this is done through a concept.

cc @maramihali

@ledwards2225
Copy link
Collaborator

I agree that the relations code is complicated and I definitely welcome a simplification, but I don't think that duplicating the very complicated and error prone relation algebra is ever going to be the right thing. This was fine for StandardHonk, but take a look at the ECCVM, or even the just the auxiliary relation. I had originally set it up so that only the algebra was shared and the container definitions were explicit in each relation (leading to some acceptable duplication IMO) but we ultimately decided to go with the interface implemented in relation_types.hpp. If reverting that component could simplify the model then I'd be in favor.

@codygunton
Copy link
Collaborator Author

Closed by AztecProtocol/aztec-packages#2619

@codygunton codygunton self-assigned this Oct 17, 2023
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

No branches or pull requests

2 participants