Skip to content

feat(acvm): Execute multiple circuits #5380

Merged
vezenovm merged 208 commits into
masterfrom
mv/execute-multiple-circuits-comptime
Mar 29, 2024
Merged

feat(acvm): Execute multiple circuits #5380
vezenovm merged 208 commits into
masterfrom
mv/execute-multiple-circuits-comptime

Conversation

@vezenovm

@vezenovm vezenovm commented Mar 21, 2024

Copy link
Copy Markdown
Contributor

Resolves noir-lang/noir#4428

This is a followup to #5341 which does the initial ACIR generation work for multiple ACIR functions.

Execution is now done by moving execute_circuit to be part of a stateful ProgramExecutor that builds a witness stack for every completed execute_circuit call. An initial execute_program function instantiates the ProgramExecutor and starts execution on our main entry point circuit. When a Call opcode is reached we pause execution and recursively call execute_circuit, which then returns the solved witness for that call. We then resolve the outputs of that execution by reading the return witnesses from the inner solved witness. We then push the nested call solved witness onto the witness stack and continue execution of our main ACVM instance. This is quite similar to the process used by foreign calls with Brillig, except it is now done with the main ACVM rather than the contained Brillig VM.

This witness stack and program (list of Circuit functions) then gets passed to the backend. For now, I have only done an additive prove_and_verify_ultra_honk_program to show the process working for the basic non-inlined ACIR programs supplied here. I wanted to leave any WASM exports or ACVM JS changes for a follow-up PR as they are quite a bit of changes on their own.

Loading
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.

ACIR gen / ACVM: Handle non-inlined ACIR functions

6 participants