Skip to content
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

[Cairo 1] Add flag to append return values to output segment when not running in proof_mode #1646

Merged
merged 19 commits into from
Mar 5, 2024

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Mar 4, 2024

  • Adds the flag append_return_values to both the CLI and Cairo1RunConfig struct.
  • Enabling flag will add the output builtin and the necessary instructions to append the return values to the output builtin's memory segment.

Copy link

github-actions bot commented Mar 4, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.303 ± 0.021 2.267 2.337 1.00
head big_factorial 2.311 ± 0.050 2.268 2.443 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.289 ± 0.045 2.249 2.407 1.01 ± 0.02
head big_fibonacci 2.269 ± 0.020 2.247 2.300 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.558 ± 0.168 8.456 9.030 1.01 ± 0.02
head blake2s_integration_benchmark 8.485 ± 0.036 8.441 8.549 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.383 ± 0.042 2.328 2.448 1.01 ± 0.02
head compare_arrays_200000 2.369 ± 0.026 2.334 2.432 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.480 ± 0.008 1.463 1.488 1.01 ± 0.01
head dict_integration_benchmark 1.469 ± 0.015 1.451 1.504 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.324 ± 0.017 1.306 1.362 1.00
head field_arithmetic_get_square_benchmark 1.326 ± 0.026 1.310 1.384 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.588 ± 0.166 8.482 8.985 1.00 ± 0.02
head integration_builtins 8.552 ± 0.126 8.448 8.821 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.897 ± 0.298 8.759 9.740 1.00
head keccak_integration_benchmark 8.972 ± 0.624 8.728 10.742 1.01 ± 0.08
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.397 ± 0.069 2.340 2.584 1.00
head linear_search 2.405 ± 0.058 2.354 2.536 1.00 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.593 ± 0.009 1.577 1.603 1.00
head math_cmp_and_pow_integration_benchmark 1.594 ± 0.014 1.578 1.626 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.448 ± 0.012 1.429 1.466 1.00 ± 0.01
head math_integration_benchmark 1.442 ± 0.009 1.432 1.455 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.282 ± 0.011 1.265 1.303 1.00 ± 0.02
head memory_integration_benchmark 1.281 ± 0.019 1.265 1.331 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.622 ± 0.019 1.610 1.672 1.00
head operations_with_data_structures_benchmarks 1.629 ± 0.011 1.616 1.654 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 590.7 ± 1.9 588.9 594.9 1.00
head pedersen 592.2 ± 5.0 587.0 604.9 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 984.3 ± 3.9 978.3 993.6 1.00 ± 0.01
head poseidon_integration_benchmark 983.3 ± 6.9 973.4 991.6 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.898 ± 0.021 1.874 1.926 1.00 ± 0.02
head secp_integration_benchmark 1.896 ± 0.034 1.872 1.989 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 703.4 ± 6.5 696.3 719.9 1.00
head set_integration_benchmark 703.7 ± 3.8 698.5 712.0 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.696 ± 0.010 4.683 4.713 1.00
head uint256_integration_benchmark 4.708 ± 0.034 4.666 4.794 1.00 ± 0.01

@fmoletta fmoletta changed the title [WIP][Cairo 1] Add flag to append return values to output segment when not running in proof_mode Cairo 1] Add flag to append return values to output segment when not running in proof_mode Mar 4, 2024
@fmoletta fmoletta changed the title Cairo 1] Add flag to append return values to output segment when not running in proof_mode Cairo 1] Add flag to append_return_values to output segment when not running in proof_mode Mar 4, 2024
@fmoletta fmoletta changed the title Cairo 1] Add flag to append_return_values to output segment when not running in proof_mode Cairo 1] Add flag append_return_values to output segment when not running in proof_mode Mar 4, 2024
@fmoletta fmoletta changed the title Cairo 1] Add flag append_return_values to output segment when not running in proof_mode Cairo 1] Add flag to append return values to output segment when not running in proof_mode Mar 4, 2024
@fmoletta fmoletta changed the title Cairo 1] Add flag to append return values to output segment when not running in proof_mode [Cairo 1] Add flag to append return values to output segment when not running in proof_mode Mar 4, 2024
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 97.91667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 97.64%. Comparing base (4c08af0) to head (de1f81b).

Files Patch % Lines
cairo1-run/src/main.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1646      +/-   ##
==========================================
- Coverage   97.65%   97.64%   -0.01%     
==========================================
  Files          92       92              
  Lines       37619    37656      +37     
==========================================
+ Hits        36735    36769      +34     
- Misses        884      887       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fmoletta fmoletta marked this pull request as ready for review March 5, 2024 13:11
Comment on lines +344 to +345
// Create specific instructions to append the return values to the output segment when not running in proof_mode
// Call the firt program instruction, appends the return values to the output builtin's memory segment and then returns
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is intended to be the documentation, then it should be prefixed with the triple slash ///.

@pefontana pefontana added this pull request to the merge queue Mar 5, 2024
Merged via the queue into main with commit 3ecc47e Mar 5, 2024
52 checks passed
@pefontana pefontana deleted the append_return_values branch March 5, 2024 22:27
@fmoletta fmoletta mentioned this pull request Mar 7, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants