Skip to content

Conversation

@nsajko
Copy link
Member

@nsajko nsajko commented Jun 27, 2025

I call callables that are meant to have methods added to by package authors "interface callables".

Test that various interface callables are well-behaved in case of the introduction of a new applicable type. Only interface callables taking a single type argument are tested.

The specific properties tested:

  • max_methods is high enough for good inference

  • the number of matching methods for a new type is not excessive

The primary motivation for this change is to make any future lowering of the max_methods setting of the interface callables safer.

To make the tests pass, fix a recent regression in base/strings/search.jl.

@nsajko nsajko added test This change adds or pertains to unit tests iteration Involves iteration or the iteration protocol invalidations labels Jun 27, 2025
@nsajko nsajko force-pushed the strings_search_restrict_IteratorSize_eltype branch 2 times, most recently from ff5c26f to a6a8bd2 Compare June 27, 2025 03:30
I call callables that are meant to have methods added to by package
authors "interface callables".

Test that various interface callables are well-behaved in case of the
introduction of a new applicable type. Only interface callables taking
a single type argument are tested.

The specific properties tested:

* `max_methods` is high enough for good inference

* the number of matching methods for a new type is not excessive

The primary motivation for this change is to make any future lowering
of the `max_methods` setting of the interface callables safer.

To make the tests pass, fix a recent regression in
base/strings/search.jl.
@nsajko nsajko force-pushed the strings_search_restrict_IteratorSize_eltype branch from 00ca50b to a7fa52c Compare June 27, 2025 13:16
@nsajko nsajko marked this pull request as ready for review June 27, 2025 16:43
@nsajko
Copy link
Member Author

nsajko commented Jul 25, 2025

bump

nsajko added a commit to nsajko/julia that referenced this pull request Aug 24, 2025
A function which is meant to have methods added to it by users should
have a small `max_methods` value, as world-splitting just leads to
unnecessary invalidation in that case, in the context of the package
ecosystem, where users are allowed to add arbitrarily many methods to
such functions.

xref PR JuliaLang#57884

xref PR JuliaLang#58788

xref PR JuliaLang#58829

xref PR JuliaLang#59091
nsajko added a commit to nsajko/julia that referenced this pull request Aug 27, 2025
A function which is meant to have methods added to it by users should
have a small `max_methods` value, as world-splitting just leads to
unnecessary invalidation in that case, in the context of the package
ecosystem, where users are allowed to add arbitrarily many methods to
such functions.

xref PR JuliaLang#57884

xref PR JuliaLang#58788

xref PR JuliaLang#58829

xref PR JuliaLang#59091
nsajko added a commit to nsajko/julia that referenced this pull request Aug 29, 2025
A function which is meant to have methods added to it by users should
have a small `max_methods` value, as world-splitting just leads to
unnecessary invalidation in that case, in the context of the package
ecosystem, where users are allowed to add arbitrarily many methods to
such functions.

xref PR JuliaLang#57884

xref PR JuliaLang#58788

xref PR JuliaLang#58829

xref PR JuliaLang#59091
@vtjnash
Copy link
Member

vtjnash commented Oct 1, 2025

I don't see any point to this. It seems to make the code a bit less readable for no visible benefit

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

Labels

invalidations iteration Involves iteration or the iteration protocol test This change adds or pertains to unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants