Skip to content

Conversation

@DiegoCivi
Copy link
Contributor

@DiegoCivi DiegoCivi commented Nov 6, 2025

Implement Squashed Felt252 Dict Entries libfunc

Implements the SquashedFelt252Dict libfunc:

  • SquashedFelt252DictConcreteLibfunc::IntoEntries

Closes #1151

Introduces Breaking Changes?

No.

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 Nov 6, 2025

Codecov Report

❌ Patch coverage is 96.29630% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.64%. Comparing base (69e1fbb) to head (7527d01).

Files with missing lines Patch % Lines
src/libfuncs/squashed_dict.rs 94.61% 9 Missing ⚠️
src/metadata/runtime_bindings.rs 96.22% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1446      +/-   ##
==========================================
+ Coverage   81.47%   81.64%   +0.17%     
==========================================
  Files         105      106       +1     
  Lines       25759    26053     +294     
==========================================
+ Hits        20987    21272     +285     
- Misses       4772     4781       +9     

☔ 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.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 1.949 ± 0.024 1.911 1.977 1.04 ± 0.02
base dict_insert.cairo (AOT) 1.876 ± 0.024 1.831 1.912 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 1.789 ± 0.009 1.777 1.804 1.04 ± 0.01
head dict_insert.cairo (AOT) 1.721 ± 0.010 1.701 1.732 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 1.643 ± 0.026 1.613 1.695 1.07 ± 0.02
base dict_snapshot.cairo (AOT) 1.539 ± 0.014 1.518 1.558 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 1.521 ± 0.013 1.497 1.544 1.07 ± 0.01
head dict_snapshot.cairo (AOT) 1.427 ± 0.015 1.396 1.447 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 2.019 ± 0.011 2.004 2.046 1.01 ± 0.01
base factorial_2M.cairo (AOT) 1.992 ± 0.016 1.970 2.018 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 1.839 ± 0.014 1.818 1.864 1.02 ± 0.01
head factorial_2M.cairo (AOT) 1.798 ± 0.017 1.776 1.832 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 1.570 ± 0.019 1.542 1.599 1.03 ± 0.02
base fib_2M.cairo (AOT) 1.522 ± 0.015 1.505 1.543 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 1.428 ± 0.012 1.411 1.449 1.02 ± 0.01
head fib_2M.cairo (AOT) 1.406 ± 0.014 1.392 1.431 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base heavy_circuit.cairo (JIT) 13.066 ± 0.075 12.914 13.178 1.03 ± 0.01
base heavy_circuit.cairo (AOT) 12.643 ± 0.083 12.547 12.837 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head heavy_circuit.cairo (JIT) 9.432 ± 0.038 9.389 9.505 1.05 ± 0.01
head heavy_circuit.cairo (AOT) 9.004 ± 0.070 8.932 9.129 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 1.729 ± 0.023 1.706 1.770 1.08 ± 0.02
base linear_search.cairo (AOT) 1.603 ± 0.018 1.580 1.636 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 1.595 ± 0.008 1.581 1.608 1.10 ± 0.01
head linear_search.cairo (AOT) 1.451 ± 0.010 1.440 1.472 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 1.874 ± 0.022 1.845 1.931 1.07 ± 0.02
base logistic_map.cairo (AOT) 1.746 ± 0.026 1.705 1.773 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 1.748 ± 0.010 1.731 1.767 1.10 ± 0.01
head logistic_map.cairo (AOT) 1.583 ± 0.012 1.566 1.602 1.00

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.517 ± 0.094 11.400 11.682 6.13 ± 0.09
cairo-native (embedded AOT) 1.878 ± 0.024 1.854 1.920 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 1.979 ± 0.009 1.969 1.994 1.05 ± 0.01

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 548.3 ± 4.1 542.3 553.6 1.00
cairo-native (embedded AOT) 1549.3 ± 16.7 1519.4 1567.2 2.83 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 1655.2 ± 17.0 1633.1 1674.6 3.02 ± 0.04

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.272 ± 0.022 5.249 5.326 2.65 ± 0.02
cairo-native (embedded AOT) 1.993 ± 0.009 1.981 2.008 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.029 ± 0.011 2.013 2.045 1.02 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.118 ± 0.015 5.101 5.150 3.37 ± 0.03
cairo-native (embedded AOT) 1.518 ± 0.015 1.501 1.543 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 1.575 ± 0.017 1.554 1.604 1.04 ± 0.01

Benchmark for program heavy_circuit

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 9.728 ± 0.083 9.609 9.883 1.00
cairo-native (embedded AOT) 12.526 ± 0.055 12.432 12.599 1.29 ± 0.01
cairo-native (embedded JIT using LLVM's ORC Engine) 12.995 ± 0.077 12.858 13.140 1.34 ± 0.01

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 586.4 ± 2.4 583.3 589.6 1.00
cairo-native (embedded AOT) 1589.8 ± 15.9 1562.0 1608.2 2.71 ± 0.03
cairo-native (embedded JIT using LLVM's ORC Engine) 1728.5 ± 12.2 1703.5 1746.3 2.95 ± 0.02

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 498.6 ± 4.8 491.9 510.3 1.00
cairo-native (embedded AOT) 1683.6 ± 14.8 1663.5 1702.2 3.38 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 1850.5 ± 15.0 1821.2 1871.1 3.71 ± 0.05

@gabrielbosio gabrielbosio added the libfuncs Library Function implementations label Dec 3, 2025
We were creating the array in mlir and the passing it
to runtime so it could be modified. This commit deletes
the mlir creation of the array and creates in runtime. This
reduces a lot of code and complexity of the libfunc.
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

✅ Code is now correctly formatted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libfuncs Library Function implementations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.11.1] Implement Squashed Felt252 Dict Entries Libfunc

4 participants