fix: add new BrilligFunctionUnsatisfiedConstrain resolution error variant#5403
fix: add new BrilligFunctionUnsatisfiedConstrain resolution error variant#5403anaPerezGhiglia wants to merge 4 commits intonoir-lang:masterfrom
BrilligFunctionUnsatisfiedConstrain resolution error variant#5403Conversation
…ariant (#6) * Convert BrilligSolver Trap failure into `BrilligFunctionUnsatisfiedConstrain` error * extract extract_failure_payload function to improve readability * Changed the variant checking on ACVM.map_brillig_error from OpcodeResolutionError::BrilligFunctionFailed to OpcodeResolutionError::BrilligFunctionUnsatisfiedConstrain * return ownership of the solver to brillig context when the debugger fails due to `BrilligFunctionUnsatisfiedConstrain`
|
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. |
Co-authored by: Ana Perez Ghiglia <aghiglia@manas.tech>
Co-authored-by: Ana Perez Ghiglia <aghiglia@manas.tech>
|
I would say that replacing the brillig solver in all cases is probably the way to go in this scenario. I think it was probably left off due to an expectation that execution has finished so we can discard the VM. |
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* This PR pulls out a modified version of @anaPerezGhiglia's refactoring to how we extract error payloads from the brillig VM's memory from #5403 to separate it from the creation of the new error variant. ## 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: Ana Perez Ghiglia <aghiglia@manas.tech>
|
I expect that this doesn't require the new error variant now, correct? |
|
@TomAFrench I guess the need of the new variant is debatable. I left the new variant since with it
|
|
I'm closing this PR since it got stale, and fixed the changes introduced in #7958. |

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::BrilligFunctionUnsatisfiedConstrainto represent failed constraints on BrilligTrapfailureACVM.map_brillig_errorfromOpcodeResolutionError::BrilligFunctionFailedtoOpcodeResolutionError::BrilligFunctionUnsatisfiedConstrainsince assertion errors will now fail with the latterBrilligFunctionFailedfor all other casesObservations
Errscenarios? At first sight it seems that this would be the right thing to do, but I decided to handle only this known scenario in case I'm missing something.Documentation
Check one:
PR Checklist
cargo fmton default settings.