Skip to content

Conversation

@FrancoGiachetta
Copy link
Contributor

@FrancoGiachetta FrancoGiachetta commented Nov 13, 2025

Fix sierra emu eval_trim and add int range to trace dump

Closes #NA

This PR fixes bounded_int_trim libfuncs in sierra-emu. The issue was that the implementation was not taking into account that it could receive BoundedInts as inputs.
This PR also implements dumping IntRanges with the trace dump.

Introduces Breaking Changes?

No.

These PRs should be merged after this one right away, in that order.

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 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.69%. Comparing base (79da595) to head (77055cf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1459   +/-   ##
=======================================
  Coverage   81.69%   81.69%           
=======================================
  Files         105      105           
  Lines       26047    26047           
=======================================
  Hits        21279    21279           
  Misses       4768     4768           

☔ 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 13, 2025

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 2.629 ± 0.055 2.535 2.737 1.04 ± 0.03
base dict_insert.cairo (AOT) 2.540 ± 0.042 2.487 2.613 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 2.574 ± 0.032 2.532 2.619 1.03 ± 0.01
head dict_insert.cairo (AOT) 2.491 ± 0.015 2.469 2.518 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 2.299 ± 0.032 2.250 2.344 1.04 ± 0.02
base dict_snapshot.cairo (AOT) 2.209 ± 0.016 2.192 2.237 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 2.270 ± 0.028 2.243 2.337 1.05 ± 0.01
head dict_snapshot.cairo (AOT) 2.155 ± 0.014 2.129 2.176 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 2.711 ± 0.031 2.670 2.754 1.03 ± 0.02
base factorial_2M.cairo (AOT) 2.636 ± 0.025 2.606 2.672 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 2.663 ± 0.034 2.600 2.710 1.02 ± 0.01
head factorial_2M.cairo (AOT) 2.609 ± 0.011 2.598 2.630 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 2.230 ± 0.028 2.202 2.293 1.02 ± 0.02
base fib_2M.cairo (AOT) 2.181 ± 0.026 2.124 2.209 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.181 ± 0.021 2.126 2.202 1.01 ± 0.01
head fib_2M.cairo (AOT) 2.152 ± 0.023 2.113 2.186 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base heavy_circuit.cairo (JIT) 15.295 ± 0.144 15.075 15.532 1.02 ± 0.02
base heavy_circuit.cairo (AOT) 15.037 ± 0.255 14.771 15.557 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head heavy_circuit.cairo (JIT) 15.308 ± 0.147 15.084 15.546 1.03 ± 0.01
head heavy_circuit.cairo (AOT) 14.855 ± 0.067 14.766 14.980 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 2.405 ± 0.022 2.379 2.448 1.07 ± 0.02
base linear_search.cairo (AOT) 2.245 ± 0.024 2.201 2.276 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 2.354 ± 0.024 2.315 2.403 1.07 ± 0.01
head linear_search.cairo (AOT) 2.208 ± 0.017 2.175 2.235 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 2.513 ± 0.020 2.479 2.543 1.08 ± 0.01
base logistic_map.cairo (AOT) 2.327 ± 0.017 2.287 2.356 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 2.447 ± 0.020 2.416 2.478 1.07 ± 0.01
head logistic_map.cairo (AOT) 2.290 ± 0.009 2.278 2.307 1.00

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.035 ± 0.065 10.958 11.154 4.20 ± 0.08
cairo-native (embedded AOT) 2.629 ± 0.046 2.566 2.712 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.684 ± 0.034 2.634 2.753 1.02 ± 0.02

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 532.5 ± 7.6 519.2 542.2 1.00
cairo-native (embedded AOT) 2177.4 ± 28.1 2148.1 2245.7 4.09 ± 0.08
cairo-native (embedded JIT using LLVM's ORC Engine) 2298.1 ± 43.4 2249.3 2401.0 4.32 ± 0.10

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.752 ± 0.033 4.712 4.827 1.84 ± 0.02
cairo-native (embedded AOT) 2.587 ± 0.025 2.545 2.634 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.652 ± 0.051 2.575 2.739 1.03 ± 0.02

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.705 ± 0.033 4.672 4.792 2.19 ± 0.05
cairo-native (embedded AOT) 2.148 ± 0.048 2.101 2.233 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.234 ± 0.048 2.170 2.325 1.04 ± 0.03

Benchmark for program heavy_circuit

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 9.728 ± 0.130 9.541 9.957 1.00
cairo-native (embedded AOT) 13.700 ± 0.085 13.613 13.842 1.41 ± 0.02
cairo-native (embedded JIT using LLVM's ORC Engine) 14.119 ± 0.137 13.940 14.350 1.45 ± 0.02

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 576.9 ± 15.7 559.3 602.3 1.00
cairo-native (embedded AOT) 2223.4 ± 42.2 2162.3 2315.0 3.85 ± 0.13
cairo-native (embedded JIT using LLVM's ORC Engine) 2341.4 ± 18.8 2304.0 2365.2 4.06 ± 0.12

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 380.4 ± 6.1 371.1 389.9 1.00
cairo-native (embedded AOT) 2333.4 ± 29.7 2290.3 2385.7 6.13 ± 0.13
cairo-native (embedded JIT using LLVM's ORC Engine) 2504.3 ± 31.0 2467.2 2560.3 6.58 ± 0.13

CoreTypeConcrete::IntRange(info) => {
let type_info = registry.get_type(&info.ty).unwrap();

match type_info {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don´t we need in this match to handle the case of a BoundedInt?

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.

5 participants