Conversation
|
For reference, why is this done on the fly instead of at the end like the other passes? (Doing it on the fly seems to have made a lot of the code now need to take a Result) |
This is done in order to minimise the impact of the simplification. If we do it at the end, we need to reprocess the whole circuit again and again until nothing is solved, and the circuit can be big. Here, when we add a gate and if it can be solved, then usually the solved witness is defined by the gate and so we don't need to perform another pass on the circuit. |
|
There's been quite a bit of merge conflicts on this, that I will resolve |
|
What is the status on this PR? Do we want to try to fix the conflicts and merge it, restart it, or abandon it? |
I think the acvm changes are too big for solving the conflicts. I will create another PR (probably we need two now) and then we can abandon this one. |
|
Closing in favour of noir-lang/acvm#151 |
Related issue(s)
Resolves #573
Description
Summary of changes
Add a simplification pass which removes gates of the form
x=field value, by replacing x by its value in all the other gates.The simplification is done on the fly, every-time a gate is added to the circuit. If it can be simplified, we update the previous gates using the solved value until nothing is solved. Usually only one pass is needed (so two in total to see that the second one did not solve anything)
Checklist
cargo fmtwith default settings.