Skip to content

Conversation

@alexfikl
Copy link
Contributor

This also does some cleanup: updates docs a bit, ports to more f-strings, etc.

@alexfikl alexfikl force-pushed the type-transform-iname branch from 4c5c4e1 to 7ee0c81 Compare December 14, 2025 14:31
Comment on lines 705 to 707
# FIXME: parse_match never returns None, so this code is not executed?
if within is None:
new_domain = new_domain.project_out(iname_dt, iname_idx, 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

?

Copy link
Owner

Choose a reason for hiding this comment

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

I can't even remember what the intent of this was. Delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines -821 to 857
return find_unused_axis_tag(kernel, "g")
return [find_unused_axis_tag(kernel, "g")]
elif tag == "unused.l":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't seem like this was ever hit? It returned a single element instead of a list, from what I can tell.

Copy link
Owner

Choose a reason for hiding this comment

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

Untested, undocumented, not functioning? Delete!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to be documented at https://documen.tician.de/loopy/ref_kernel.html#iname-implementation-tags, but not used or tested anywhere that I could find. Still remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, from a bit of git blame, they were just forgotten in a recent-ish change: cafc5ab

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, let's keep for now then.

knl_inames[sub_iname] = knl_inames[sub_iname].tagged(new_tag)

return kernel.copy(inames=knl_inames)
return kernel.copy(inames=constantdict(knl_inames))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the kernel supposed to be more immutable? I added these in a few places, but not sure if it's a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, just briefly looked at some failures, and it doesn't seem like it is 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, one fun failure with these things: passed in tuple(domains) in a few places which made it fail some tests because [1, 2, 3] != (1, 2, 3) :(

Copy link
Owner

Choose a reason for hiding this comment

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

Morally, LoopKernel is supposed to be immutable. But the data structure still isn't, in places. Any step towards that is welcome though, as long as it doesn't break backwards compatbility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this might brake compatibility though. Might be better to start with more warnings in __post_init__ or something?

For this, constantdict.copy returns another constantdict, so any places that tries to do that and modify will break. Fortunately constantdict({"a": 1}) == {"a": 1} (for better or worse), so this didn't see too many failures on the CI at least.

Copy link
Owner

Choose a reason for hiding this comment

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

I wasn't saying we should do this now. :)

@alexfikl alexfikl force-pushed the type-transform-iname branch 2 times, most recently from bfe11ea to a53e22b Compare December 14, 2025 19:10
@alexfikl alexfikl marked this pull request as ready for review December 14, 2025 19:11
@alexfikl alexfikl force-pushed the type-transform-iname branch from a53e22b to 82f35c2 Compare December 14, 2025 19:14
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!

Comment on lines 705 to 707
# FIXME: parse_match never returns None, so this code is not executed?
if within is None:
new_domain = new_domain.project_out(iname_dt, iname_idx, 1)
Copy link
Owner

Choose a reason for hiding this comment

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

I can't even remember what the intent of this was. Delete.

| Sequence[tuple[str, _Tags_ish]]
| str),
*,
# FIXME: 'force' is unused?
Copy link
Owner

Choose a reason for hiding this comment

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

Kill it and see what breaks? Or at least deprecate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a deprecation warning. Seems to have been unused for a long time now: 8734898#diff-a91a39471a27d37ceb2117f72be493a2ab46af1987edc52ff7a432e2c296f2cc.

Comment on lines -821 to 857
return find_unused_axis_tag(kernel, "g")
return [find_unused_axis_tag(kernel, "g")]
elif tag == "unused.l":
Copy link
Owner

Choose a reason for hiding this comment

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

Untested, undocumented, not functioning? Delete!

knl_inames[sub_iname] = knl_inames[sub_iname].tagged(new_tag)

return kernel.copy(inames=knl_inames)
return kernel.copy(inames=constantdict(knl_inames))
Copy link
Owner

Choose a reason for hiding this comment

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

Morally, LoopKernel is supposed to be immutable. But the data structure still isn't, in places. Any step towards that is welcome though, as long as it doesn't break backwards compatbility.

@alexfikl alexfikl force-pushed the type-transform-iname branch 4 times, most recently from 3999c37 to 3d6bc8a Compare December 17, 2025 07:57
@alexfikl alexfikl force-pushed the type-transform-iname branch from 3d6bc8a to 8228fdb Compare December 17, 2025 08:24
@alexfikl
Copy link
Contributor Author

@inducer Any idea why the grudge CI is unhappy? It seems to pass just fine locally and I can't see any particular changes that should have suddenly broken it..

@inducer
Copy link
Owner

inducer commented Dec 19, 2025

News regarding the grudge failures: inducer/grudge#396

@alexfikl alexfikl force-pushed the type-transform-iname branch from 8228fdb to ae1f9de Compare December 22, 2025 09:34
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.

2 participants