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: getters for prime, builtin names and data #1017

Merged
merged 1 commit into from
Apr 19, 2023
Merged

Conversation

Oppen
Copy link
Contributor

@Oppen Oppen commented Apr 19, 2023

Required by starknet_in_rust, Program now has three new methods:

  • prime() -> &str returns the prime for that Program as a string
  • iter_data() -> Iterator<Item = &MaybeRelocatable>, an iterator over the program data
  • iter_builtins() -> Iterator<Item = &BuiltinName>, an iterator over the names of enabled builtins

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.

Sorry, something went wrong.

@Oppen Oppen force-pushed the feat/program_accessors branch from eeaacb5 to 64cce08 Compare April 19, 2023 21:12
@Oppen Oppen marked this pull request as ready for review April 19, 2023 21:12
Copy link
Collaborator

@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 19, 2023 21:20
@github-actions
Copy link

github-actions bot commented Apr 19, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 3.464 ± 0.051 3.406 3.590 1.00 ± 0.03
head blake2s_integration_benchmark 3.457 ± 0.075 3.407 3.653 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.102 ± 0.050 4.038 4.205 1.01 ± 0.02
head compare_arrays_200000 4.068 ± 0.046 4.017 4.169 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.094 ± 0.031 3.044 3.151 1.01 ± 0.01
head dict_integration_benchmark 3.074 ± 0.026 3.037 3.115 1.00
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 4.916 ± 0.019 4.894 4.957 1.00
head factorial_multirun 5.048 ± 0.036 4.994 5.107 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 4.008 ± 0.024 3.971 4.040 1.00
head fibonacci_1000_multirun 4.036 ± 0.052 3.979 4.155 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 4.116 ± 0.043 4.050 4.200 1.01 ± 0.01
head integration_builtins 4.085 ± 0.043 4.024 4.140 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 3.805 ± 0.040 3.730 3.851 1.00 ± 0.01
head keccak_integration_benchmark 3.794 ± 0.036 3.742 3.863 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.240 ± 0.047 4.174 4.318 1.00 ± 0.01
head linear_search 4.228 ± 0.040 4.179 4.312 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.509 ± 0.035 3.460 3.578 1.01 ± 0.01
head math_cmp_and_pow_integration_benchmark 3.477 ± 0.026 3.421 3.499 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.201 ± 0.034 3.135 3.251 1.00 ± 0.02
head math_integration_benchmark 3.200 ± 0.058 3.115 3.335 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.837 ± 0.031 2.787 2.898 1.00
head memory_integration_benchmark 2.842 ± 0.065 2.777 3.021 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.765 ± 0.022 2.711 2.787 1.00
head operations_with_data_structures_benchmarks 2.769 ± 0.019 2.739 2.816 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base pedersen 4.029 ± 0.031 3.990 4.082 1.00
head pedersen 4.045 ± 0.026 3.994 4.078 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.805 ± 0.024 1.770 1.852 1.00 ± 0.02
head poseidon_integration_benchmark 1.800 ± 0.017 1.761 1.823 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.259 ± 0.032 3.214 3.328 1.00
head secp_integration_benchmark 3.299 ± 0.058 3.212 3.392 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.516 ± 0.025 2.475 2.546 1.00 ± 0.01
head set_integration_benchmark 2.516 ± 0.022 2.483 2.547 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.654 ± 0.064 4.565 4.773 1.00
head uint256_integration_benchmark 4.661 ± 0.031 4.603 4.706 1.00 ± 0.02

@Oppen Oppen force-pushed the feat/program_accessors branch from 11fe537 to 551de29 Compare April 19, 2023 21:43

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Required by starknet_in_rust, `Program` now has three new methods:
- `prime() -> &str` returns the prime for that `Program` as a string
- `iter_data() -> Iterator<Item = &MaybeRelocatable>`, an iterator over
  the program data
- `iter_builtins() -> Iterator<Item = &BuiltinName>`, an iterator over
  the names of enabled builtins
@Oppen Oppen force-pushed the feat/program_accessors branch from 551de29 to 38aca65 Compare April 19, 2023 21:45
@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #1017 (38aca65) into main (56828e1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1017   +/-   ##
=======================================
  Coverage   98.03%   98.04%           
=======================================
  Files          76       76           
  Lines       31767    31845   +78     
=======================================
+ Hits        31143    31221   +78     
  Misses        624      624           
Impacted Files Coverage Δ
src/types/program.rs 99.24% <100.00%> (+0.12%) ⬆️

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

@Oppen Oppen added this pull request to the merge queue Apr 19, 2023
Merged via the queue into main with commit 5254822 Apr 19, 2023
@Oppen Oppen deleted the feat/program_accessors branch April 19, 2023 22:36
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
Required by starknet_in_rust, `Program` now has three new methods:
- `prime() -> &str` returns the prime for that `Program` as a string
- `iter_data() -> Iterator<Item = &MaybeRelocatable>`, an iterator over
  the program data
- `iter_builtins() -> Iterator<Item = &BuiltinName>`, an iterator over
  the names of enabled builtins
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

3 participants