Skip to content

Don't filter Core methods from newly-inferred list #58510

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

topolarity
Copy link
Member

@topolarity topolarity commented May 23, 2025

This allows constructors like Tuple{Type{Vector{Foo}}, UndefInitializer, Tuple{Int}} to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:

--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so

Resolves #58497.

Now that we re-export quite a lot from `Core` it seems sensible to
remove. This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile properly.

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```
@topolarity topolarity requested a review from timholy May 23, 2025 12:51
@jakobnissen jakobnissen added the latency Latency label May 23, 2025
@KristofferC KristofferC added the backport 1.12 Change should be backported to release-1.12 label May 23, 2025
@topolarity topolarity added backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11 labels May 23, 2025
invokelatest() do
let tt = Tuple{Type{Vector{CorePrecompilation.Foo}}, UndefInitializer, Tuple{Int}},
match = first(Base._methods_by_ftype(tt, -1, Base.get_world_counter())),
mi = Base.specialize_method(match)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mi = Base.specialize_method(match)
mi = first(Base.specializations(match.method))

to be certain that you're not generating that mi with this call.

Copy link
Member Author

Choose a reason for hiding this comment

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

This method is very general though, it has many specializations:

julia> match.method
Vector{T}(::UndefInitializer, d::Tuple{Int64}) where T
     @ Core boot.jl:660

julia> length(Base.specializations(match.method))
108

I think the cache checks should guarantee that we're picking up an existing MethodInstance (the test fails as expected on current master)

@topolarity topolarity merged commit f8ece05 into JuliaLang:master May 27, 2025
12 checks passed
@topolarity topolarity deleted the ct/no-filter-core branch May 27, 2025 21:31
@KristofferC KristofferC mentioned this pull request May 28, 2025
58 tasks
KristofferC pushed a commit that referenced this pull request May 28, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Jun 4, 2025
This was referenced Jun 4, 2025
KristofferC pushed a commit that referenced this pull request Jun 5, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
KristofferC pushed a commit that referenced this pull request Jun 5, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
KristofferC pushed a commit that referenced this pull request Jun 5, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
KristofferC pushed a commit that referenced this pull request Jun 5, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
KristofferC added a commit that referenced this pull request Jun 5, 2025
KristofferC pushed a commit that referenced this pull request Jun 5, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
KristofferC added a commit that referenced this pull request Jun 5, 2025
KristofferC pushed a commit that referenced this pull request Jun 25, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
KristofferC pushed a commit that referenced this pull request Jun 25, 2025
KristofferC pushed a commit that referenced this pull request Jul 3, 2025
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11 latency Latency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array constructors ignored in precompile(...) statements
4 participants