starknet_os: os resources test - support virtual builtins, add sha256#14141
Conversation
PR SummaryMedium Risk Overview The flow test harness adds Constants and expectations move together: allowed virtual OS program hash slot 2, Reviewed by Cursor Bugbot for commit 07d79f0. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 035e95f. Configure here.
aa0b28b to
e94b0c7
Compare
035e95f to
90ce97f
Compare
fd6b95e to
062b998
Compare
61ef5ef to
2144fa8
Compare
2144fa8 to
1ba5ff7
Compare
09cbdec to
c5b45e5
Compare
c190265 to
fbcb731
Compare
c5b45e5 to
a1487a4
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 8 files and made 4 comments.
Reviewable status: 8 of 10 files reviewed, 4 unresolved discussions (waiting on dorimedini-starkware and Yoni-Starkware).
crates/starknet_os/src/test_utils.rs line 22 at r2 (raw file):
// Resources consumed by the SHA-256 batch phase, separated into linear and constant factors. pub const SHA256_BLOCK_TO_ROUND: usize = 7;
Or how you called it in the previous PR.
Suggestion:
SHA256_BLOCKS_IN_ROUNDcrates/starknet_os_flow_tests/src/os_resources_test.rs line 114 at r2 (raw file):
n_steps: linear_steps, builtin_instance_counter: linear_builtin_instance_counter, n_memory_holes: linear_memory_holes,
Please
Suggestion:
round_n_steps: linear_steps,
round_builtin_instance_counter: linear_builtin_instance_counter,
round_n_memory_holes: linear_memory_holes,crates/starknet_os_flow_tests/src/os_resources_test.rs line 120 at r2 (raw file):
for (builtin, count) in linear_builtin_instance_counter.iter() { *new_resources.builtin_instance_counter.entry(*builtin).or_insert(0) += BUILTIN_INSTANCE_SIZES.get(builtin).unwrap() * count / SHA256_BLOCK_TO_ROUND;
In SHA256_BATCH_RESOURCES_LINEAR the count was the number of instances, now you count memory cells.
There, the resources are divided by the builtin size, and here you multiply by the same number.
Code quote:
BUILTIN_INSTANCE_SIZES.get(builtin).unwrap() * countcrates/blockifier/resources/blockifier_versioned_constants_0_14_4.json line 468 at r2 (raw file):
"builtin_instance_counter": { "range_check_builtin": 65, "bitwise_builtin": 1114
Number of builtins changes.
Code quote:
"bitwise_builtin": 1114
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 2 files and all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on dorimedini-starkware and Yoni-Starkware).
fbcb731 to
4d23c23
Compare
a1487a4 to
db6000c
Compare
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on yoavGrs and Yoni-Starkware).
crates/blockifier/resources/blockifier_versioned_constants_0_14_4.json line 468 at r2 (raw file):
Previously, yoavGrs wrote…
Number of builtins changes.
keep this blocking until this PR is close to main, I'll rerun the numbers...
crates/starknet_os/src/test_utils.rs line 22 at r2 (raw file):
Previously, yoavGrs wrote…
Or how you called it in the previous PR.
changed to batch size, to match the cairo-common terminology
crates/starknet_os_flow_tests/src/os_resources_test.rs line 114 at r2 (raw file):
Previously, yoavGrs wrote…
Please
Done.
crates/starknet_os_flow_tests/src/os_resources_test.rs line 120 at r2 (raw file):
Previously, yoavGrs wrote…
In
SHA256_BATCH_RESOURCES_LINEARthe count was the number of instances, now you count memory cells.
There, the resources are divided by the builtin size, and here you multiply by the same number.
correct, this is for visibility - the numbers in cairo-common are given in builtin instances. I hard-code the numbers scaled thus so that they can be compared to the cairo-common impl
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 8 files and all commit messages, and resolved 3 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Yoni-Starkware).
4d23c23 to
e1d301a
Compare
db6000c to
335dd5f
Compare
e1d301a to
07d79f0
Compare


No description provided.