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

Use to_bigint to output representation as bigint #1100

Merged
merged 5 commits into from
May 4, 2023
Merged

Conversation

mfachal
Copy link
Contributor

@mfachal mfachal commented May 3, 2023

Use to_bigint to output representation as bigint.

Description

Use to_bigint to output representation as bigint and use to_signed_felt to output bigint within the [-p/2, p/2] range.
#1074.

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.

@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Merging #1100 (a791ebd) into main (c17aa23) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1100      +/-   ##
==========================================
- Coverage   98.15%   98.15%   -0.01%     
==========================================
  Files          85       85              
  Lines       34534    34514      -20     
==========================================
- Hits        33897    33877      -20     
  Misses        637      637              
Impacted Files Coverage Δ
felt/src/bigint_felt.rs 96.10% <100.00%> (+0.01%) ⬆️
felt/src/lib.rs 90.17% <100.00%> (+0.03%) ⬆️
...rc/hint_processor/builtin_hint_processor/bigint.rs 97.76% <100.00%> (ø)
...int_processor/builtin_hint_processor/math_utils.rs 98.06% <100.00%> (-0.01%) ⬇️
...cessor/builtin_hint_processor/secp/bigint_utils.rs 97.61% <100.00%> (ø)
...rocessor/builtin_hint_processor/secp/secp_utils.rs 100.00% <100.00%> (ø)
src/vm/runners/builtin_runner/ec_op.rs 98.69% <100.00%> (-0.05%) ⬇️
src/vm/vm_core.rs 97.87% <100.00%> (ø)

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

@github-actions
Copy link

github-actions bot commented May 3, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 19.808 ± 0.546 19.535 21.337 1.01 ± 0.03
head blake2s_integration_benchmark 19.587 ± 0.082 19.500 19.699 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 5.933 ± 0.062 5.863 6.080 1.01 ± 0.01
head compare_arrays_200000 5.878 ± 0.026 5.843 5.924 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.716 ± 0.026 3.680 3.748 1.00
head dict_integration_benchmark 3.717 ± 0.025 3.679 3.762 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 6.305 ± 0.050 6.248 6.373 1.00 ± 0.01
head factorial_multirun 6.276 ± 0.043 6.238 6.380 1.00
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 5.534 ± 0.062 5.479 5.700 1.01 ± 0.01
head fibonacci_1000_multirun 5.493 ± 0.032 5.464 5.557 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 244.0 ± 1.8 241.4 246.7 1.00 ± 0.01
head field_arithmetic_get_square_benchmark 243.7 ± 2.5 240.8 248.7 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 18.472 ± 0.274 18.312 19.211 1.01 ± 0.02
head integration_builtins 18.380 ± 0.077 18.278 18.565 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 19.774 ± 0.199 19.566 20.152 1.00 ± 0.01
head keccak_integration_benchmark 19.722 ± 0.176 19.546 20.088 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 5.919 ± 0.032 5.887 5.984 1.00 ± 0.01
head linear_search 5.898 ± 0.035 5.845 5.971 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 4.015 ± 0.047 3.978 4.140 1.01 ± 0.01
head math_cmp_and_pow_integration_benchmark 3.979 ± 0.013 3.961 3.997 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.751 ± 0.019 3.731 3.796 1.00 ± 0.01
head math_integration_benchmark 3.750 ± 0.016 3.722 3.770 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 3.308 ± 0.012 3.289 3.325 1.00 ± 0.01
head memory_integration_benchmark 3.304 ± 0.014 3.274 3.319 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 3.721 ± 0.019 3.680 3.749 1.00 ± 0.01
head operations_with_data_structures_benchmarks 3.711 ± 0.012 3.696 3.733 1.00
Command Mean [s] Min [s] Max [s] Relative
base pedersen 1.210 ± 0.017 1.199 1.257 1.01 ± 0.02
head pedersen 1.201 ± 0.008 1.189 1.209 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.989 ± 0.012 1.975 2.004 1.00
head poseidon_integration_benchmark 1.989 ± 0.009 1.973 2.003 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 4.591 ± 0.027 4.546 4.624 1.00 ± 0.01
head secp_integration_benchmark 4.578 ± 0.029 4.535 4.619 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.370 ± 0.018 2.347 2.402 1.00
head set_integration_benchmark 2.390 ± 0.006 2.377 2.397 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 11.840 ± 0.081 11.719 11.951 1.01 ± 0.01
head uint256_integration_benchmark 11.723 ± 0.043 11.660 11.813 1.00

@pefontana pefontana added this pull request to the merge queue May 4, 2023
Merged via the queue into main with commit 72065eb May 4, 2023
@pefontana pefontana deleted the felt-bigint branch May 4, 2023 19:03
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* WIP to_bigint

* use to_signed_felt where necessary

* correct remaining to_biguint().to_bigint() pattern

* address comments
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.

3 participants