-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add final lookup constraint. #667
Conversation
0949cde
to
6e23bb7
Compare
01cf025
to
5840c13
Compare
6e23bb7
to
68daccc
Compare
5840c13
to
2239d0c
Compare
68daccc
to
2d0b7f2
Compare
2239d0c
to
69f679c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 06-16-add_lookup_final_boundary_constraints #667 +/- ##
============================================================================
Coverage 90.27% 90.27%
============================================================================
Files 75 75
Lines 10005 10005
Branches 10005 10005
============================================================================
Hits 9032 9032
Misses 892 892
Partials 81 81 ☔ View full report in Codecov by Sentry. |
2d0b7f2
to
d6581be
Compare
69f679c
to
e5d2a89
Compare
d6581be
to
8320e79
Compare
e5d2a89
to
9061e0b
Compare
8320e79
to
73c3fc5
Compare
9061e0b
to
d9ff10b
Compare
73c3fc5
to
2590d46
Compare
d9ff10b
to
4f1c250
Compare
2590d46
to
4a6e186
Compare
4f1c250
to
580ab28
Compare
4a6e186
to
fbfc89f
Compare
580ab28
to
ca9eb4b
Compare
fbfc89f
to
3578d66
Compare
ca9eb4b
to
a7f7fdf
Compare
2d1a9de
to
513b230
Compare
9f3520e
to
dc1db6d
Compare
513b230
to
d1d82e6
Compare
dc1db6d
to
e3340b7
Compare
d1d82e6
to
670cfcc
Compare
e3340b7
to
7ac9063
Compare
670cfcc
to
7615aa4
Compare
7ac9063
to
8405dea
Compare
7615aa4
to
4a0804a
Compare
8405dea
to
d76e1de
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 2 files reviewed, 3 unresolved discussions (waiting on @alonh5 and @spapinistarkware)
crates/prover/src/examples/wide_fibonacci/constraint_eval.rs
line 199 at r2 (raw file):
&[ lookup_values[LOOKUP_VALUE_N_MINUS_2_ID], lookup_values[LOOKUP_VALUE_N_MINUS_1_ID],
Those should be fetched at the beginning of the function instead of reading it for each numerator calculation
Code quote:
lookup_values[LOOKUP_VALUE_N_MINUS_2_ID],
lookup_values[LOOKUP_VALUE_N_MINUS_1_ID],
crates/prover/src/examples/wide_fibonacci/constraint_eval.rs
line 211 at r2 (raw file):
alpha, z, ));
This can be a shared utility function for both the step constraint and the boundary constraint
Code quote:
* ((value
* shifted_secure_combination(
&[
lookup_values[LOOKUP_VALUE_N_MINUS_2_ID],
lookup_values[LOOKUP_VALUE_N_MINUS_1_ID],
],
alpha,
z,
))
- shifted_secure_combination(
&[
lookup_values[LOOKUP_VALUE_0_ID],
lookup_values[LOOKUP_VALUE_1_ID],
],
alpha,
z,
));
crates/prover/src/examples/wide_fibonacci/constraint_eval.rs
line 327 at r2 (raw file):
zero_domain, &mut accum, );
It would be more efficient to evaluate the numerators together
and the denominators together (i.e. in the same for loop)
That way the memory access pattern is more efficient
Code quote:
self.evaluate_trace_boundary_constraints(
trace_evals,
trace_eval_domain,
zero_domain,
&mut accum,
lookup_values,
);
self.evaluate_lookup_step_constraints(
trace_evals,
trace_eval_domain,
zero_domain,
&mut accum,
interaction_elements,
);
self.evaluate_lookup_boundary_constraints(
trace_evals,
trace_eval_domain,
zero_domain,
&mut accum,
interaction_elements,
lookup_values,
);
self.evaluate_trace_step_constraints(
trace_evals,
trace_eval_domain,
zero_domain,
&mut accum,
);
4a0804a
to
e7e8777
Compare
d76e1de
to
0abcc54
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, 3 unresolved discussions (waiting on @shaharsamocha7 and @spapinistarkware)
crates/prover/src/examples/wide_fibonacci/constraint_eval.rs
line 199 at r2 (raw file):
Previously, shaharsamocha7 wrote…
Those should be fetched at the beginning of the function instead of reading it for each numerator calculation
Done.
crates/prover/src/examples/wide_fibonacci/constraint_eval.rs
line 211 at r2 (raw file):
Previously, shaharsamocha7 wrote…
This can be a shared utility function for both the step constraint and the boundary constraint
I tried it and it didn't really save lines of code, so I'll leave it as is for now.
crates/prover/src/examples/wide_fibonacci/constraint_eval.rs
line 327 at r2 (raw file):
Previously, shaharsamocha7 wrote…
It would be more efficient to evaluate the numerators together
and the denominators together (i.e. in the same for loop)That way the memory access pattern is more efficient
Added a TODO.
e7e8777
to
f9a19f5
Compare
0abcc54
to
0eca520
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: 1 of 2 files reviewed, all discussions resolved (waiting on @spapinistarkware)
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 r2, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @alonh5)
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: complete! all files reviewed, all discussions resolved (waiting on @alonh5)
f9a19f5
to
8b8d2b9
Compare
0eca520
to
7d781c7
Compare
8b8d2b9
to
5d43adf
Compare
7d781c7
to
446122b
Compare
446122b
to
68aae20
Compare
This change is