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

feat(hints): add NewHint#61 #1056

Merged
merged 8 commits into from
Apr 26, 2023
Merged

feat(hints): add NewHint#61 #1056

merged 8 commits into from
Apr 26, 2023

Conversation

pefontana
Copy link
Member

@pefontana pefontana commented Apr 25, 2023

Implement Hint #61

    %{
        from starkware.python.math_utils import ec_double_slope
        from starkware.cairo.common.cairo_secp.secp_utils import pack
        SECP_P = 2**255-19

        # Compute the slope.
        x = pack(ids.point.x, PRIME)
        y = pack(ids.point.y, PRIME)
        value = slope = ec_double_slope(point=(x, y), alpha=42204101795669822316448953119945047945709099015225996174933988943478124189485, p=SECP_P)
    %}

Issue: #979

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.

@github-actions
Copy link

github-actions bot commented Apr 25, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 3.949 ± 0.103 3.805 4.183 1.01 ± 0.04
head blake2s_integration_benchmark 3.907 ± 0.101 3.797 4.129 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.722 ± 0.191 4.493 5.121 1.03 ± 0.04
head compare_arrays_200000 4.598 ± 0.060 4.522 4.737 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.501 ± 0.053 3.424 3.577 1.00 ± 0.02
head dict_integration_benchmark 3.485 ± 0.037 3.436 3.556 1.00
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 5.672 ± 0.069 5.577 5.815 1.00
head factorial_multirun 5.701 ± 0.113 5.597 5.969 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 4.576 ± 0.097 4.413 4.722 1.01 ± 0.02
head fibonacci_1000_multirun 4.510 ± 0.050 4.423 4.580 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 161.5 ± 7.0 153.4 170.6 1.02 ± 0.05
head field_arithmetic_get_square_benchmark 158.8 ± 4.3 153.5 167.2 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 4.493 ± 0.107 4.367 4.697 1.00 ± 0.03
head integration_builtins 4.490 ± 0.051 4.417 4.574 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 4.255 ± 0.060 4.173 4.391 1.00
head keccak_integration_benchmark 4.278 ± 0.047 4.233 4.351 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.797 ± 0.120 4.672 5.073 1.01 ± 0.03
head linear_search 4.764 ± 0.097 4.599 4.932 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.957 ± 0.170 3.814 4.361 1.00 ± 0.05
head math_cmp_and_pow_integration_benchmark 3.946 ± 0.086 3.862 4.139 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.647 ± 0.152 3.546 4.050 1.02 ± 0.05
head math_integration_benchmark 3.568 ± 0.080 3.473 3.673 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 3.157 ± 0.029 3.129 3.215 1.02 ± 0.02
head memory_integration_benchmark 3.103 ± 0.046 3.029 3.169 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 3.054 ± 0.030 3.001 3.102 1.00
head operations_with_data_structures_benchmarks 3.088 ± 0.082 2.996 3.285 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base pedersen 1.097 ± 0.082 1.055 1.324 1.04 ± 0.08
head pedersen 1.058 ± 0.016 1.041 1.096 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 2.014 ± 0.037 1.949 2.071 1.02 ± 0.03
head poseidon_integration_benchmark 1.979 ± 0.038 1.930 2.066 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.622 ± 0.022 3.598 3.653 1.01 ± 0.01
head secp_integration_benchmark 3.594 ± 0.026 3.557 3.653 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.627 ± 0.042 2.563 2.719 1.00 ± 0.02
head set_integration_benchmark 2.627 ± 0.039 2.574 2.684 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 5.296 ± 0.044 5.218 5.344 1.00 ± 0.01
head uint256_integration_benchmark 5.274 ± 0.047 5.200 5.369 1.00

@pefontana pefontana marked this pull request as ready for review April 25, 2023 21:28
@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Merging #1056 (29a54ae) into main (1feaba0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1056   +/-   ##
=======================================
  Coverage   98.08%   98.08%           
=======================================
  Files          84       84           
  Lines       33600    33645   +45     
=======================================
+ Hits        32957    33002   +45     
  Misses        643      643           
Impacted Files Coverage Δ
...rocessor/builtin_hint_processor/secp/secp_utils.rs 100.00% <ø> (ø)
...int_processor/builtin_hint_processor_definition.rs 98.96% <100.00%> (+0.01%) ⬆️
..._processor/builtin_hint_processor/secp/ec_utils.rs 99.49% <100.00%> (+0.02%) ⬆️

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

CHANGELOG.md Show resolved Hide resolved
@Oppen Oppen added the whitelisted-hint Implementation of hint on whitelist directory label Apr 25, 2023
Copy link
Member

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

LGTM

@Oppen Oppen enabled auto-merge April 26, 2023 04:34
@Oppen Oppen added this pull request to the merge queue Apr 26, 2023
Merged via the queue into main with commit 0cbc70d Apr 26, 2023
15 checks passed
@Oppen Oppen deleted the hint-61 branch April 26, 2023 05:44
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Add integration tests

* Implement hint

* Update CHANGELOG.md

* Add unit test

* remove prints from cairo program

* cargo fmt

---------

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
Co-authored-by: Mario Rugiero <mrugiero@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whitelisted-hint Implementation of hint on whitelist directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants