-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Handle ACIR calls in the debugger (#5051)
# Description ## Problem\* Resolves #4824 With the introduction of ACIR calls to allow non-inlined ACIR functions, the debugger did not have proper support for programs that had them, neither when compiling in ACIR mode, nor in the default mode which compiles the full program to Brillig. ## Summary\* This PR depends on #4941 and is built on top of it. The changes allow compiling a program with `#[fold]` (and other non-inline) annotated functions in Brillig mode (the default when debugging) by forcing the selection of the Brillig runtime when compiling them. For inline functions, during SSA generation the runtime is _not changed_ in order to allow some optimizations in the stdlib to still work. For example, [some constant assertions](https://github.com/noir-lang/noir/blob/9c6de4b25d318c6d211361dd62a112a9d2432c56/noir_stdlib/src/field.nr#L6) don't work unless the function is inlined. When debugging in ACIR mode (with the `--acir-mode` CLI or `generateAcir: true` DAP options), the debugger now properly handles programs with multiple circuits and ACIR calls by: 1. keeping a stack of ACVMs and a record of the circuit being executed by each one, and 2. extending the debug location to also indicate in which circuit is the current opcode being executed ## Additional Context ## Documentation\* Check one: - [X] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Martin Verzilli <martin.verzilli@gmail.com> Co-authored-by: Maxim Vezenov <mvezenov@gmail.com> Co-authored-by: Ana Perez Ghiglia <aghiglia@manas.tech>
- Loading branch information
1 parent
2947aba
commit 0541568
Showing
11 changed files
with
633 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.