Skip to content

Conversation

@DiegoCivi
Copy link
Contributor

[0.6.x] Fix comparison of bounded_int_constrain

When checking if the input is lower or greater than the boundary, we were using either signed less than or unsigned less than depending on the lower bound of the input. With the fix in #1466 we modified the boundary to represent the offseted value, which will never be negative. So we should always use unsigned less than when using BoundedInt.

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.

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 2.771 ± 0.037 2.715 2.826 1.02 ± 0.02
base dict_insert.cairo (AOT) 2.712 ± 0.025 2.659 2.744 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 2.617 ± 0.024 2.587 2.667 1.03 ± 0.01
head dict_insert.cairo (AOT) 2.546 ± 0.019 2.517 2.576 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 2.509 ± 0.026 2.482 2.575 1.05 ± 0.01
base dict_snapshot.cairo (AOT) 2.391 ± 0.011 2.365 2.400 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 2.338 ± 0.030 2.297 2.385 1.00
head dict_snapshot.cairo (AOT) 2.365 ± 0.053 2.286 2.443 1.01 ± 0.03

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 2.880 ± 0.038 2.806 2.953 1.03 ± 0.02
base factorial_2M.cairo (AOT) 2.801 ± 0.026 2.764 2.830 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 2.704 ± 0.029 2.657 2.742 1.01 ± 0.02
head factorial_2M.cairo (AOT) 2.675 ± 0.029 2.625 2.723 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 2.464 ± 0.022 2.436 2.506 1.02 ± 0.01
base fib_2M.cairo (AOT) 2.418 ± 0.021 2.387 2.463 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.226 ± 0.027 2.190 2.267 1.01 ± 0.02
head fib_2M.cairo (AOT) 2.200 ± 0.038 2.160 2.277 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 2.641 ± 0.025 2.604 2.691 1.05 ± 0.01
base linear_search.cairo (AOT) 2.512 ± 0.011 2.492 2.526 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 2.456 ± 0.050 2.380 2.541 1.06 ± 0.03
head linear_search.cairo (AOT) 2.323 ± 0.039 2.260 2.383 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 2.777 ± 0.081 2.705 2.994 1.10 ± 0.03
base logistic_map.cairo (AOT) 2.514 ± 0.024 2.479 2.564 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 2.520 ± 0.017 2.490 2.543 1.05 ± 0.02
head logistic_map.cairo (AOT) 2.396 ± 0.031 2.356 2.441 1.00

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.967 ± 0.071 10.849 11.057 4.42 ± 0.06
cairo-native (embedded AOT) 2.479 ± 0.028 2.424 2.511 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.596 ± 0.047 2.555 2.692 1.05 ± 0.02

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 528.5 ± 10.5 520.3 550.4 1.00
cairo-native (embedded AOT) 2172.9 ± 21.4 2145.4 2219.4 4.11 ± 0.09
cairo-native (embedded JIT using LLVM's ORC Engine) 2271.3 ± 17.1 2244.8 2300.8 4.30 ± 0.09

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.771 ± 0.039 4.722 4.854 1.87 ± 0.02
cairo-native (embedded AOT) 2.549 ± 0.021 2.522 2.587 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.597 ± 0.011 2.584 2.614 1.02 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.682 ± 0.019 4.659 4.727 2.27 ± 0.01
cairo-native (embedded AOT) 2.065 ± 0.008 2.053 2.081 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.139 ± 0.023 2.104 2.180 1.04 ± 0.01

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 554.8 ± 4.4 548.2 561.8 1.00
cairo-native (embedded AOT) 2160.7 ± 15.8 2138.9 2182.9 3.89 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 2290.2 ± 10.4 2276.9 2311.7 4.13 ± 0.04

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 377.3 ± 5.8 370.4 387.2 1.00
cairo-native (embedded AOT) 2240.3 ± 7.9 2229.1 2252.1 5.94 ± 0.09
cairo-native (embedded JIT using LLVM's ORC Engine) 2419.8 ± 13.4 2388.8 2436.0 6.41 ± 0.10

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.74%. Comparing base (661ce60) to head (2d0c408).

Files with missing lines Patch % Lines
src/libfuncs/bounded_int.rs 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v0.6    #1481      +/-   ##
==========================================
- Coverage   76.86%   76.74%   -0.12%     
==========================================
  Files         111      111              
  Lines       26689    26547     -142     
==========================================
- Hits        20515    20374     -141     
+ Misses       6174     6173       -1     

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

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.

3 participants