-
Notifications
You must be signed in to change notification settings - Fork 133
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
CairoRunner.run_until_pc_with_steps_limit #1181
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1181 +/- ##
==========================================
- Coverage 97.70% 97.70% -0.01%
==========================================
Files 89 89
Lines 35739 35847 +108
==========================================
+ Hits 34920 35025 +105
- Misses 819 822 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Benchmark Results for unmodified programs 🚀
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't run_until_steps
and run_for_steps
already satisfying this functionality?
They are similar but no run_for_steps returns an Error if you finish executing the program and OK if the execution didn't finish |
@@ -93,6 +93,8 @@ pub enum VirtualMachineError { | |||
NoImm, | |||
#[error("Execution reached the end of the program. Requested remaining steps: {0}.")] | |||
EndOfProgram(usize), | |||
#[error("Couldnt reached the end of the program. Executed steps: {0}.")] | |||
StepsLimit(u64), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure that u64 is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type: reached -> reach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldnt -> Could not (formal english please)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think u64 will be enough, u64::MAX = 18_446_744_073_709_551_615u64
Also current_step
and the other methods uses usize
for the step counters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks Aki!
Done 3cbdbba
* Add CairoRunner.run_until_pc_with_steps_limit * Add unit test * Add integration test * Minor API change * Update CHANGELOG.md * Add doc * change error msg
Add CairoRunner.run_until_pc_with_steps_limit method
Description of the pull request changes and motivation.
Checklist