Skip to content

Conversation

@yusheng036
Copy link
Collaborator

@yusheng036 yusheng036 commented Nov 23, 2025

Hi! I have implemented cansplitpush, repeat_operator, replace_and_remove_nodes and find_lowest_nodes and have written test for every one of the functions. I have changed the backbone of annotated_query to make its semantic clearer. I have also file an issue for each function.

Fix #241, Fix #242, Fix #243 & Fix #244

Thank you for your time!!

@yusheng036
Copy link
Collaborator Author

@kylebd99 I have changed the codebase as requested.

Copy link
Contributor

@kylebd99 kylebd99 left a comment

Choose a reason for hiding this comment

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

Hey, sorry for the slow review, I think everything looks good. I had a couple of very minor comments, but I'm going to go ahead and approve it. Please make the changes, then go ahead and merge.

return components


def replace_and_remove_nodes(
Copy link
Contributor

Choose a reason for hiding this comment

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

This function should iterate through the full pointwise expression tree rather than just operating on one node. In the julia implementation, you can see this by noting that it does a PostOrderDFS through the pointwise expression https://github.com/finch-tensor/Finch.jl/blob/5dff68a19d3c480358b5e0ac112af7e856ba2b73/src/Galley/LogicalOptimizer/annotated-query.jl#L448.

assert result == expected


@pytest.mark.parametrize(
Copy link
Contributor

Choose a reason for hiding this comment

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

For this test, rather than giving a set of arg names. I would make all of the inputs FinchLogicNodes, and I would make sure that you have a test which involves a pointwise expression that has some level of nesting.

["A"],
),
# Nested case:
# root = MapJoin(mul, [A(i,j), B(i)]), reduce over i → [A]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think you mean B(j) in this comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Further, I'd appreciate 1 additional nested case where B has the index "i" which returns the mapjoin as the lowest root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants