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

Fix circuit implementation #1079

Closed
wants to merge 2 commits into from
Closed

Fix circuit implementation #1079

wants to merge 2 commits into from

Conversation

JulianGCalderon
Copy link
Contributor

@JulianGCalderon JulianGCalderon commented Jan 31, 2025

We were returning the failing case of a noop libfunc (build_u96_limbs_less_than_guarantee_verify). We were returning branch 1, instead of branch 0.

This PR should fix the gas issue in #1076.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.

@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.85%. Comparing base (33606e4) to head (4273e90).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1079      +/-   ##
==========================================
+ Coverage   80.81%   80.85%   +0.04%     
==========================================
  Files         108      108              
  Lines       29558    29558              
==========================================
+ Hits        23886    23899      +13     
+ Misses       5672     5659      -13     

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

Copy link

github-actions bot commented Jan 31, 2025

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 3.899 ± 0.048 3.844 3.966 1.02 ± 0.02
base dict_insert.cairo (AOT) 3.829 ± 0.039 3.772 3.883 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 3.845 ± 0.016 3.812 3.869 1.02 ± 0.01
head dict_insert.cairo (AOT) 3.762 ± 0.016 3.735 3.786 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 3.823 ± 0.068 3.734 3.918 1.03 ± 0.03
base dict_snapshot.cairo (AOT) 3.698 ± 0.074 3.625 3.881 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 3.744 ± 0.027 3.715 3.788 1.03 ± 0.02
head dict_snapshot.cairo (AOT) 3.643 ± 0.060 3.579 3.793 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 4.115 ± 0.024 4.078 4.157 1.01 ± 0.01
base factorial_2M.cairo (AOT) 4.086 ± 0.044 4.043 4.196 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 4.079 ± 0.017 4.045 4.096 1.01 ± 0.01
head factorial_2M.cairo (AOT) 4.038 ± 0.025 4.001 4.091 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 3.717 ± 0.038 3.664 3.798 1.00 ± 0.02
base fib_2M.cairo (AOT) 3.715 ± 0.061 3.625 3.805 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 3.600 ± 0.015 3.578 3.624 1.01 ± 0.01
head fib_2M.cairo (AOT) 3.581 ± 0.026 3.548 3.633 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 3.867 ± 0.057 3.804 3.948 1.04 ± 0.02
base linear_search.cairo (AOT) 3.727 ± 0.022 3.694 3.755 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 3.817 ± 0.026 3.772 3.861 1.04 ± 0.01
head linear_search.cairo (AOT) 3.680 ± 0.025 3.639 3.731 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.948 ± 0.040 3.913 4.049 1.04 ± 0.01
base logistic_map.cairo (AOT) 3.793 ± 0.031 3.763 3.862 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.921 ± 0.015 3.897 3.951 1.04 ± 0.01
head logistic_map.cairo (AOT) 3.767 ± 0.018 3.730 3.787 1.00

Copy link

github-actions bot commented Jan 31, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 20.777 ± 0.086 20.654 20.903 5.40 ± 0.10
cairo-native (embedded AOT) 3.848 ± 0.071 3.756 3.983 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.998 ± 0.055 3.923 4.078 1.04 ± 0.02

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.978 ± 0.049 5.910 6.068 1.57 ± 0.02
cairo-native (embedded AOT) 3.803 ± 0.039 3.759 3.875 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.828 ± 0.029 3.786 3.865 1.01 ± 0.01

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.409 ± 0.109 14.143 14.538 3.53 ± 0.04
cairo-native (embedded AOT) 4.087 ± 0.030 4.039 4.131 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.091 ± 0.015 4.069 4.111 1.00 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.408 ± 0.080 14.296 14.558 3.99 ± 0.04
cairo-native (embedded AOT) 3.610 ± 0.025 3.572 3.646 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.689 ± 0.048 3.632 3.764 1.02 ± 0.02

Benchmark for program linear_search

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.866 ± 0.039 5.818 5.939 1.57 ± 0.02
cairo-native (embedded AOT) 3.735 ± 0.049 3.668 3.824 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.818 ± 0.022 3.776 3.843 1.02 ± 0.01

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.992 ± 0.048 5.934 6.079 1.48 ± 0.03
cairo-native (embedded AOT) 4.043 ± 0.077 3.873 4.130 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.173 ± 0.015 4.150 4.195 1.03 ± 0.02

@azteca1998
Copy link
Collaborator

Have you checked if the bug was really in native instead of the Sierra emu?

edg-l
edg-l previously approved these changes Feb 1, 2025
@edg-l edg-l added the review-ready A PR that is ready for review label Feb 3, 2025
@edg-l
Copy link
Member

edg-l commented Feb 3, 2025

Can you merge the branch with the test into this one?

nvm i did it

@JulianGCalderon
Copy link
Contributor Author

Have you checked if the bug was really in native instead of the Sierra emu?

The gas issue has been fixed with this, so I assumed that this is the correct implementation.

@JulianGCalderon
Copy link
Contributor Author

Superseded by #1084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready A PR that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants