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

derive lookup_data #261

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

derive lookup_data #261

wants to merge 1 commit into from

Conversation

ohad-starkware
Copy link
Contributor

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

This change is Reviewable

Copy link
Contributor Author

ohad-starkware commented Dec 17, 2024

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

@ohad-starkware ohad-starkware force-pushed the ohad/derive_sub_component_inputs branch from 5b7c782 to cee8b86 Compare December 17, 2024 13:56
@ohad-starkware ohad-starkware force-pushed the ohad/derive_lookup_data branch from 0b6834a to 10da291 Compare December 17, 2024 13:56
@ohad-starkware ohad-starkware self-assigned this Dec 17, 2024
@ohad-starkware ohad-starkware force-pushed the ohad/derive_sub_component_inputs branch from cee8b86 to 0adc6bd Compare December 17, 2024 14:06
@ohad-starkware ohad-starkware force-pushed the ohad/derive_lookup_data branch from 10da291 to b00f8e6 Compare December 17, 2024 14:06
@ohad-starkware ohad-starkware changed the base branch from ohad/derive_sub_component_inputs to graphite-base/261 December 17, 2024 14:54
@ohad-starkware ohad-starkware force-pushed the ohad/derive_lookup_data branch from b00f8e6 to 0df33f5 Compare December 17, 2024 14:55
@ohad-starkware ohad-starkware changed the base branch from graphite-base/261 to main December 17, 2024 14:55
@ohad-starkware ohad-starkware force-pushed the ohad/derive_lookup_data branch from 0df33f5 to dccdc01 Compare December 17, 2024 14:55
@ilyalesokhin-starkware
Copy link
Collaborator

stwo_cairo_prover/crates/air_structs_derive/src/lib.rs line 58 at r1 (raw file):

fn assert_is_struct(input: &DeriveInput) {
    if !matches!(input.data, Data::Struct(_)) {
        panic!("Derive(SubComponentInputs/LookupData) can only be applied to structs.");

I don't want this to be a list, and I think you get the error location from the compiler anyway, can you confirm?

Suggestion:

   panic!("Expected a struct");

@ilyalesokhin-starkware
Copy link
Collaborator

stwo_cairo_prover/crates/air_structs_derive/src/lib.rs line 62 at r1 (raw file):

}

fn extract_vec_array_fields(input: &DeriveInput) -> Vec<VecArrayField> {

Can you fix the input to be a struct?

Suggestion:

strct: &DataStruct

Copy link
Collaborator

@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 8 of 26 files at r1.
Reviewable status: 8 of 26 files reviewed, 3 unresolved discussions (waiting on @ohad-starkware)


stwo_cairo_prover/crates/air_structs_derive/src/lib.rs line 30 at r1 (raw file):

#[proc_macro_derive(LookupData)]
pub fn derive_lookup_data(input: proc_macro::TokenStream) -> proc_macro::TokenStream {

are you sure this should be in stwo-cairo and not in stwo?

Code quote:

derive_lookup_data

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


stwo_cairo_prover/crates/air_structs_derive/src/lib.rs line 30 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

are you sure this should be in stwo-cairo and not in stwo?

for now yes because airs in stwo do not share the same structure (sub components, add inputs etc) and I do want that logic to be all in the same place.
perhaps in the future, I added a todo


stwo_cairo_prover/crates/air_structs_derive/src/lib.rs line 58 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

I don't want this to be a list, and I think you get the error location from the compiler anyway, can you confirm?

yes that is the case
done.


stwo_cairo_prover/crates/air_structs_derive/src/lib.rs line 62 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

Can you fix the input to be a struct?

Done.

@ohad-starkware ohad-starkware force-pushed the ohad/derive_lookup_data branch from dccdc01 to b65cb18 Compare December 18, 2024 11:33
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