Skip to content

Use SierraGenerator for testing (part 4) #1128

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

FrancoGiachetta
Copy link
Contributor

@FrancoGiachetta FrancoGiachetta commented Feb 28, 2025

This PR changes some tests to use Sierra code, rather than Cairo code.

This has the following advantages:

  • Reduces test execution time by omitting compilation.
  • We ensure that the test is not modified by changes in the compiler

Related to #1152

Checklist

  • Linked to Github Issue

Copy link

github-actions bot commented Feb 28, 2025

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 4.850 ± 0.046 4.795 4.926 1.02 ± 0.01
base dict_insert.cairo (AOT) 4.742 ± 0.031 4.715 4.825 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 4.707 ± 0.032 4.667 4.756 1.01 ± 0.01
head dict_insert.cairo (AOT) 4.642 ± 0.047 4.562 4.713 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 4.691 ± 0.022 4.656 4.725 1.02 ± 0.01
base dict_snapshot.cairo (AOT) 4.597 ± 0.023 4.566 4.648 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 4.602 ± 0.025 4.579 4.645 1.02 ± 0.01
head dict_snapshot.cairo (AOT) 4.508 ± 0.046 4.466 4.596 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 5.047 ± 0.025 4.991 5.071 1.01 ± 0.01
base factorial_2M.cairo (AOT) 4.986 ± 0.024 4.954 5.029 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 4.931 ± 0.035 4.894 5.000 1.00 ± 0.01
head factorial_2M.cairo (AOT) 4.918 ± 0.035 4.867 4.976 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 4.592 ± 0.039 4.545 4.665 1.01 ± 0.01
base fib_2M.cairo (AOT) 4.526 ± 0.025 4.490 4.573 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 4.505 ± 0.022 4.468 4.533 1.01 ± 0.01
head fib_2M.cairo (AOT) 4.451 ± 0.038 4.399 4.513 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 4.774 ± 0.041 4.707 4.831 1.03 ± 0.01
base linear_search.cairo (AOT) 4.634 ± 0.020 4.610 4.668 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 4.668 ± 0.015 4.639 4.686 1.03 ± 0.01
head linear_search.cairo (AOT) 4.537 ± 0.022 4.514 4.576 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 4.855 ± 0.032 4.798 4.893 1.04 ± 0.01
base logistic_map.cairo (AOT) 4.681 ± 0.026 4.651 4.739 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 4.765 ± 0.020 4.735 4.800 1.03 ± 0.01
head logistic_map.cairo (AOT) 4.607 ± 0.023 4.575 4.641 1.00

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 95.95376% with 21 lines in your changes missing coverage. Please review.

Project coverage is 80.42%. Comparing base (fe539d2) to head (0413c46).

Files with missing lines Patch % Lines
src/libfuncs/array.rs 96.29% 18 Missing ⚠️
src/values.rs 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1128      +/-   ##
==========================================
+ Coverage   80.34%   80.42%   +0.08%     
==========================================
  Files         110      110              
  Lines       29498    29588      +90     
==========================================
+ Hits        23701    23797      +96     
+ Misses       5797     5791       -6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

github-actions bot commented Feb 28, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 15.120 ± 0.122 14.939 15.398 3.29 ± 0.04
cairo-native (embedded AOT) 4.594 ± 0.033 4.564 4.662 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.672 ± 0.017 4.642 4.700 1.02 ± 0.01

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 652.3 ± 14.0 643.5 689.2 1.00
cairo-native (embedded AOT) 4468.4 ± 18.2 4443.1 4501.4 6.85 ± 0.15
cairo-native (embedded JIT using LLVM's ORC Engine) 4580.1 ± 22.9 4549.0 4621.8 7.02 ± 0.15

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 9.144 ± 0.021 9.110 9.182 1.86 ± 0.01
cairo-native (embedded AOT) 4.904 ± 0.017 4.883 4.933 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.921 ± 0.020 4.893 4.958 1.00 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 8.632 ± 0.049 8.514 8.673 1.95 ± 0.02
cairo-native (embedded AOT) 4.420 ± 0.026 4.389 4.462 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.462 ± 0.011 4.437 4.476 1.01 ± 0.01

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 668.5 ± 5.2 661.7 677.5 1.00
cairo-native (embedded AOT) 4521.2 ± 10.8 4508.2 4541.2 6.76 ± 0.06
cairo-native (embedded JIT using LLVM's ORC Engine) 4672.8 ± 27.0 4646.2 4742.1 6.99 ± 0.07

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 416.0 ± 2.1 412.8 419.0 1.00
cairo-native (embedded AOT) 4589.5 ± 20.0 4562.5 4630.2 11.03 ± 0.07
cairo-native (embedded JIT using LLVM's ORC Engine) 4749.2 ± 19.1 4711.1 4780.5 11.42 ± 0.07

@gabrielbosio gabrielbosio linked an issue Mar 28, 2025 that may be closed by this pull request
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.

Use SierraGenerator for testing
2 participants