-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve mock prover errors printing (#182)
- fmt `Goldilocks(18446744069414584319)` as `-2` as well as `Sum` `Product` expressions. - include instance id and relevant wit in. ### Before ``` AssertEqualError "test_assert_zero_1/require_equal/a + 1 == b": Left != Right Left: GoldilocksExt2([Goldilocks(4), Goldilocks(0)]) Right: GoldilocksExt2([Goldilocks(5), Goldilocks(0)]) Left Expression: ScaledSum(WitIn(1), Constant(Goldilocks(1)), Constant(Goldilocks(0))) Right Expression: Sum(ScaledSum(WitIn(0), Constant(Goldilocks(1)), Constant(Goldilocks(0))), Constant(Goldilocks(1))) AssertZeroError "test_assert_zero_1/require_zero/c - 2 == 0": Evaluated expression is not zero Expression: Sum(ScaledSum(WitIn(2), Constant(Goldilocks(1)), Constant(Goldilocks(0))), Constant(Goldilocks(18446744069414584319))) Evaluation: GoldilocksExt2([Goldilocks(18446744069414584322), Goldilocks(0)]) LookupError "test_lookup_1/assert_u5/assert u5": Evaluated expression does not exist in T vector Expression: ScaledSum(WitIn(0), Challenge(1, 1, GoldilocksExt2([Goldilocks(1), Goldilocks(0)]), GoldilocksExt2([Goldilocks(0), Goldilocks(0)])), Challenge(0, 1, GoldilocksExt2([Goldilocks(1), Goldilocks(0)]), GoldilocksExt2([Goldilocks(0), Goldilocks(0)]))) Evaluation: GoldilocksExt2([Goldilocks(1000001), Goldilocks(0)]) ``` ### After ``` AssertEqualError "test_assert_zero_1/require_equal/a + 1 == b" Left: GoldilocksExt2[4,0] != Right: GoldilocksExt2[5,0] Left Expression: 1 * WitIn(1) + 0 Right Expression: 1 * WitIn(0) + 0 + 1 Inst[0]: WitIn(1)=4,WitIn(0)=4 AssertZeroError "test_assert_zero_1/require_zero/c - 2 == 0": Evaluated expression is not zero Expression: 1 * WitIn(2) + 0 + (-2) Evaluation: GoldilocksExt2[1,0] != 0 Inst[1]: WitIn(2)=3 LookupError "test_lookup_1/assert_u5/assert u5": Evaluated expression does not exist in T vector Expression: Challenge(1) * WitIn(0) + Challenge(0) Evaluation: GoldilocksExt2[1000001,0] Inst[1]: WitIn(0)=1000 ``` --------- Co-authored-by: Ming <[email protected]>
- Loading branch information
Showing
2 changed files
with
157 additions
and
19 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