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

feat: Reorganized builtins to be in the top of stack at the end of run. #1686

Merged
merged 7 commits into from
Apr 5, 2024

Conversation

orizi
Copy link
Contributor

@orizi orizi commented Mar 24, 2024

Builtins on top of stack at the end of cairo1 runs.

Description

Removed the extra wrapping function call, and make a single wrapping entrypoint code, that also copies data into the output_ptr if required, and then rewrites all the builtins (used and unused to top of stack).

This hopefully will make the running of the proof more usable.

Copy link
Collaborator

@pefontana pefontana left a comment

Choose a reason for hiding this comment

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

Thank you for the PR, @orizi !

I've noticed that this change introduces some issues when running programs in cairo-1 with --proof_mode. When we execute a Cairo 1 program with proof_mode, the execution never completes. Do you have any insights on why this might be happening?

cd cairo1-run
cp ../cairo_programs/cairo-1-programs/fibonacci.cairo ./

cargo run \
fibonacci.cairo \
--layout=small \
--air_public_input=fibonacci_public_input.json \
--air_private_input=fibonacci_private_input.json \
--trace_file=fibonacci_trace.json \
--memory_file=fibonacci_memory.json \
--print_output \
--proof_mode

@orizi
Copy link
Contributor Author

orizi commented Mar 26, 2024

Found the culprit and fixed as well.

@orizi orizi force-pushed the feat/cairo1-run-reorg-builtins branch from d60fda4 to f3f6dfd Compare March 26, 2024 07:02
@pefontana
Copy link
Collaborator

Great @orizi !
The Fibonacci program is working all right, but some programs still throw InvalidStopPointerIndex Error for the range check or Pedersen builtins. We will dive a little and try to fix them

@fmoletta
Copy link
Contributor

Hello! We noticed some problems when running with proof_mode and when serializing outputs that makes tests fail, I sent a PR to your branch with fixes for these issues orizi#1

@orizi orizi force-pushed the feat/cairo1-run-reorg-builtins branch from 225df3d to b5eb95b Compare March 28, 2024 06:58
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 96.36364% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 96.55%. Comparing base (22a97dc) to head (759bda0).
Report is 1 commits behind head on main.

Files Patch % Lines
cairo1-run/src/cairo_run.rs 96.36% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1686      +/-   ##
==========================================
- Coverage   96.56%   96.55%   -0.02%     
==========================================
  Files          95       95              
  Lines       38380    38406      +26     
==========================================
+ Hits        37062    37081      +19     
- Misses       1318     1325       +7     

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

@juanbono juanbono added this pull request to the merge queue Apr 5, 2024
Merged via the queue into lambdaclass:main with commit 69ae745 Apr 5, 2024
50 of 52 checks passed
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.

4 participants