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 clone and drop implementations for enums, structs and snapshots #815

Merged
merged 34 commits into from
Oct 3, 2024

Conversation

azteca1998
Copy link
Collaborator

@azteca1998 azteca1998 commented Sep 26, 2024

Changes

  • Rename a few things.
  • Remove SnapshotClonesMeta.
  • Remove old drop implementation system.
  • Add DupOverridesMeta (successor of SnapshotClonesMeta) and DropOverridesMeta.
  • Make all types that require it use the new dup and drop systems.
  • Refactor some dict methods to make them work with the new dup and drop system.

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 Sep 26, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.287 ± 0.043 3.230 3.368 1.04 ± 0.03
base factorial_2M.cairo (JIT) 3.274 ± 0.028 3.231 3.319 1.03 ± 0.03
head factorial_2M.cairo (AOT) 3.271 ± 0.022 3.227 3.294 1.03 ± 0.03
base factorial_2M.cairo (AOT) 3.175 ± 0.079 3.106 3.307 1.00
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.703 ± 0.020 2.673 2.746 1.01 ± 0.01
base fib_2M.cairo (JIT) 2.679 ± 0.011 2.663 2.695 1.00
head fib_2M.cairo (AOT) 2.695 ± 0.018 2.662 2.721 1.01 ± 0.01
base fib_2M.cairo (AOT) 2.756 ± 0.041 2.708 2.844 1.03 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.133 ± 0.021 3.106 3.159 1.06 ± 0.01
base logistic_map.cairo (JIT) 3.154 ± 0.056 3.076 3.243 1.07 ± 0.02
head logistic_map.cairo (AOT) 3.049 ± 0.087 2.963 3.200 1.03 ± 0.03
base logistic_map.cairo (AOT) 2.957 ± 0.020 2.923 2.987 1.00

Copy link

github-actions bot commented Sep 30, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.181 ± 0.061 3.113 3.274 1.03 ± 0.02
base factorial_2M.cairo (JIT) 3.112 ± 0.030 3.080 3.186 1.00 ± 0.01
head factorial_2M.cairo (AOT) 3.158 ± 0.035 3.097 3.211 1.02 ± 0.01
base factorial_2M.cairo (AOT) 3.100 ± 0.019 3.076 3.128 1.00
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.690 ± 0.016 2.651 2.704 1.01 ± 0.01
base fib_2M.cairo (JIT) 2.659 ± 0.014 2.642 2.685 1.00 ± 0.01
head fib_2M.cairo (AOT) 2.670 ± 0.015 2.651 2.700 1.01 ± 0.01
base fib_2M.cairo (AOT) 2.655 ± 0.017 2.627 2.682 1.00
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.092 ± 0.025 3.053 3.141 1.05 ± 0.01
base logistic_map.cairo (JIT) 3.063 ± 0.012 3.040 3.075 1.04 ± 0.01
head logistic_map.cairo (AOT) 2.937 ± 0.026 2.900 2.980 1.00 ± 0.01
base logistic_map.cairo (AOT) 2.934 ± 0.019 2.900 2.965 1.00

@azteca1998 azteca1998 marked this pull request as ready for review October 1, 2024 15:14
Copy link

github-actions bot commented Oct 1, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.128 ± 0.012 3.116 3.149 1.01 ± 0.01
base factorial_2M.cairo (JIT) 3.108 ± 0.024 3.065 3.145 1.00 ± 0.01
head factorial_2M.cairo (AOT) 3.125 ± 0.015 3.101 3.149 1.01 ± 0.01
base factorial_2M.cairo (AOT) 3.096 ± 0.022 3.067 3.145 1.00
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.681 ± 0.021 2.659 2.713 1.01 ± 0.01
base fib_2M.cairo (JIT) 2.659 ± 0.009 2.643 2.675 1.00 ± 0.01
head fib_2M.cairo (AOT) 2.678 ± 0.022 2.644 2.706 1.01 ± 0.01
base fib_2M.cairo (AOT) 2.655 ± 0.015 2.638 2.679 1.00
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.089 ± 0.013 3.062 3.106 1.07 ± 0.01
base logistic_map.cairo (JIT) 3.049 ± 0.022 3.030 3.091 1.05 ± 0.01
head logistic_map.cairo (AOT) 2.930 ± 0.012 2.908 2.950 1.01 ± 0.01
base logistic_map.cairo (AOT) 2.900 ± 0.014 2.871 2.916 1.00

