-
Notifications
You must be signed in to change notification settings - Fork 149
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
Sort_ecdsa_and_mod_builtins_private_inputs_by_idx #1851
Sort_ecdsa_and_mod_builtins_private_inputs_by_idx #1851
Conversation
eb93b6f
to
405878d
Compare
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1851 +/- ##
=======================================
Coverage 96.32% 96.33%
=======================================
Files 102 102
Lines 40355 40427 +72
=======================================
+ Hits 38872 38944 +72
Misses 1483 1483 ☔ View full report in Codecov by Sentry. |
Benchmark Results for unmodified programs 🚀
|
405878d
to
09fa5d8
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.
Great @YairVaknin-starkware !
Is there a possibility to add a test? I don't know what these changes are for
If we could add an integration test, if not a unit test, it would be good
@pefontana It's just sorting the array in the resulting air_private_input json output file according to indices, so comparing air_private_inputs using https://github.com/lambdaclass/cairo-vm/blob/main/vm/src/tests/air_private_input_comparator.py for example doesn't fail unnecessarily if either of those two builtins are included (when comparing to a python cairo run). |
@@ -238,6 +238,10 @@ impl SignatureBuiltinRunner { | |||
})) | |||
} | |||
} | |||
private_inputs.sort_by_key(|input| match input { | |||
PrivateInput::Signature(sig) => sig.index, | |||
_ => unreachable!(), |
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.
How much work is to add an error handling here?
If it is not possible at least add an error message to the user and a line documenting why it is not possible to get into the unreachable
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.
Added a msg here and also added a test for the signature's air_public_input
fn.
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.
How much work is to add an error handling here?
If it is not possible at least add an error message to the user and a line documenting why it is not possible to get into the unreachable
I can add error handling, but I'm not sure how elegant it will be. Lmk if it's important, or if it's okay the way it is now.
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.
Also, currently air_private_input
doesn't return a Result type for any builtin variant. Do we want to panic
or refactor the code that uses it? Because this case can never happen, I think if we do add an error panic
is probably okay(?).
Okey! no problem, it is okey to don't add test in this case |
fefd672
to
9a79ba8
Compare
…g unreachable clause
9a79ba8
to
125bbb4
Compare
Hi @YairVaknin-starkware! It would be great if you could remove the unreachable. I think there is a way to do it without changing the signature. The Instead of doing this, you could:
Let me know your thoughts on this approach. |
f0f0cfb
to
0a36033
Compare
This might be the
Hi @JulianGCalderon. I opted to sort the signatures before iterating. Please lmk what you think. |
TITLE
Sort_ecdsa_and_mod_builtins_private_inputs_by_idx
Description
Making sure to sort the resulted list of those builtins in the air_private_input_file by index, so it is aligned with the python vm's outputs.
Description of the pull request changes and motivation.
Checklist