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

minor gas fix #881

Merged
merged 2 commits into from
Oct 28, 2024
Merged

minor gas fix #881

merged 2 commits into from
Oct 28, 2024

Conversation

edg-l
Copy link
Collaborator

@edg-l edg-l commented Oct 25, 2024

This applies a libfunc gas fix i found in #875
but is separate from the builtin costs rework.

The bug was that when the withdraw gas fails, on the failure branch it returned the substracted gas, but it should return the non substracted gas

Checklist

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

Copy link

github-actions bot commented Oct 25, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.938 ± 0.286 10.682 11.472 23.79 ± 0.63
cairo-native (embedded AOT) 3.160 ± 0.039 3.123 3.256 6.87 ± 0.09
cairo-native (embedded JIT using LLVM's ORC Engine) 3.186 ± 0.050 3.138 3.286 6.93 ± 0.11
cairo-native (standalone AOT) 0.663 ± 0.005 0.659 0.672 1.44 ± 0.01
cairo-native (standalone AOT with -march=native) 0.460 ± 0.001 0.459 0.464 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.272 ± 0.289 10.773 11.657 1520.54 ± 40.68
cairo-native (embedded AOT) 2.917 ± 0.059 2.792 2.997 393.48 ± 8.55
cairo-native (embedded JIT using LLVM's ORC Engine) 2.818 ± 0.035 2.771 2.894 380.09 ± 5.55
cairo-native (standalone AOT) 0.007 ± 0.000 0.007 0.008 1.00
cairo-native (standalone AOT with -march=native) 0.008 ± 0.000 0.008 0.009 1.08 ± 0.01

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.461 ± 0.034 4.426 4.523 62.08 ± 0.51
cairo-native (embedded AOT) 3.015 ± 0.043 2.955 3.080 41.95 ± 0.62
cairo-native (embedded JIT using LLVM's ORC Engine) 3.170 ± 0.054 3.078 3.244 44.11 ± 0.76
cairo-native (standalone AOT) 0.116 ± 0.000 0.116 0.117 1.61 ± 0.01
cairo-native (standalone AOT with -march=native) 0.072 ± 0.000 0.072 0.073 1.00

Copy link

github-actions bot commented Oct 25, 2024

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.191 ± 0.029 3.151 3.233 1.02 ± 0.01
base factorial_2M.cairo (JIT) 3.174 ± 0.022 3.147 3.226 1.02 ± 0.01
head factorial_2M.cairo (AOT) 3.155 ± 0.023 3.131 3.195 1.01 ± 0.01
base factorial_2M.cairo (AOT) 3.116 ± 0.010 3.098 3.131 1.00
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.689 ± 0.020 2.656 2.724 1.01 ± 0.01
base fib_2M.cairo (JIT) 2.712 ± 0.021 2.682 2.746 1.02 ± 0.01
head fib_2M.cairo (AOT) 2.654 ± 0.019 2.620 2.675 1.00
base fib_2M.cairo (AOT) 2.663 ± 0.013 2.645 2.684 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 2.974 ± 0.009 2.964 2.995 1.06 ± 0.01
base logistic_map.cairo (JIT) 2.989 ± 0.015 2.967 3.015 1.06 ± 0.01
head logistic_map.cairo (AOT) 2.830 ± 0.013 2.814 2.856 1.00 ± 0.01
base logistic_map.cairo (AOT) 2.819 ± 0.015 2.801 2.841 1.00

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.82%. Comparing base (e36bf30) to head (8aafd6c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #881   +/-   ##
=======================================
  Coverage   82.82%   82.82%           
=======================================
  Files         120      120           
  Lines       34941    34941           
=======================================
  Hits        28941    28941           
  Misses       6000     6000           

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

@edg-l edg-l added this pull request to the merge queue Oct 28, 2024
Merged via the queue into main with commit 4e8af66 Oct 28, 2024
29 of 30 checks passed
@edg-l edg-l deleted the fix_gas_minor branch October 28, 2024 15:54
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.

4 participants