-
Notifications
You must be signed in to change notification settings - Fork 230
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
Simplification pass for ACIR #635
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 fmt
with default settings.