-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Yet more inference/invalidation fixes #1869
Conversation
Ah, does Pkg get deployed to older Julia versions? Or just, sometimes developed on older Julia versions? Should I add version checks? |
Depends on how much extra work there is. We might need to lose 1.4 and 1.5 compat soon anyway when we start using JuliaLang/julia#36018. |
It wouldn't be much work, but your TOML-parser sounds like critical infrastructure to me. So perhaps this can just hang out until you're ready to commit to that and Julia 1.6. |
e2aee5c
to
cd42436
Compare
@@ -1749,8 +1749,8 @@ function status(ctx::Context, pkgs::Vector{PackageSpec}=PackageSpec[]; | |||
old_ctx = Context(;env=env_diff) | |||
end | |||
# display | |||
filter_uuids = [pkg.uuid for pkg in pkgs if pkg.uuid !== nothing] | |||
filter_names = [pkg.name for pkg in pkgs if pkg.name !== nothing] | |||
filter_uuids = [pkg.uuid::UUID for pkg in pkgs if pkg.uuid !== nothing] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter_uuids = [pkg.uuid::UUID for pkg in pkgs if pkg.uuid !== nothing] | |
filter_uuids = UUID[pkg.uuid for pkg in pkgs if pkg.uuid !== nothing] |
maybe? Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version here avoids one runtime dispatch and one invalidation-worthy call to convert
(from inside the setindex!
call):
julia> f(x) = Int[x]
f (generic function with 1 method)
julia> g(x) = [x::Int]
g (generic function with 1 method)
julia> code_typed(f, (Integer,))
1-element Array{Any,1}:
CodeInfo(
1 ─ %1 = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Int64,1}, svec(Any, Int64), 0, :(:ccall), Array{Int64,1}, 1, 1))::Array{Int64,1}
│ Base.setindex!(%1, x, 1)::Any
└── return %1
) => Array{Int64,1}
julia> code_typed(g, (Integer,))
1-element Array{Any,1}:
CodeInfo(
1 ─ Core.typeassert(x, Main.Int)::Int64
│ %2 = π (x, Int64)
│ %3 = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Array{Int64,1}, svec(Any, Int64), 0, :(:ccall), Array{Int64,1}, 1, 1))::Array{Int64,1}
│ Base.arraysize(%3, 1)::Int64
└── goto #3 if not true
2 ─ Base.arrayset(false, %3, %2, 1)::Array{Int64,1}
3 ┄ goto #4
4 ─ return %3
) => Array{Int64,1}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thanks for exaplining.
I think we should drop 1.4 and merge this. We should probably then add a matrix entry to the Travis runner so that we also run with |
I'll push to this branch for the stuff I mentioned in the last comment |
Are you fixing the conflict or shall I? I don't want to cause more trouble by trying to be helpful. |
Looks like this should pass. I therefore took the liberty of reorganizing the commits into more logical form. Feel free to merge or squash, whatever you prefer. |
Workaround for #15276
JuliaLang/julia#36280 introduced the ability to pre-allocate the container used to track values of `f.(itr)` in `unique(f, itr)`. Particularly for containers with `Union` elements, this circumvents significant inference problems. Related: JuliaLang/julia#36454
This reduces the vulnerability to invalidations.
Avoids a major source of invalidations
Looks good to go. Might want to increase the amount of time on windows, since one of the two jobs timed out and the other was fairly close to the limit. |
I'll put back AV then, it seems faster there. |
- CI: build docs on nightly
BTW, might be worth mentioning that after I reconfigured the commits, I'm pretty sure the only two that need |
This is the Pkg part of what I found in my investigations of invalidations due to extending
==
, c.f. JuliaLang/julia#36282. This also requires JuliaLang/julia#36280, so if that's not on nightly yet this wiil fail tests. (It also requires JuliaLang/julia#36188, but I imagine that's on nightly by now.)This will be easiest to review ignoring whitespace changes, due to some big
let
blocks from circumventing more cases of the infamous 15276.