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

Added panic print in executable run. #7131

Merged
merged 0 commits into from
Jan 23, 2025
Merged

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jan 21, 2025

Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

@reviewable-StarkWare
Copy link

This change is Reviewable

@ilyalesokhin-starkware
Copy link
Contributor

crates/bin/cairo-execute/src/main.rs line 248 at r1 (raw file):

        runner.vm.write_output(&mut output_buffer)?;
        print!("{output_buffer}");
        if let [start_marker, end_marker] = &hint_processor.markers[..] {

This is going to break if someone else uses markers.
Do you want the markers to be that generic?
if so maybe take the last two markers?

Suggestion:

[.., start_marker, end_marker] = &hint_processor.markers[..]

Copy link
Collaborator Author

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 9 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/bin/cairo-execute/src/main.rs line 248 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

This is going to break if someone else uses markers.
Do you want the markers to be that generic?
if so maybe take the last two markers?

i like it - Done

@orizi orizi force-pushed the spr/main/2b23af69 branch from 5064702 to d96c10f Compare January 23, 2025 07:50
@orizi orizi force-pushed the spr/main/db822d43 branch from 022c26c to b25d7ff Compare January 23, 2025 07:50
@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-casm/src/hints/mod.rs line 357 at r1 (raw file):

    #[cfg_attr(feature = "parity-scale-codec", codec(index = 1))]
    WriteRunParam { index: ResOperand, dst: CellRef },
    /// Writes a marker into the VM. Useful for debugging.

Suggestion:

 /// stores a marker in the HintProcessor. Useful for debugging.

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 9 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: 6 of 9 files reviewed, 2 unresolved discussions (waiting on @orizi)


crates/cairo-lang-runnable-utils/src/builder.rs line 425 at r1 (raw file):

        let ret = CellExpression::Deref(deref!([ap - unprocessed_return_size]));
        unprocessed_return_size -= 1;
        ret

ret is a bit confusing.
consider deref or res

Suggestion:

        let deref = CellExpression::Deref(deref!([ap - unprocessed_return_size]));
        unprocessed_return_size -= 1;
        deref

@orizi orizi force-pushed the spr/main/2b23af69 branch from d96c10f to f16d777 Compare January 23, 2025 09:10
Copy link
Collaborator Author

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 5 of 9 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-runnable-utils/src/builder.rs line 425 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

ret is a bit confusing.
consider deref or res

Done.


crates/cairo-lang-casm/src/hints/mod.rs line 357 at r1 (raw file):

    #[cfg_attr(feature = "parity-scale-codec", codec(index = 1))]
    WriteRunParam { index: ResOperand, dst: CellRef },
    /// Writes a marker into the VM. Useful for debugging.

Done.

@orizi orizi force-pushed the spr/main/2b23af69 branch from f16d777 to c761a9f Compare January 23, 2025 09:13
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: 7 of 9 files reviewed, all discussions resolved

@orizi orizi merged commit 7f623ad into spr/main/db822d43 Jan 23, 2025
@orizi orizi force-pushed the spr/main/db822d43 branch from fddb99b to 9e78ef6 Compare January 23, 2025 11:42
@orizi orizi force-pushed the spr/main/2b23af69 branch from c761a9f to 7f623ad Compare January 23, 2025 11:42
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