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 support for trace col grouping #101

Merged
merged 3 commits into from
Dec 22, 2022
Merged

Conversation

tohrnii
Copy link
Contributor

@tohrnii tohrnii commented Dec 10, 2022

Closes #83.

@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from cf79c39 to c62d27f Compare December 10, 2022 08:55
@tohrnii tohrnii requested review from bobbinth, Al-Kindi-0 and Fumuran and removed request for Fumuran, bobbinth and Al-Kindi-0 December 10, 2022 08:56
@tohrnii tohrnii marked this pull request as draft December 10, 2022 09:04
@tohrnii tohrnii changed the title feat(parser): add support for trace col grouping Add support for trace col grouping Dec 10, 2022
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from c5c7723 to 8197516 Compare December 10, 2022 10:15
@tohrnii tohrnii marked this pull request as ready for review December 10, 2022 10:16
@tohrnii tohrnii mentioned this pull request Dec 10, 2022
14 tasks
@grjte grjte requested review from grjte and removed request for bobbinth December 14, 2022 12:06
Copy link
Contributor

@grjte grjte left a comment

Choose a reason for hiding this comment

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

Thanks @tohrnii! The grammar looks good, but I think we may want to simplify the AST a bit to make life easier in the IR. See my comments inline and let me know if you have any questions

parser/src/ast/mod.rs Outdated Show resolved Hide resolved
parser/src/ast/mod.rs Outdated Show resolved Hide resolved
ir/src/symbol_table.rs Outdated Show resolved Hide resolved
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from 60f7512 to ae7f6ad Compare December 16, 2022 05:52
@tohrnii
Copy link
Contributor Author

tohrnii commented Dec 16, 2022

Thank you @grjte for the review, made suggested changes.

@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from ae7f6ad to 0bb24c7 Compare December 16, 2022 05:55
@tohrnii tohrnii requested a review from grjte December 16, 2022 05:55
}

/// [TraceCols] is used to represent a single or a group of columns in the execution trace. For
/// single columns, the size is 0. For groups, the size is the number of columns in the group.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just for my own understanding, is the number of columns sufficient to pinpoint the exact columns (e.g. contiguous and starting from 0)?

Copy link
Contributor

Choose a reason for hiding this comment

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

In response to @Al-Kindi-0:
Columns can be pinpointed by their index within a TraceCols struct. Keeping track of the size can be used for verification and also for having info required to output column groupings in codegen if needed. Internally in the IR, it's simplest to just think of things in terms of accessing a particular trace segment at a particular index and ignore groupings completely (e.g. for purposes of the constraint graph).

Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding this doc comment:
Shouldn't the size be 1 for single columns? (i.e. the number of columns in the group)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@grjte Fixed.

@Al-Kindi-0's I'm not sure if you meant this but from your comment it seems like you mean whether column groups need to be contiguous? Currently they are assumed to be contiguous but I'm wondering if it's possible for some projects that it might be meaningful to have columns in a group that are not contiguous? (@grjte ?). I don't know if any clean syntax is possible to support such use cases though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you @grjte and @tohrnii , the answer of @grjte addresses my question. Regarding whether it might be useful to support non-contiguous cases, I can't think of cases where one might need it at the moment.

Copy link
Contributor

@grjte grjte left a comment

Choose a reason for hiding this comment

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

Thanks, looks good overall now. I left a few small things inline

ir/src/boundary_constraints.rs Outdated Show resolved Hide resolved
ir/src/symbol_table.rs Outdated Show resolved Hide resolved
ir/src/transition_constraints/graph.rs Outdated Show resolved Hide resolved
parser/src/ast/mod.rs Outdated Show resolved Hide resolved
}

/// [TraceCols] is used to represent a single or a group of columns in the execution trace. For
/// single columns, the size is 0. For groups, the size is the number of columns in the group.
Copy link
Contributor

Choose a reason for hiding this comment

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

In response to @Al-Kindi-0:
Columns can be pinpointed by their index within a TraceCols struct. Keeping track of the size can be used for verification and also for having info required to output column groupings in codegen if needed. Internally in the IR, it's simplest to just think of things in terms of accessing a particular trace segment at a particular index and ignore groupings completely (e.g. for purposes of the constraint graph).

}

/// [TraceCols] is used to represent a single or a group of columns in the execution trace. For
/// single columns, the size is 0. For groups, the size is the number of columns in the group.
Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding this doc comment:
Shouldn't the size be 1 for single columns? (i.e. the number of columns in the group)

parser/src/ast/mod.rs Outdated Show resolved Hide resolved
parser/src/parser/tests/trace_columns.rs Outdated Show resolved Hide resolved
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from 0bb24c7 to a731396 Compare December 17, 2022 08:29
@tohrnii
Copy link
Contributor Author

tohrnii commented Dec 17, 2022

Thank you @grjte and @Al-Kindi-0 for the review. Made suggested changes.

@tohrnii tohrnii requested review from grjte and Al-Kindi-0 December 20, 2022 14:21
Copy link
Contributor

@grjte grjte left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for all your work @tohrnii!

@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from a731396 to 1183f5d Compare December 21, 2022 15:30
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from 1183f5d to 7b970b5 Compare December 21, 2022 15:32
@tohrnii tohrnii merged commit 2209932 into next Dec 22, 2022
@tohrnii tohrnii deleted the tohrnii-col-grouping-parser branch December 22, 2022 14:22
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.

4 participants