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

Add init_circuit_data. #5481

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Add init_circuit_data. #5481

merged 1 commit into from
Apr 30, 2024

Conversation

ilyalesokhin-starkware
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware commented Apr 25, 2024

This change is Reviewable

Copy link
Collaborator

@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.

Reviewed 14 of 15 files at r1, 1 of 2 files at r2.
Reviewable status: 14 of 16 files reviewed, 8 unresolved discussions (waiting on @ilyalesokhin-starkware)


corelib/src/circuit.cairo line 15 at r1 (raw file):

extern type CircuitInputAccumulator<C>;

impl CircuitInputAccumulatorDrop<C> of Drop<CircuitInputAccumulator<C>>;

Suggestion:

pub type u96 = core::internal::BoundedInt<0, 79228162514264337593543950335>;
pub extern type RangeCheck96;


/// Defines an input for a circuit.
#[phantom]
pub extern type CircuitInput<const N: usize>;


/// Initializes the input data for running an instance of the circuit.
extern fn init_circuit_data<C>() -> CircuitInputAccumulator<C> implicits(RangeCheck96) nopanic;

/// Type for accumulating inputs into the circuit instance's data.
extern type CircuitInputAccumulator<C>;

impl CircuitInputAccumulatorDrop<C> of Drop<CircuitInputAccumulator<C>>;

crates/cairo-lang-sierra/src/extensions/mod.rs line 64 at r1 (raw file):

/// Extracts the generic args of `ty`, additionally validates it is of generic type `T`.
fn extract_type_generic_args<T: NamedType>(

is this useful in other places already?


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 32 at r1 (raw file):

}

fn is_circuit_component(

doc and maybe use extract_type_generic_args


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 65 at r1 (raw file):

pub struct ConcreteCircuitInput {
    pub info: TypeInfo,

doc members.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 97 at r1 (raw file):

}

/// Add mod gate type.

fix doc.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 145 at r1 (raw file):

}

fn parse_circuit(

doc


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 170 at r1 (raw file):

}

/// Libfunc for ignoring a plain old data object.

fix doc


crates/cairo-lang-sierra-to-casm/src/invocations/circuit.rs line 19 at r1 (raw file):

/// Handles a Sierra statement for appending an element to an array.
fn build_array_append(

rename and fix doc.

Copy link
Collaborator

@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.

Reviewed 1 of 2 files at r2, 2 of 3 files at r3, all commit messages.
Reviewable status: 16 of 17 files reviewed, 7 unresolved discussions (waiting on @ilyalesokhin-starkware)

Copy link
Contributor Author

@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.

Reviewable status: 16 of 17 files reviewed, 7 unresolved discussions (waiting on @orizi)


corelib/src/circuit.cairo line 15 at r1 (raw file):

extern type CircuitInputAccumulator<C>;

impl CircuitInputAccumulatorDrop<C> of Drop<CircuitInputAccumulator<C>>;

Done.


crates/cairo-lang-sierra/src/extensions/mod.rs line 64 at r1 (raw file):

Previously, orizi wrote…

is this useful in other places already?

yes, I meant to move it from 'crates/cairo-lang-sierra/src/extensions/modules/const_type.rs.'


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 32 at r1 (raw file):

Previously, orizi wrote…

doc and maybe use extract_type_generic_args

Done.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 65 at r1 (raw file):

Previously, orizi wrote…

doc members.

Done.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 97 at r1 (raw file):

Previously, orizi wrote…

fix doc.

removed as the type is documented in circuits.cairo


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 145 at r1 (raw file):

Previously, orizi wrote…

doc

Done.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 170 at r1 (raw file):

Previously, orizi wrote…

fix doc

removed as the libfunc is documented in circuits.cairo

Copy link
Contributor Author

@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.

Reviewable status: 15 of 17 files reviewed, 7 unresolved discussions (waiting on @orizi)


crates/cairo-lang-sierra-to-casm/src/invocations/circuit.rs line 19 at r1 (raw file):

Previously, orizi wrote…

rename and fix doc.

Done.

Copy link
Collaborator

@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.

Reviewed 1 of 3 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 65 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

Done.

With ///


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 97 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

removed as the type is documented in circuits.cairo

We usually doc in both, as these appear to different sort of users.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 170 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

removed as the libfunc is documented in circuits.cairo

Same

@ilyalesokhin-starkware
Copy link
Contributor Author

crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 97 at r1 (raw file):

Previously, orizi wrote…

We usually doc in both, as these appear to different sort of users.

just copy the same comment?

Copy link
Collaborator

@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: all files reviewed, 3 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 97 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

just copy the same comment?

good enough for me

Copy link
Contributor Author

@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.

Reviewable status: 15 of 17 files reviewed, 3 unresolved discussions (waiting on @orizi)


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 65 at r1 (raw file):

Previously, orizi wrote…

With ///

Done.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 97 at r1 (raw file):

Previously, orizi wrote…

good enough for me

Done.


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 170 at r1 (raw file):

Previously, orizi wrote…

Same

Done.

Copy link
Collaborator

@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.

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 175 at r5 (raw file):

}

/// libfunc for Initializing the input data for running an instance of the circuit.

Suggestion:

/// Libfunc for initializing the input data for running an instance of the circuit.

Copy link
Contributor Author

@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.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-sierra/src/extensions/modules/circuit.rs line 175 at r5 (raw file):

}

/// libfunc for Initializing the input data for running an instance of the circuit.

Done.

Copy link
Collaborator

@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.

:lgtm:

Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Apr 30, 2024
Merged via the queue into main with commit ce3e4a7 Apr 30, 2024
42 of 43 checks passed
@orizi orizi deleted the ilya/circ_types branch May 6, 2024 18:45
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