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

fix(debugger): improve output when assertion fails in Brillig #4

Conversation

anaPerezGhiglia
Copy link
Member

Description

When an assertion fails on Brillig mode, the debugger fails to indicate the user where the program failed

image

while when running on ACIR mode it provides enough information
image

Problem*

Resolves

Summary*

  • assert constraints are translated as "jump to trap" if the condition is not met when running in Brillig mode
  • Solution: treat FailureReason::Trap specifically when handling brillig vm status. Treat these failures as an OpcodeResolutionError::UnsatisfiedConstrain instead of an OpcodeResolutionError::BrilligFunctionFailed
    • By doing these, the error will be reported the same way as when running in ACIR mode
image

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

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.

@anaPerezGhiglia anaPerezGhiglia force-pushed the fix/debugger-output-when-brillig-assertion-fails branch from 4c5dafc to 36a41ef Compare June 26, 2024 15:36
@anaPerezGhiglia
Copy link
Member Author

anaPerezGhiglia commented Jun 26, 2024

Closing this PR since these changes make nargo tests to fail.

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.

1 participant