Skip to content

Conversation

@kaushikcfd
Copy link
Collaborator

@kaushikcfd kaushikcfd commented Dec 4, 2024

Closes #890.

The attached regression fails on main.

/cc @connorjward

.ancestors(inner_iname_nest))
ancestors_of_outer_iname = (loop_nest_tree
.ancestors(outer_iname_nest))
if outer_iname in ancestors_of_inner_iname:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would have been nice if mypy could tell us our comparison types are incompatible. We were checking "InameStr in tuple[InameStrSet, ...]" which would always return False.

Copy link
Owner

Choose a reason for hiding this comment

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

I agree. But __contains__ is typed for object: https://github.com/python/typeshed/blob/d70fad09dd7012bd43304e1c67b7599558b90c39/stdlib/typing.pyi#L575

😢

To their credit, the Python types people have discussed it: python/typeshed#8219

@kaushikcfd kaushikcfd requested a review from inducer December 4, 2024 15:52
@connorjward
Copy link
Contributor

Thanks!

Copy link
Owner

@inducer inducer left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! A minor nit below, otherwise LGTM!

.ancestors(inner_iname_nest))
ancestors_of_outer_iname = (loop_nest_tree
.ancestors(outer_iname_nest))
if outer_iname in ancestors_of_inner_iname:
Copy link
Owner

Choose a reason for hiding this comment

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

I agree. But __contains__ is typed for object: https://github.com/python/typeshed/blob/d70fad09dd7012bd43304e1c67b7599558b90c39/stdlib/typing.pyi#L575

😢

To their credit, the Python types people have discussed it: python/typeshed#8219

@inducer
Copy link
Owner

inducer commented Dec 4, 2024

FYI: Firedrake failures are expected for the time being, see #894.

@inducer inducer merged commit 56936b1 into main Dec 4, 2024
17 of 18 checks passed
@inducer inducer deleted the fix_loop_prio branch December 4, 2024 18:00
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.

Understanding loop_priority

4 participants