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

Newhint#21 #1089

Merged
merged 7 commits into from
Apr 28, 2023
Merged

Newhint#21 #1089

merged 7 commits into from
Apr 28, 2023

Conversation

mfachal
Copy link
Contributor

@mfachal mfachal commented Apr 27, 2023

Add hint #21

Description

Add hint #21: SQUARE_SLOPE_X_MOD_P

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.

@mfachal mfachal marked this pull request as ready for review April 27, 2023 19:41
@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Merging #1089 (62e5c1f) into main (4d97173) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1089   +/-   ##
=======================================
  Coverage   98.11%   98.12%           
=======================================
  Files          84       84           
  Lines       34419    34492   +73     
=======================================
+ Hits        33771    33844   +73     
  Misses        648      648           
Impacted Files Coverage Δ
...int_processor/builtin_hint_processor_definition.rs 99.06% <100.00%> (+<0.01%) ⬆️
..._processor/builtin_hint_processor/secp/ec_utils.rs 99.58% <100.00%> (+0.03%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

github-actions bot commented Apr 27, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 3.535 ± 0.053 3.478 3.664 1.00
head blake2s_integration_benchmark 3.549 ± 0.043 3.493 3.623 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.162 ± 0.043 4.117 4.266 1.00
head compare_arrays_200000 4.187 ± 0.123 4.068 4.479 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.290 ± 0.090 3.132 3.455 1.00
head dict_integration_benchmark 3.299 ± 0.096 3.129 3.491 1.00 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 5.298 ± 0.108 5.119 5.493 1.02 ± 0.03
head factorial_multirun 5.207 ± 0.099 5.060 5.393 1.00
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 4.175 ± 0.075 4.018 4.248 1.03 ± 0.02
head fibonacci_1000_multirun 4.061 ± 0.041 4.016 4.152 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 146.1 ± 8.0 137.8 163.1 1.00
head field_arithmetic_get_square_benchmark 148.5 ± 7.8 139.9 165.8 1.02 ± 0.08
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 4.057 ± 0.069 4.002 4.190 1.01 ± 0.02
head integration_builtins 4.029 ± 0.036 3.982 4.086 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 3.914 ± 0.050 3.848 4.012 1.00
head keccak_integration_benchmark 3.968 ± 0.052 3.903 4.040 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.468 ± 0.046 4.384 4.531 1.01 ± 0.02
head linear_search 4.439 ± 0.093 4.368 4.642 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.669 ± 0.037 3.624 3.732 1.00
head math_cmp_and_pow_integration_benchmark 3.687 ± 0.070 3.620 3.801 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.465 ± 0.095 3.362 3.680 1.03 ± 0.03
head math_integration_benchmark 3.378 ± 0.066 3.274 3.487 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 3.086 ± 0.071 2.962 3.193 1.03 ± 0.03
head memory_integration_benchmark 2.987 ± 0.067 2.906 3.095 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.876 ± 0.032 2.845 2.935 1.02 ± 0.01
head operations_with_data_structures_benchmarks 2.816 ± 0.016 2.791 2.839 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 991.5 ± 17.0 968.1 1016.0 1.01 ± 0.02
head pedersen 978.7 ± 12.0 965.2 1006.3 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.805 ± 0.015 1.778 1.826 1.01 ± 0.02
head poseidon_integration_benchmark 1.787 ± 0.032 1.739 1.844 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.448 ± 0.074 3.332 3.541 1.03 ± 0.03
head secp_integration_benchmark 3.333 ± 0.084 3.224 3.491 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.517 ± 0.036 2.461 2.570 1.01 ± 0.02
head set_integration_benchmark 2.503 ± 0.030 2.468 2.560 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.754 ± 0.059 4.680 4.882 1.00
head uint256_integration_benchmark 4.859 ± 0.107 4.666 5.006 1.02 ± 0.03

Copy link
Contributor

@fmoletta fmoletta left a comment

Choose a reason for hiding this comment

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

Looks good! Left a small comment

Comment on lines +259 to +262
exec_scopes.insert_value("slope", slope);
exec_scopes.insert_value("x0", x0);
exec_scopes.insert_value("x1", x1);
exec_scopes.insert_value("y0", y0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these values used by other hints in the lib? If not we can just skip adding them to the scope

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I suggested adding them for completion/compatibility.

Copy link
Collaborator

@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 @mfachal
Also, can you add a unit test?

@pefontana pefontana enabled auto-merge April 28, 2023 17:59
@pefontana pefontana added this pull request to the merge queue Apr 28, 2023
Merged via the queue into main with commit b3447b5 Apr 28, 2023
@pefontana pefontana deleted the newhint21 branch April 28, 2023 18:19
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* WIP cairo program

* add hint lambdaclass#21

* update changelog

* add unit test
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.

4 participants