-
Notifications
You must be signed in to change notification settings - Fork 366
[OM] Add test for nested lists in ListConcatOp evaluator. #8452
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
Conversation
@uenoku do you mind taking a look at this one? It was an oversight in the initial list concat roll out. |
" %6 = om.list_create %2, %3 : !om.string" | ||
" %7 = om.list_create %6 : !om.list<!om.string>" | ||
" %8 = om.list_concat %5, %7 : <!om.list<!om.string>>" | ||
" om.class.fields %8 : !om.list<!om.list<!om.string>> " |
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 seems like %8
is a a list of lists of strings, but below grabbing the result via the evaluator returns a flat list. Is this the expected behavior for the semantics of the evaluator? My intuition would've expected a nested list value, so curious why it's being flattened.
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.
oh hmm you are right, i was trying to write a test for concatenating lists of lists, but i do not want to actually flatten away that structure. let me take another look at this.
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.
Thanks for the review, I was way off--this was actually working correctly, and I was mixing up what the test expectation should be. I've update the test, and I guess I will just merge it since it doesn't hurt to have more tests.
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.
impl/test look good to me w.r.t. the desired semantics, just a curiosity question about the choice of semantics
@@ -621,8 +647,7 @@ circt::om::Evaluator::evaluateListConcat(ListConcatOp op, | |||
|
|||
// Append each EvaluatorValue from the sublist. | |||
evaluator::ListValue *subList = extractList(result.value().get()); | |||
for (auto subValue : subList->getElements()) | |||
values.push_back(subValue); | |||
extractElements(subList); |
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.
Does this assume that the concat argument is always a list of sublists? So this doesn't support concatenating two "depth 1" lists?
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.
yeah, this was just wrong.
This is just adding a test that we can concatenate lists of lists and return the right result in the Evaluator.
1e1e113
to
54bea01
Compare
This is just adding a test that we can concatenate lists of lists and return the right result in the Evaluator.
This is just adding a test that we can concatenate lists of lists and
return the right result in the Evaluator.