-
Notifications
You must be signed in to change notification settings - Fork 174
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
Update recursive verifier to use Horner eval ops instead of rcomb_*
#1665
base: next
Are you sure you want to change the base?
Conversation
c294a7d
to
03bc93e
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.
Very cool!
Left some questions and nits
memchr = { version = "2.7", default-features = false } | ||
miden-crypto = { version = "0.13", default-features = false } | ||
#miden-crypto = { version = "0.13", default-features = false } | ||
miden-crypto = {git = "https://github.com/0xPolygonMiden/crypto", branch = "al-update-winter", default-features = false } |
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.
Let's remember to update this before we merge
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.
@Al-Kindi-0 we can revert this now
EDIT: or are we waiting for miden-crypto v0.14.0?
@Al-Kindi-0 - should this PR be based on #1658? Basically, the sequence would be:
Right? |
let mut main_and_aux_frame_states = ood_main_trace_frame.current().to_vec(); | ||
main_and_aux_frame_states.extend_from_slice( | ||
ood_aux_trace_frame | ||
.as_ref() | ||
.expect("execution trace should have an auxiliary segment") | ||
.current(), | ||
); | ||
main_and_aux_frame_states.extend_from_slice(ood_main_trace_frame.next()); | ||
main_and_aux_frame_states.extend_from_slice( | ||
ood_aux_trace_frame | ||
.as_ref() | ||
.expect("execution trace should have an auxiliary segment") | ||
.next(), | ||
); |
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.
Could we add a small comment here explaining what arrangement we are trying to achieve? I think it is something like:
[main_current_elements, aux_current_elements, main_next_elements, aux_next_elements]
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.
That's correct, will add a comment explaining that.
That is correct, we should make a new release of the crypto crate with the new Winterfell release, update the Miden VM PR migrating to the new Winterfell release i.e., #1658, and then we can merge the current PR. |
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.
Looks good! Thank you! Not a very deep review from me, but I left some comments inline (mostly doc-related).
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.
Looks good! Thank you! I added a few more small comments inline.
# OOD_TRACE_CURRENT_PTR: (71 + 7) * 2 * 2 = 312 | ||
# OOD_CONSTRAINT_EVALS_PTR: 8 * 2 = 16 |
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.
Shouldn't this say:
# OOD_TRACE_CURRENT_PTR: (71 + 7) * 2 = 156
# OOD_TRACE_NEXT_PTR: (71 + 7) * 2 = 156
# OOD_CONSTRAINT_EVALS_PTR: 8 * 2 = 16
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.
Missed updating these, thanks, fixed now
@@ -141,7 +140,7 @@ export.verify | |||
# VI) Evaluate the constraints over the OOD frame and assert equality with H(z) | |||
#============================================================================================== | |||
|
|||
# TODO: Compare with the evaluation of the constraints on the EvaluationFrame | |||
# Compare with the evaluation of the constraints on the trace columns OOD evaluation frame. |
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.
Shouldn't the TDDO
stay here?
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.
We usually remove todos when we have open issues tracking them. Re-added it now.
push.0x020407 | ||
## field extension degree || FRI folding factor || FRI remainder polynomial max degree || blowup factor | ||
push.0x02040708 | ||
# => [PROOF_OPTIONS, MODULUS1, MODULUS0, TRACE_INFO, trace_length, num_queries, blowup, grinding, ...] |
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.
MODULUS1
and MODULUS0
are single elements, right? If so, these should be modulus1, modulus0
.
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.
good point, fixed
a547563
to
34d4a9d
Compare
34d4a9d
to
5a81c5f
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.
LGTM! (assuming we merge after we update the Cargo.toml
with the new miden-crypto release)
As a side effect, we now have a very accurate formula to estimate the cycle count of the recursive verifier as a function of its parameters.
Putting in draft as some older PRs need to be merged before this one.