-
Notifications
You must be signed in to change notification settings - Fork 83
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
Simplify expressions. #894
base: dev
Are you sure you want to change the base?
Conversation
22d6538
to
86f314a
Compare
1091abc
to
9923962
Compare
86f314a
to
1ed3739
Compare
9923962
to
be9ba3a
Compare
1ed3739
to
92a18c4
Compare
be9ba3a
to
ab38c48
Compare
92a18c4
to
91ce7f8
Compare
ab38c48
to
8f5fdc0
Compare
91ce7f8
to
c45d810
Compare
8f5fdc0
to
e39898f
Compare
c45d810
to
e88e970
Compare
e39898f
to
b9f2ff9
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.
⚠️ 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: 188ba5c | Previous: cd8b37b | Ratio |
---|---|---|---|
iffts/simd ifft/22 |
12710376 ns/iter (± 141611 ) |
6306399 ns/iter (± 210024 ) |
2.02 |
merkle throughput/simd merkle |
30188735 ns/iter (± 734672 ) |
13712527 ns/iter (± 579195 ) |
2.20 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @shaharsamocha7
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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 2 files reviewed, 2 unresolved discussions (waiting on @Alon-Ti and @shaharsamocha7)
crates/prover/src/constraint_framework/expr.rs
line 222 at r1 (raw file):
} } Expr::Mul(a, b) => {
are you covering 1 * 1 => const(1)?
crates/prover/src/constraint_framework/expr.rs
line 226 at r1 (raw file):
let b = simplify(*b); if let (Expr::Const(a), Expr::Const(b)) = (a.clone(), b.clone()) { Expr::Const(a - b)
Suggestion:
a * b
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 2 files reviewed, 2 unresolved discussions (waiting on @ohad-starkware and @shaharsamocha7)
crates/prover/src/constraint_framework/expr.rs
line 222 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
are you covering 1 * 1 => const(1)?
I think so, it would be caught in the first if let
, no?
crates/prover/src/constraint_framework/expr.rs
line 226 at r1 (raw file):
let b = simplify(*b); if let (Expr::Const(a), Expr::Const(b)) = (a.clone(), b.clone()) { Expr::Const(a - b)
Done.
e88e970
to
d88f160
Compare
b9f2ff9
to
70aca12
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 2 files reviewed, all discussions resolved (waiting on @shaharsamocha7)
crates/prover/src/constraint_framework/expr.rs
line 222 at r1 (raw file):
Previously, Alon-Ti wrote…
I think so, it would be caught in the first
if let
, no?
right
crates/prover/src/constraint_framework/expr.rs
line 356 at r2 (raw file):
.temp_vars .iter() .map(|(name, expr)| format!("let {} = {};", name, simplify(expr.clone()).format_expr()))
can you find a way to reduce the syntax?
maybe expr.simplify_and_format()
non blocking
Code quote:
simplify(expr.clone()).format_expr()))
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 2 files reviewed, all discussions resolved (waiting on @shaharsamocha7)
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 2 files reviewed, 1 unresolved discussion (waiting on @Alon-Ti and @ohad-starkware)
crates/prover/src/examples/state_machine/mod.rs
line 321 at r2 (raw file):
- (0)) \ * ((temp_0) * (temp_1)) \ - ((temp_1) * (1) + (temp_0) * (-(1)));"
I thought it should change to that
Suggestion:
- (temp_1 - temp_0);"
d88f160
to
e350aa7
Compare
70aca12
to
c86533f
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 2 files reviewed, 1 unresolved discussion (waiting on @ohad-starkware and @shaharsamocha7)
crates/prover/src/examples/state_machine/mod.rs
line 321 at r2 (raw file):
Previously, shaharsamocha7 wrote…
I thought it should change to that
Nice catch!
c86533f
to
56185a3
Compare
6501f2a
to
584af24
Compare
56185a3
to
34ef1ba
Compare
584af24
to
1a8cb5c
Compare
34ef1ba
to
8a20339
Compare
1a8cb5c
to
0b14862
Compare
8a20339
to
1d9f08c
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 2 files at r5, all commit messages.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @ohad-starkware)
1d9f08c
to
b5e6acc
Compare
0b14862
to
4d64300
Compare
b5e6acc
to
188ba5c
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 2 files at r5.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Alon-Ti)
crates/prover/src/constraint_framework/expr.rs
line 196 at r5 (raw file):
} pub fn simplify(expr: Expr) -> Expr {
I think this function should have more tests
Code quote:
pub fn simplify(expr: Expr) -> Expr {
crates/prover/src/constraint_framework/expr.rs
line 217 at r5 (raw file):
} else { a + b }
I think match statement is more readable
Consider to change
Code quote:
if let (Expr::Const(a), Expr::Const(b)) = (a.clone(), b.clone()) {
Expr::Const(a + b)
} else if a == Expr::zero() {
b
} else if b == Expr::zero() {
a
} else if let Expr::Neg(a) = a {
if let Expr::Neg(b) = b {
-(*a + *b)
} else {
b - *a
}
} else if let Expr::Neg(b) = b {
a - *b
} else {
a + b
}
crates/prover/src/constraint_framework/expr.rs
line 264 at r5 (raw file):
let a = simplify(*a); match a { Expr::Neg(b) => *b,
Is this Neg(Neg(a))? can you comment on that?
Code quote:
Expr::Neg(b) => *b,
crates/prover/src/constraint_framework/expr.rs
line 264 at r5 (raw file):
let a = simplify(*a); match a { Expr::Neg(b) => *b,
What happens if a
is a secure column?
Code quote:
match a {
Expr::Neg(b) => *b,
crates/prover/src/constraint_framework/expr.rs
line 267 at r5 (raw file):
Expr::Const(c) => Expr::Const(-c), Expr::Sub(a, b) => Expr::Sub(b, a), _ => -a,
I'm a bit worried of this
Will it always be correct?
Code quote:
_ => -a,
No description provided.