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

Add cairo1-run pretty printing #1630

Merged
merged 17 commits into from
Feb 28, 2024
Merged

Add cairo1-run pretty printing #1630

merged 17 commits into from
Feb 28, 2024

Conversation

juanbono
Copy link
Member

@juanbono juanbono commented Feb 23, 2024

Add cairo1-run pretty printing

Description

This PR adds pretty printing of the cairo1-run output for the following types:

  • Felts
  • Spans/arrays of felts, spans and dicts
  • Dicts of felts, spans and dicts.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

Copy link

github-actions bot commented Feb 26, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.310 ± 0.020 2.289 2.356 1.00 ± 0.01
head big_factorial 2.308 ± 0.014 2.295 2.334 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.306 ± 0.009 2.294 2.316 1.00
head big_fibonacci 2.315 ± 0.022 2.300 2.369 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.591 ± 0.099 8.498 8.760 1.00
head blake2s_integration_benchmark 8.688 ± 0.287 8.446 9.290 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.379 ± 0.023 2.355 2.435 1.00
head compare_arrays_200000 2.387 ± 0.036 2.360 2.487 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.483 ± 0.023 1.458 1.537 1.01 ± 0.02
head dict_integration_benchmark 1.472 ± 0.013 1.461 1.491 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.330 ± 0.020 1.312 1.382 1.00
head field_arithmetic_get_square_benchmark 1.332 ± 0.034 1.303 1.423 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.644 ± 0.103 8.457 8.805 1.00 ± 0.04
head integration_builtins 8.631 ± 0.297 8.443 9.417 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.869 ± 0.125 8.687 9.068 1.00 ± 0.02
head keccak_integration_benchmark 8.842 ± 0.111 8.695 8.985 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.412 ± 0.051 2.372 2.544 1.01 ± 0.02
head linear_search 2.399 ± 0.013 2.378 2.418 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.604 ± 0.017 1.580 1.632 1.00
head math_cmp_and_pow_integration_benchmark 1.613 ± 0.021 1.579 1.654 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.458 ± 0.019 1.433 1.492 1.00 ± 0.02
head math_integration_benchmark 1.452 ± 0.017 1.432 1.470 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.293 ± 0.018 1.275 1.310 1.00
head memory_integration_benchmark 1.316 ± 0.037 1.276 1.399 1.02 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.633 ± 0.010 1.620 1.647 1.00 ± 0.01
head operations_with_data_structures_benchmarks 1.632 ± 0.016 1.615 1.664 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 596.4 ± 2.4 592.3 599.4 1.00
head pedersen 597.0 ± 5.4 592.6 609.7 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 993.9 ± 12.5 982.5 1027.7 1.01 ± 0.01
head poseidon_integration_benchmark 985.5 ± 5.2 977.3 992.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.897 ± 0.027 1.871 1.964 1.00 ± 0.02
head secp_integration_benchmark 1.897 ± 0.018 1.883 1.935 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 737.5 ± 6.5 728.9 752.0 1.00
head set_integration_benchmark 738.5 ± 7.5 731.6 756.6 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.718 ± 0.051 4.679 4.855 1.00 ± 0.01
head uint256_integration_benchmark 4.703 ± 0.030 4.663 4.742 1.00

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

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

Project coverage is 97.63%. Comparing base (bdcfb1f) to head (967bd18).

Files Patch % Lines
cairo1-run/src/serialize_output.rs 86.36% 15 Missing ⚠️
cairo1-run/src/main.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1630      +/-   ##
==========================================
- Coverage   97.67%   97.63%   -0.04%     
==========================================
  Files          91       92       +1     
  Lines       37393    37464      +71     
==========================================
+ Hits        36523    36579      +56     
- Misses        870      885      +15     

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

@juanbono juanbono changed the title Fix dict lookup hint Add Cairo1 pretty printing Feb 27, 2024
@juanbono juanbono changed the title Add Cairo1 pretty printing Add cairo1-run pretty printing Feb 27, 2024
@juanbono juanbono marked this pull request as ready for review February 27, 2024 22:06
Copy link
Member

@pefontana pefontana left a comment

Choose a reason for hiding this comment

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

Nice one Sir. John !
I think we just need to make some clippy fixies to handle an error and we are good to go

@pefontana pefontana added this pull request to the merge queue Feb 28, 2024
Merged via the queue into main with commit 061ba87 Feb 28, 2024
50 of 51 checks passed
@pefontana pefontana deleted the fix_dict_lookup_hint branch February 28, 2024 15:41
fmoletta added a commit that referenced this pull request Mar 4, 2024
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2024
* Revert "Add cairo1-run pretty printing (#1630)"

This reverts commit 061ba87.

* First iteration progress

* Copy tests from reverted PR

* Fix expected test value

* Format fixes + add continue

* Fmt + better commentary

* Update test file

* Update commentary

* Add test for reported bug

* Update Changelog

* Fix

* Dereference references upon output serialization + Add test

* Add comment to serialize_output function

* Expand CHANGELOG description with new behaviour

* fmt

* Use doc commnt
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