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 trace column grouping to IR #102

Merged
merged 5 commits into from
Jan 6, 2023
Merged

Add trace column grouping to IR #102

merged 5 commits into from
Jan 6, 2023

Conversation

tohrnii
Copy link
Contributor

@tohrnii tohrnii commented Dec 10, 2022

Closes #85.

@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch from a3a0eb8 to 3377252 Compare December 10, 2022 12:09
@tohrnii tohrnii mentioned this pull request Dec 10, 2022
14 tasks
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch 3 times, most recently from cb503bc to 21021f7 Compare December 10, 2022 12:45
@tohrnii tohrnii marked this pull request as ready for review December 10, 2022 12:45
@tohrnii tohrnii requested review from bobbinth, Al-Kindi-0 and Fumuran and removed request for Fumuran, bobbinth and Al-Kindi-0 December 10, 2022 12:45
@tohrnii tohrnii marked this pull request as draft December 10, 2022 12:47
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch 2 times, most recently from 3539173 to 89a0ce0 Compare December 14, 2022 06:36
@tohrnii tohrnii marked this pull request as ready for review December 14, 2022 06:37
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch from 89a0ce0 to 3153e37 Compare December 14, 2022 06:50
@grjte grjte requested review from grjte and removed request for bobbinth December 14, 2022 12:07
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.

This is just a partial review, since I think there should be some changes based on my comments in #101. I left a few comments inline related to #101 and a few other small things

ir/src/trace_column.rs Outdated Show resolved Hide resolved
ir/src/transition_constraints/graph.rs Outdated Show resolved Hide resolved
ir/src/error.rs Outdated Show resolved Hide resolved
ir/src/boundary_constraints.rs Outdated Show resolved Hide resolved
ir/src/boundary_constraints.rs Outdated Show resolved Hide resolved
ir/src/lib.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 ae7f6ad to 0bb24c7 Compare December 16, 2022 05:55
Copy link
Collaborator

@Al-Kindi-0 Al-Kindi-0 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, thank you! I think the only thing missing is to translate the suggestions in #101 to this PR.

@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch from 0bb24c7 to a731396 Compare December 17, 2022 08:29
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch from 3153e37 to c2b50bc Compare December 20, 2022 08:49
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-parser branch 2 times, most recently from 1183f5d to 7b970b5 Compare December 21, 2022 15:32
Base automatically changed from tohrnii-col-grouping-parser to next December 22, 2022 14:22
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch 2 times, most recently from f3f98ff to a62a07f Compare December 23, 2022 11:13
@tohrnii tohrnii requested review from grjte and Al-Kindi-0 December 23, 2022 11:23
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch 3 times, most recently from b86b427 to 0a287a7 Compare December 23, 2022 11:42
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.

It looks good to me overall! I'm just wondering about managing the trace columns in a similar way to what we just did in the parser, in which case changes would be needed in a few files (although actually it wouldn't be a major refactor)

ir/src/symbol_table.rs Outdated Show resolved Hide resolved
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch from 0a287a7 to c3536ce Compare December 23, 2022 14:37
@tohrnii tohrnii requested a review from grjte December 23, 2022 14:39
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch 4 times, most recently from cd30aa9 to 6c0bb02 Compare December 23, 2022 16:16
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 @tohrnii! I've left 2 opinionated non-blocking comments inline.

Comment on lines 6 to 8
/// A map of a set of trace columns using the declared identifier as the key and the column
/// index as the value.
columns: BTreeMap<String, usize>,
trace_segment: TraceSegment,
size: usize,
offset: usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

really minor nit: it feels to me like the offset should come before the size in all cases (e.g. here, in the new function, etc), since it's describing where in the trace segment the group starts (and then size describes where it ends)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. My thinking was that the size is a more local property of the column group and should come before the offset which is meaningful in the context of the whole trace. But this argument probably doesn't make sense since trace_segment is also in the context of the whole trace. Will change it.

Comment on lines 292 to 299
let node_index = self.insert_op(Operation::TraceElement(TraceAccess::new(
trace_segment,
col_idx,
0,
)));
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Maybe we can use constants CURRENT_ROW and NEXT_ROW for the row offsets of 0 and 1 or at least add comments where these TraceAccess structs are created? I think it would be easier to read what's going on for anyone who is new to the codebase or has stepped away for a week and apparently forgotten everything ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it to use CURRENT_ROW and NEXT_ROW. Thanks for the suggestion, I used to get confused with this one as well.

@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch from 6c0bb02 to 2814d21 Compare January 5, 2023 16:38
@tohrnii tohrnii force-pushed the tohrnii-col-grouping-ir branch from 2814d21 to 2fdc6f1 Compare January 5, 2023 16:41
Copy link
Contributor

@Fumuran Fumuran 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! Thank you!

Copy link
Collaborator

@Al-Kindi-0 Al-Kindi-0 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, thank you!

@tohrnii tohrnii merged commit 9ffc6ca into next Jan 6, 2023
@tohrnii tohrnii deleted the tohrnii-col-grouping-ir branch January 6, 2023 08:38
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