Copy link

github-actions bot commented Oct 1, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.154 ± 0.042 3.102 3.223 1.01 ± 0.01
base factorial_2M.cairo (JIT) 3.179 ± 0.034 3.139 3.232 1.01 ± 0.01
head factorial_2M.cairo (AOT) 3.137 ± 0.019 3.108 3.175 1.00
base factorial_2M.cairo (AOT) 3.160 ± 0.032 3.119 3.216 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.698 ± 0.025 2.665 2.747 1.01 ± 0.01
base fib_2M.cairo (JIT) 2.677 ± 0.022 2.647 2.716 1.00
head fib_2M.cairo (AOT) 2.688 ± 0.031 2.642 2.745 1.00 ± 0.01
base fib_2M.cairo (AOT) 2.679 ± 0.032 2.623 2.725 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.096 ± 0.018 3.062 3.127 1.06 ± 0.01
base logistic_map.cairo (JIT) 3.079 ± 0.022 3.045 3.130 1.05 ± 0.01
head logistic_map.cairo (AOT) 2.933 ± 0.024 2.905 2.980 1.00
base logistic_map.cairo (AOT) 2.936 ± 0.018 2.910 2.974 1.00 ± 0.01

Copy link

github-actions bot commented Oct 2, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.343 ± 0.038 3.271 3.408 1.03 ± 0.02
base factorial_2M.cairo (JIT) 3.256 ± 0.053 3.172 3.316 1.00
head factorial_2M.cairo (AOT) 3.300 ± 0.033 3.228 3.331 1.01 ± 0.02
base factorial_2M.cairo (AOT) 3.289 ± 0.050 3.221 3.390 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.852 ± 0.046 2.808 2.921 1.01 ± 0.02
base fib_2M.cairo (JIT) 2.868 ± 0.069 2.786 3.005 1.02 ± 0.03
head fib_2M.cairo (AOT) 2.813 ± 0.046 2.771 2.887 1.00
base fib_2M.cairo (AOT) 2.834 ± 0.029 2.791 2.882 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.371 ± 0.050 3.309 3.453 1.09 ± 0.02
base logistic_map.cairo (JIT) 3.237 ± 0.033 3.202 3.295 1.05 ± 0.01
head logistic_map.cairo (AOT) 3.166 ± 0.051 3.066 3.230 1.03 ± 0.02
base logistic_map.cairo (AOT) 3.080 ± 0.030 3.030 3.120 1.00

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 91.96217% with 102 lines in your changes missing coverage. Please review.

Project coverage is 87.92%. Comparing base (1b8656c) to head (abea044).

Files with missing lines Patch % Lines
src/libfuncs/array.rs 19.04% 68 Missing ⚠️
src/types/enum.rs 87.81% 24 Missing ⚠️
src/types/array.rs 99.03% 2 Missing ⚠️
src/types/felt252_dict.rs 98.65% 2 Missing ⚠️
src/types/snapshot.rs 97.59% 2 Missing ⚠️
src/libfuncs/drop.rs 91.66% 1 Missing ⚠️
src/libfuncs/dup.rs 90.90% 1 Missing ⚠️
src/types/box.rs 98.83% 1 Missing ⚠️
src/types/nullable.rs 99.28% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #815      +/-   ##
==========================================
- Coverage   87.98%   87.92%   -0.07%     
==========================================
  Files         122      123       +1     
  Lines       34289    34959     +670     
==========================================
+ Hits        30169    30737     +568     
- Misses       4120     4222     +102     

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

Copy link

