Skip to content

Add build_function_implicit_args helper#297

Closed
naor-starkware wants to merge 2 commits intomainfrom
naor-proving_utils/feat/run_func-rust-vm
Closed

Add build_function_implicit_args helper#297
naor-starkware wants to merge 2 commits intomainfrom
naor-proving_utils/feat/run_func-rust-vm

Conversation

@naor-starkware
Copy link
Copy Markdown
Contributor

@naor-starkware naor-starkware commented Feb 5, 2026

Type

  • feature
  • bugfix
  • dev (no functional changes, no API changes)
  • fmt (formatting, renaming)
  • build
  • docs
  • testing

Description

Breaking changes?

  • yes
  • no

This change is Reviewable

@naor-starkware naor-starkware force-pushed the naor-proving_utils/feat/run_func-rust-vm branch from aea8c20 to ca804ce Compare February 5, 2026 08:54
Copy link
Copy Markdown
Contributor

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

@OmriEshhar1 reviewed 3 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @naor-starkware).


a discussion (no related file):
fix conflicts and failed tests


a discussion (no related file):
please get @YairVaknin-starkware (or someone else that knows this code) review it.


crates/cairo-program-runner/src/bin/cairo_program_runner/main.rs line 16 at r2 (raw file):

use cairo_vm::vm::errors::cairo_run_errors::CairoRunError;
use clap::Parser;
use tempfile::NamedTempFile;

revert changes in this file (add / remove empty lines).

Copy link
Copy Markdown
Contributor

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

@OmriEshhar1 made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @naor-starkware).


crates/cairo-program-runner-lib/src/utils.rs line 136 at r2 (raw file):

    Ok(())
}
// Builds the implicit arguments (builtin pointers, syscall_ptr) for a specific Cairo function

add empty line above
and add missing / at the beginning of the line

Copy link
Copy Markdown
Contributor

@OmriEshhar1 OmriEshhar1 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: all files reviewed, 4 unresolved discussions (waiting on @naor-starkware and @YairVaknin-starkware).

@naor-starkware naor-starkware force-pushed the naor-proving_utils/feat/run_func-rust-vm branch from ca804ce to 152d687 Compare February 5, 2026 09:16
Copy link
Copy Markdown
Contributor Author

@naor-starkware naor-starkware left a comment

Choose a reason for hiding this comment

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

@naor-starkware made 2 comments.
Reviewable status: 1 of 3 files reviewed, 4 unresolved discussions (waiting on @OmriEshhar1 and @YairVaknin-starkware).


crates/cairo-program-runner/src/bin/cairo_program_runner/main.rs line 16 at r2 (raw file):

Previously, OmriEshhar1 wrote…

revert changes in this file (add / remove empty lines).

Done.


crates/cairo-program-runner-lib/src/utils.rs line 136 at r2 (raw file):

Previously, OmriEshhar1 wrote…

add empty line above
and add missing / at the beginning of the line

Done.

Copy link
Copy Markdown
Contributor

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

@OmriEshhar1 reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @naor-starkware and @YairVaknin-starkware).


crates/cairo-program-runner/src/bin/cairo_program_runner/main.rs line 16 at r2 (raw file):

Previously, naor-starkware wrote…

Done.

there's still a diff (add empty line above parse_bool() function)


crates/cairo-program-runner-lib/src/utils.rs line 136 at r2 (raw file):

Previously, naor-starkware wrote…

Done.

there's still a missing / (the first line of the documentation should start with ///, not //).

@naor-starkware naor-starkware force-pushed the naor-proving_utils/feat/run_func-rust-vm branch from e3657b6 to cdab88e Compare February 5, 2026 09:59
Copy link
Copy Markdown
Contributor

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

@OmriEshhar1 reviewed 2 files and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @naor-starkware and @YairVaknin-starkware).

Copy link
Copy Markdown
Contributor

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

@OmriEshhar1 resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @naor-starkware and @YairVaknin-starkware).

@naor-starkware naor-starkware force-pushed the naor-proving_utils/feat/run_func-rust-vm branch 2 times, most recently from ea563ef to 6b2e9de Compare February 25, 2026 12:35
@naor-starkware naor-starkware force-pushed the naor-proving_utils/feat/run_func-rust-vm branch from 6b2e9de to 644be45 Compare February 25, 2026 13:16
Copy link
Copy Markdown
Contributor

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

@OmriEshhar1 reviewed 5 files and all commit messages, and made 9 comments.
Reviewable status: all files reviewed, 9 unresolved discussions (waiting on naor-starkware and YairVaknin-starkware).


crates/cairo-program-runner/src/bin/cairo_program_runner/main.rs line 16 at r2 (raw file):

Previously, OmriEshhar1 wrote…

there's still a diff (add empty line above parse_bool() function)

revert change


crates/cairo-program-runner-lib/src/utils.rs line 52 at r5 (raw file):

///
/// This function checks if an input file is provided. If so, it returns the path wrapped
/// as `ProgramInput::Path`. If no input fise is provided, it returns `Ok(None)`.

revert change

Code quote:

fise

crates/cairo-function-runner/src/lib.rs line 16 at r5 (raw file):

///
/// This struct provides a high-level interface for running individual Cairo functions with
/// automatic builtin initialization, similar to the Python implementation.

no need to mention the Python implementation (it should be deleted later, so it's better not to reference it.)
(here and below).

Code quote:

/// A Cairo function runner that mimics the behavior of the Python VM's CairoFunctionRunner.
///
/// This struct provides a high-level interface for running individual Cairo functions with
/// automatic builtin initialization, similar to the Python implementation.

crates/cairo-function-runner/src/lib.rs line 16 at r5 (raw file):

///
/// This struct provides a high-level interface for running individual Cairo functions with
/// automatic builtin initialization, similar to the Python implementation.

Mention that this is used for testing purposes only.

Code quote:

/// A Cairo function runner that mimics the behavior of the Python VM's CairoFunctionRunner.
///
/// This struct provides a high-level interface for running individual Cairo functions with
/// automatic builtin initialization, similar to the Python implementation.

crates/cairo-function-runner/src/lib.rs line 48 at r5 (raw file):

        let mut runner = CairoRunner::new(
            program,
            LayoutName::all_cairo,

I think that lambdaclass are now removing 'layout' from the cairo-vm.
but I guess we can worry about this later.

Code quote:

LayoutName::all_cairo,

crates/cairo-function-runner/src/lib.rs line 89 at r5 (raw file):

    /// - Execution fails (VM errors, hint errors, etc.)
    /// - Security verification fails (if `verify_secure` is true)
    pub fn run(

I see that there are many arguments in the Python run() that are not here. Are you planning to add them later?
if so, add a TODO.


crates/cairo-function-runner/src/lib.rs line 93 at r5 (raw file):

        entrypoint: &str,
        verify_secure: bool,
        program_segment_size: Option<usize>,

I see that program_segment_size is not used in the Python run() function.
do you need it here?

Code quote:

program_segment_size: Option<usize>,

crates/cairo-function-runner/Cargo.toml line 7 at r5 (raw file):

license.workspace = true
repository.workspace = true
description = "CairoFunctionRunner for demonstrating Python VM builtin initialization"

Python?

Code quote:

 Python

crates/cairo-function-runner/Cargo.toml line 13 at r5 (raw file):

path = "src/lib.rs"

[dependencies]

sort the dependencies alphabetically

@OmriEshhar1 OmriEshhar1 closed this Mar 9, 2026
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.

2 participants