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

Refactor ArgumentMapper to fix bugs in ARM. #731

Merged
merged 7 commits into from
Jul 17, 2024
Merged

Conversation

azteca1998
Copy link
Collaborator

@azteca1998 azteca1998 commented Jul 16, 2024

  • Fixes to_jit() for arrays (we didn't notice because we weren't using it before).
  • Completely replaces ArgumentMapper with a more intuitive system that can integrate multiple architectures easily.
  • Fixes the Failed to deserialize param #1 error.
  • Fixes a bug in our debug utils print_felt252.
  • Makes JitValue::Felt(_)'s std::fmt::Debug implementation print the real value instead of its Montgomery form limbs.
  • Adds a test to check if the circumstances that caused this bug happens in the future.

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 Jul 16, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.409 ± 0.048 11.342 11.463 23.75 ± 0.10
cairo-native (embedded AOT) 1.569 ± 0.008 1.558 1.580 3.26 ± 0.02
cairo-native (embedded JIT using LLVM's ORC Engine) 1.658 ± 0.017 1.631 1.681 3.45 ± 0.04
cairo-native (standalone AOT) 0.656 ± 0.006 0.652 0.669 1.37 ± 0.01
cairo-native (standalone AOT with -march=native) 0.480 ± 0.001 0.480 0.481 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.785 ± 0.029 10.745 10.816 1322.56 ± 14.27
cairo-native (embedded AOT) 1.161 ± 0.006 1.147 1.169 142.34 ± 1.67
cairo-native (embedded JIT using LLVM's ORC Engine) 1.174 ± 0.011 1.148 1.190 144.02 ± 2.05
cairo-native (standalone AOT) 0.008 ± 0.000 0.008 0.009 1.04 ± 0.02
cairo-native (standalone AOT with -march=native) 0.008 ± 0.000 0.008 0.008 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 1.950 ± 0.012 1.932 1.972 29.38 ± 0.19
cairo-native (embedded AOT) 1.305 ± 0.010 1.289 1.322 19.66 ± 0.16
cairo-native (embedded JIT using LLVM's ORC Engine) 1.479 ± 0.010 1.461 1.488 22.27 ± 0.15
cairo-native (standalone AOT) 0.107 ± 0.000 0.107 0.107 1.62 ± 0.00
cairo-native (standalone AOT with -march=native) 0.066 ± 0.000 0.066 0.067 1.00

@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 88.15789% with 36 lines in your changes missing coverage. Please review.

Project coverage is 91.65%. Comparing base (dc6f129) to head (c6b193e).

Files Patch % Lines
src/arch/x86_64.rs 84.33% 26 Missing ⚠️
src/arch.rs 91.81% 9 Missing ⚠️
src/metadata/debug_utils.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #731      +/-   ##
==========================================
- Coverage   91.68%   91.65%   -0.04%     
==========================================
  Files         118      120       +2     
  Lines       32642    32365     -277     
==========================================
- Hits        29929    29665     -264     
+ Misses       2713     2700      -13     

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

@azteca1998 azteca1998 marked this pull request as ready for review July 16, 2024 23:40
@azteca1998 azteca1998 linked an issue Jul 16, 2024 that may be closed by this pull request
@azteca1998 azteca1998 linked an issue Jul 16, 2024 that may be closed by this pull request
@azteca1998 azteca1998 added the review-ready A PR that is ready for review label Jul 16, 2024
edg-l
edg-l previously approved these changes Jul 17, 2024
src/arch.rs Show resolved Hide resolved
@mpaulucci
Copy link

🐐

src/executor.rs Outdated Show resolved Hide resolved
Copy link
Member

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

Amazing work!!!!!! 🚀 , I left some comments, most of them are about adding some docs on the AbiArgument implementations.

@edg-l edg-l added this pull request to the merge queue Jul 17, 2024
Merged via the queue into main with commit 72d10b7 Jul 17, 2024
9 checks passed
@edg-l edg-l deleted the fix-stack-arguments-arm64 branch July 17, 2024 14:50
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
Status: Done
Development

Successfully merging this pull request may close these issues.

ARM bug: Failed to deserialize param #1 Invalid parameter deserialisation in contructor (2.6.3)
5 participants