Skip to content
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

feat: Handle ACIR calls in the debugger #5051

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

ggiraldez
Copy link
Contributor

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 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:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

Thank you for your contribution to the Noir language.

Please do not force push to this branch after the Noir team have started review of this PR. Doing so will only delay us merging your PR as we will need to start the review process from scratch.

Thanks for your understanding.

@vezenovm
Copy link
Contributor

Thank you for the PR @ggiraldez! I plan to look at this soon, just have been taken away by other tasks

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.

Debugger: Handle multiple ACIR calls
3 participants