-
Notifications
You must be signed in to change notification settings - Fork 206
Fix comment in initialize_builtins()
#2005
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
Conversation
initialize_builtins()initialize_builtins()
|
|
Benchmark Results for unmodified programs 🚀
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2005 +/- ##
=======================================
Coverage 96.53% 96.53%
=======================================
Files 102 102
Lines 42725 42725
=======================================
Hits 41245 41245
Misses 1480 1480 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
I don't think there is an error.
When running in proof_mode
- all builtins in the layout are created: this is true
- only those in the program will be included: this is also true, see that the variable
includedis given to the creation of each builtin.
|
I wouldn't say the second point is always true. Take this snippet of the function as an example: if let Some(instance_def) = self.layout.builtins.pedersen.as_ref() {
let included = program_builtins.remove(&BuiltinName::pedersen);
if included || self.is_proof_mode() {
self.vm
.builtin_runners
.push(HashBuiltinRunner::new(instance_def.ratio, included).into());
}
}and this cairo code: %builtins output range_check bitwise keccak poseidon range_check96 add_mod mul_mod
from starkware.cairo.common.cairo_builtins import (
BitwiseBuiltin,
KeccakBuiltin,
PoseidonBuiltin,
ModBuiltin,
HashBuiltin,
SignatureBuiltin,
EcOpBuiltin,
)
func main{
output_ptr: felt*,
range_check_ptr,
bitwise_ptr: BitwiseBuiltin*,
keccak_ptr: KeccakBuiltin*,
poseidon_ptr: PoseidonBuiltin*,
range_check96_ptr: felt*,
add_mod_ptr: ModBuiltin*,
mul_mod_ptr: ModBuiltin*,
}() {
}Running this with |
|
Regarding the snippet: if let Some(instance_def) = self.layout.builtins.pedersen.as_ref() {
let included = program_builtins.remove(&BuiltinName::pedersen);
if included || self.is_proof_mode() {
self.vm
.builtin_runners
.push(HashBuiltinRunner::new(instance_def.ratio, included).into());
}
}You could add some debug prints just in case, but the runner is added to the |
|
Mmm, I agree with you in that You can try running the cairo code in proof mode, and debug the |
The comment doesn't say that the builtin will not be in the builtin list. The comment says that:
In case of pedersen, that The comment is correct, but if you want you could add a clarification to avoid future misunderstandings. |
|
So perhaps we are having two different understandings of the comment. In that case, i'll add the clarification to the comment. |
|
Change the comment to add a clarification instead. |
* fix comment * fix comment * fix * change comment * format
TITLE
Description
This PR fixes the comment
initialize_builtinswhich is not matching the function's actual behavior.Checklist