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

fmt for cairo #237

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fmt for cairo #237

wants to merge 1 commit into from

Conversation

ohad-starkware
Copy link
Contributor

@ohad-starkware ohad-starkware commented Dec 9, 2024

fmt for cairo


This change is Reviewable

Copy link
Contributor Author

ohad-starkware commented Dec 9, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ohad-starkware ohad-starkware self-assigned this Dec 9, 2024
@ohad-starkware ohad-starkware force-pushed the ohad/fmt branch 2 times, most recently from f958909 to 9809441 Compare December 9, 2024 11:18
@ohad-starkware ohad-starkware changed the title add tests for big mul and add fmt for cairo Dec 9, 2024
@ohad-starkware ohad-starkware mentioned this pull request Dec 10, 2024
Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r1, all commit messages.
Reviewable status: 1 of 5 files reviewed, 3 unresolved discussions (waiting on @ohad-starkware)


stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs line 30 at r1 (raw file):

    input: CairoInput,
    track_relations: bool,
    display_components: bool,

Do we want this with 2 different bools?
Why not create a log_level param or something?

Code quote:

    track_relations: bool,
    display_components: bool,

stwo_cairo_prover/crates/prover/src/cairo_air/debug.rs line 1 at r1 (raw file):

use itertools::Itertools;

Is this file only compiles in debug mode?

Code quote:

use itertools::Itertools;

stwo_cairo_prover/crates/prover/src/cairo_air/debug.rs line 589 at r1 (raw file):

}

pub(super) fn indent_component_display<E: FrameworkEval>(

Rename, and also:
why do you need the indented format only here?
For the Opcode components you just printed them regularly.

Do we really need those two functions?

Suggestion:

pub(super) fn indented_component_display<E: FrameworkEval>(

Copy link
Contributor Author

@ohad-starkware ohad-starkware 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: 1 of 5 files reviewed, 3 unresolved discussions (waiting on @shaharsamocha7)


stwo_cairo_prover/crates/prover/src/cairo_air/debug.rs line 1 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Is this file only compiles in debug mode?

no


stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs line 30 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Do we want this with 2 different bools?
Why not create a log_level param or something?

with track relations it needs to be a bool because the operation is very slow
wdym by log_level_param? can give an example?
I do think that these two and some other stuff needs to sit in a Cfg struct of sorts, which the CLI will construct.

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 5 files at r1.
Reviewable status: 4 of 5 files reviewed, 3 unresolved discussions (waiting on @ohad-starkware)


stwo_cairo_prover/crates/prover/src/cairo_air/debug.rs line 1 at r1 (raw file):

Previously, ohad-starkware (Ohad) wrote…

no

but should it?
If so, we should probably need to consider if we want to add dependencies to this file


stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs line 30 at r1 (raw file):

Previously, ohad-starkware (Ohad) wrote…

with track relations it needs to be a bool because the operation is very slow
wdym by log_level_param? can give an example?
I do think that these two and some other stuff needs to sit in a Cfg struct of sorts, which the CLI will construct.

I see, but maybe we want a DebugParams?
Good First Issue?

Copy link
Contributor Author

@ohad-starkware ohad-starkware 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: 4 of 5 files reviewed, 3 unresolved discussions (waiting on @ohad-starkware and @shaharsamocha7)


stwo_cairo_prover/crates/prover/src/cairo_air/debug.rs line 1 at r1 (raw file):

Previously, shaharsamocha7 wrote…

but should it?
If so, we should probably need to consider if we want to add dependencies to this file

it's used in real runs to expose debug prints for the CLI, maybe rename the file?


stwo_cairo_prover/crates/prover/src/cairo_air/debug.rs line 589 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Rename, and also:
why do you need the indented format only here?
For the Opcode components you just printed them regularly.

Do we really need those two functions?

I did indent them
yes, it's unreadable without indents


stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs line 30 at r1 (raw file):

Previously, shaharsamocha7 wrote…

I see, but maybe we want a DebugParams?
Good First Issue?

we need to expose some API for the CLI to use, the needs are/will dictated by Maya I hope?
from our end, yes good first issue

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ohad-starkware)


stwo_cairo_prover/crates/prover/src/cairo_air/debug.rs line 1 at r1 (raw file):

Previously, ohad-starkware (Ohad) wrote…

it's used in real runs to expose debug prints for the CLI, maybe rename the file?

debugging_tools.rs
not sure


stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs line 30 at r1 (raw file):

Previously, ohad-starkware (Ohad) wrote…

we need to expose some API for the CLI to use, the needs are/will dictated by Maya I hope?
from our end, yes good first issue

Can you add a TODO here to wrap them with a struct?


stwo_cairo_prover/crates/adapted_prover/src/main.rs line 32 at r1 (raw file):

    debug_lookup: bool,
    #[structopt(long = "display_components")]
    display_components: bool,

We should consult with maya what should be the params in the CLI

Code quote:

    #[structopt(long = "debug_lookup")]
    debug_lookup: bool,
    #[structopt(long = "display_components")]
    display_components: bool,

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