github-actions bot commented Oct 2, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.551 ± 0.225 3.229 3.865 1.06 ± 0.08
base factorial_2M.cairo (JIT) 3.475 ± 0.171 3.219 3.682 1.04 ± 0.06
head factorial_2M.cairo (AOT) 3.512 ± 0.127 3.325 3.685 1.05 ± 0.06
base factorial_2M.cairo (AOT) 3.338 ± 0.127 3.113 3.546 1.00
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 3.119 ± 0.134 2.804 3.302 1.08 ± 0.08
base fib_2M.cairo (JIT) 2.879 ± 0.159 2.670 3.196 1.00
head fib_2M.cairo (AOT) 2.941 ± 0.129 2.716 3.165 1.02 ± 0.07
base fib_2M.cairo (AOT) 3.032 ± 0.213 2.662 3.286 1.05 ± 0.09
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.559 ± 0.297 3.257 4.141 1.06 ± 0.10
base logistic_map.cairo (JIT) 3.431 ± 0.204 3.173 3.821 1.02 ± 0.07
head logistic_map.cairo (AOT) 3.420 ± 0.145 3.113 3.580 1.02 ± 0.06
base logistic_map.cairo (AOT) 3.350 ± 0.128 3.194 3.587 1.00

edg-l
edg-l previously approved these changes Oct 3, 2024
src/libfuncs/array.rs Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Oct 3, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.258 ± 0.050 3.202 3.341 1.03 ± 0.02
base factorial_2M.cairo (JIT) 3.210 ± 0.055 3.109 3.285 1.01 ± 0.02
head factorial_2M.cairo (AOT) 3.209 ± 0.025 3.166 3.254 1.01 ± 0.02
base factorial_2M.cairo (AOT) 3.164 ± 0.045 3.080 3.226 1.00
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.785 ± 0.029 2.737 2.822 1.03 ± 0.01
base fib_2M.cairo (JIT) 2.742 ± 0.047 2.666 2.820 1.02 ± 0.02
head fib_2M.cairo (AOT) 2.707 ± 0.038 2.665 2.775 1.00 ± 0.02
base fib_2M.cairo (AOT) 2.694 ± 0.025 2.638 2.732 1.00
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.220 ± 0.020 3.185 3.247 1.09 ± 0.01
base logistic_map.cairo (JIT) 3.097 ± 0.026 3.064 3.156 1.05 ± 0.01
head logistic_map.cairo (AOT) 3.058 ± 0.053 3.001 3.177 1.03 ± 0.02
base logistic_map.cairo (AOT) 2.956 ± 0.012 2.942 2.980 1.00

@edg-l edg-l added the review-ready A PR that is ready for review label Oct 3, 2024
edg-l
edg-l previously approved these changes Oct 3, 2024
edg-l
edg-l previously approved these changes Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

Benchmark results Main vs HEAD

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.211 ± 0.027 3.165 3.243 1.03 ± 0.01
base factorial_2M.cairo (JIT) 3.109 ± 0.011 3.088 3.124 1.00
head factorial_2M.cairo (AOT) 3.185 ± 0.036 3.139 3.268 1.02 ± 0.01
base factorial_2M.cairo (AOT) 3.127 ± 0.021 3.090 3.169 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.802 ± 0.041 2.759 2.888 1.05 ± 0.02
base fib_2M.cairo (JIT) 2.708 ± 0.029 2.667 2.753 1.02 ± 0.01
head fib_2M.cairo (AOT) 2.716 ± 0.028 2.679 2.760 1.02 ± 0.01
base fib_2M.cairo (AOT) 2.663 ± 0.023 2.621 2.699 1.00
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.220 ± 0.022 3.187 3.266 1.04 ± 0.01
base logistic_map.cairo (JIT) 3.109 ± 0.020 3.081 3.150 1.00
head logistic_map.cairo (AOT) 3.111 ± 0.044 3.034 3.163 1.00 ± 0.02
base logistic_map.cairo (AOT) 3.128 ± 0.053 3.030 3.196 1.01 ± 0.02

@azteca1998 azteca1998 added this pull request to the merge queue Oct 3, 2024
Merged via the queue into main with commit 79a8dcf Oct 3, 2024
15 checks passed
@azteca1998 azteca1998 deleted the fix-clone-drop-for-enum-structs branch October 3, 2024 14:49
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.

bug: stack overflow on AotExecutor creation Felt Dictionaries may leak memory
4 participants