-
Notifications
You must be signed in to change notification settings - Fork 90
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
Expr formatting. #888
Expr formatting. #888
Conversation
059b0f4
to
4cdfe97
Compare
436a78c
to
9ebe2ae
Compare
4cdfe97
to
4f5955b
Compare
9ebe2ae
to
e0a38e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @Alon-Ti)
crates/prover/src/constraint_framework/expr.rs
line 56 at r1 (raw file):
d.format_expr() ), Expr::Const(c) => c.0.to_string(),
Const is a BaseField so why are you treat it as a string?
Code quote:
Expr::Const(c) => c.0.to_string(),
crates/prover/src/constraint_framework/expr.rs
line 59 at r1 (raw file):
Expr::Var(v) => v.to_string(), Expr::Add(a, b) => format!("{} + {}", a.format_expr(), b.format_expr()), Expr::Sub(a, b) => format!("{} - ({})", a.format_expr(), b.format_expr()),
don't you need to add parenthesis on this too?
Suggestion:
Expr::Sub(a, b) => format!("({}) - ({})", a.format_expr(), b.format_expr())
crates/prover/src/constraint_framework/expr.rs
line 444 at r1 (raw file):
let eval = test_struct.evaluate(ExprEvaluator::new(16, (SecureField::zero(), None))); assert_eq!(eval.constraints[0].format_expr(), "(1) * ((((col_1_0[0]) * (col_1_1[0])) * (col_1_2[0])) * (1/(col_1_0[0] + col_1_1[0])))"); assert_eq!(eval.constraints[1].format_expr(), "(1) * ((SecureCol(col_2_4[0], col_2_6[0], col_2_8[0], col_2_10[0]) - (SecureCol(col_2_5[18446744073709551615], col_2_7[18446744073709551615], col_2_9[18446744073709551615], col_2_11[18446744073709551615]) - ((col_0_3[0]) * (SecureCol(0, 0, 0, 0)))) - (0)) * (0 + (TestRelation_alpha0) * (col_1_0[0]) + (TestRelation_alpha1) * (col_1_1[0]) + (TestRelation_alpha2) * (col_1_2[0]) - (TestRelation_z)) - (1))");
I think you should write it in a clearer indentation, (so it will be easy to understand what the constraints are, and then you it in the test.
Code quote:
assert_eq!(eval.constraints[0].format_expr(), "(1) * ((((col_1_0[0]) * (col_1_1[0])) * (col_1_2[0])) * (1/(col_1_0[0] + col_1_1[0])))");
assert_eq!(eval.constraints[1].format_expr(), "(1) * ((SecureCol(col_2_4[0], col_2_6[0], col_2_8[0], col_2_10[0]) - (SecureCol(col_2_5[18446744073709551615], col_2_7[18446744073709551615], col_2_9[18446744073709551615], col_2_11[18446744073709551615]) - ((col_0_3[0]) * (SecureCol(0, 0, 0, 0)))) - (0)) * (0 + (TestRelation_alpha0) * (col_1_0[0]) + (TestRelation_alpha1) * (col_1_1[0]) + (TestRelation_alpha2) * (col_1_2[0]) - (TestRelation_z)) - (1))");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2
.
Benchmark suite | Current: 1caa5eb | Previous: f6214d1 | Ratio |
---|---|---|---|
merkle throughput/simd merkle |
29815729 ns/iter (± 440489 ) |
14690867 ns/iter (± 434150 ) |
2.03 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @shaharsamocha7
4f5955b
to
b8d7a09
Compare
e0a38e9
to
36aa69d
Compare
b8d7a09
to
2601e11
Compare
af65bfc
to
5c04e62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @shaharsamocha7)
crates/prover/src/constraint_framework/expr.rs
line 56 at r1 (raw file):
Previously, shaharsamocha7 wrote…
Const is a BaseField so why are you treat it as a string?
Oh, right, the unreduced form :(
crates/prover/src/constraint_framework/expr.rs
line 59 at r1 (raw file):
Previously, shaharsamocha7 wrote…
don't you need to add parenthesis on this too?
Isn't it correct like this? I think add doesn't need parens, sub needs parens on the negative part and mul needs parens on both.
a * b - d + c - (x * y + z) <=> (a * b - d + c) - (x * y + z)
crates/prover/src/constraint_framework/expr.rs
line 444 at r1 (raw file):
Previously, shaharsamocha7 wrote…
I think you should write it in a clearer indentation, (so it will be easy to understand what the constraints are, and then you it in the test.
Done.
2601e11
to
a61816c
Compare
5c04e62
to
78e9027
Compare
a61816c
to
db26f4c
Compare
78e9027
to
b8f42ec
Compare
b45fd93
to
72d6918
Compare
b8f42ec
to
01455db
Compare
72d6918
to
9037ea4
Compare
01455db
to
89c469c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Alon-Ti)
89c469c
to
aeac992
Compare
9037ea4
to
96f7025
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #888 +/- ##
==========================================
+ Coverage 91.85% 91.87% +0.01%
==========================================
Files 93 93
Lines 13053 13097 +44
Branches 13053 13097 +44
==========================================
+ Hits 11990 12033 +43
- Misses 948 949 +1
Partials 115 115 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
aeac992
to
e55c200
Compare
e55c200
to
1caa5eb
Compare
No description provided.