-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
a3a0eb8
to
3377252
Compare
cb503bc
to
21021f7
Compare
3539173
to
89a0ce0
Compare
89a0ce0
to
3153e37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ae7f6ad
to
0bb24c7
Compare
There was a problem hiding this 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.
0bb24c7
to
a731396
Compare
3153e37
to
c2b50bc
Compare
1183f5d
to
7b970b5
Compare
f3f98ff
to
a62a07f
Compare
b86b427
to
0a287a7
Compare
There was a problem hiding this 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)
0a287a7
to
c3536ce
Compare
cd30aa9
to
6c0bb02
Compare
There was a problem hiding this 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.
ir/src/trace_columns.rs
Outdated
/// 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, |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
ir/src/transition_stmts/graph.rs
Outdated
let node_index = self.insert_op(Operation::TraceElement(TraceAccess::new( | ||
trace_segment, | ||
col_idx, | ||
0, | ||
))); |
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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.
6c0bb02
to
2814d21
Compare
2814d21
to
2fdc6f1
Compare
There was a problem hiding this 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!
There was a problem hiding this 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!
Closes #85.