fix(debugger): improve output when constrain fails#5
Closed
anaPerezGhiglia wants to merge 6 commits intofix/debugger-brillig-assertion-failfrom
Closed
fix(debugger): improve output when constrain fails#5anaPerezGhiglia wants to merge 6 commits intofix/debugger-brillig-assertion-failfrom
anaPerezGhiglia wants to merge 6 commits intofix/debugger-brillig-assertion-failfrom
Conversation
|
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. |
dda35c7 to
54c45a3
Compare
mverzilli
reviewed
Jun 27, 2024
acvm-repo/acvm/src/pwg/brillig.rs
Outdated
| @@ -206,18 +214,14 @@ impl<'b, B: BlackBoxFunctionSolver<F>, F: AcirField> BrilligSolver<'b, F, B> { | |||
| })) | |||
| } | |||
| } | |||
There was a problem hiding this comment.
if it doesn't throw you into borrow checker hell, maybe it's a good idea to move the left hand side of let payload = ... to a function, for readability
mverzilli
reviewed
Jun 27, 2024
acvm-repo/acvm/src/pwg/brillig.rs
Outdated
| }) | ||
| .collect(), | ||
| call_stack, | ||
| found_trap, |
There was a problem hiding this comment.
Having a boolean capture this doesn't feel right, have you considered just adding the FailureReason here? (so instead of found_trap: bool, you'd end up with reason: FailureReason)
mverzilli
approved these changes
Jun 28, 2024
a322e9c to
d47f33c
Compare
58e8fb4 to
370a610
Compare
* Abstract `extract_failure_payload` function for improving readability
370a610 to
51d1193
Compare
d47f33c to
a8928dd
Compare
5 tasks
Member
Author
|
Closing this PR in favor of #6 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When an assertion fails on Brillig mode, the debugger fails to indicate the user where the program failed
while when running on ACIR mode it provides enough information 👇

Problem
Resolves
Summary
Context
assertconstraints are translated as "jump to trap" if the condition is not met when running in Brillig modeChanges
OpcodeResolutionError::BrilligFunctionFailedto track whether the function failed due to a trap opcode or notBrilligFunctionFailedDisplayimplementation when function failed due to a TrapErrorderive macro, to have a conditional messageObservations
TODO:should we return solver ownership in all Err scenarios>?Documentation
Check one:
PR Checklist
cargo fmton default settings.