This program results in a circuit size of ~6639 constraints, while they feel that hydra should be more efficient. Here's a snippet of the ACIR for this program.
Something that jumps out is that we have a lot of repeated quadratic terms in this program so if we weren't reusing intermediate variables across opcodes then we're going to be creating a lot of unnecessary constraints.
I added a quick test to check that we're doing this and we don't seem to be .
Happy Case
We should reuse intermediate variables across different opcodes
Looking at the transformed ACIR however, it does seem that we reuse the witness generated for the product of witnesses 29 and 31 which is a bit strange.
Problem
We've got a user in Discord who has implemented Hydra in Noir: https://github.com/TaceoLabs/noir-hydra
This program results in a circuit size of ~6639 constraints, while they feel that hydra should be more efficient. Here's a snippet of the ACIR for this program.
Something that jumps out is that we have a lot of repeated quadratic terms in this program so if we weren't reusing intermediate variables across opcodes then we're going to be creating a lot of unnecessary constraints.
I added a quick test to check that we're doing this and we don't seem to be .
Happy Case
We should reuse intermediate variables across different opcodes
Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response