-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix ==, StaticBool promotion #110
Conversation
Codecov Report
@@ Coverage Diff @@
## master #110 +/- ##
==========================================
- Coverage 99.00% 98.57% -0.43%
==========================================
Files 3 3
Lines 701 702 +1
==========================================
- Hits 694 692 -2
- Misses 7 10 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
I get julia> using SnoopCompileCore
julia> invals = @snoopr using Static
145-element Vector{Any}:
MethodInstance for last(::AbstractUnitRange)
1
MethodInstance for getproperty(::AbstractUnitRange, ::Symbol)
"jl_method_table_insert"
getproperty(x::Union{Static.OptionallyStaticUnitRange{F, L}, Static.OptionallyStaticStepRange{F, <:Any, L}} where {F, L}, s::Symbol) @ Static ~/.julia/packages/Static/WMMz0/src/ranges.jl:331
"jl_method_table_insert"
MethodInstance for UnitRange{Int64}(::Real, ::Real)
1
MethodInstance for UnitRange{Int64}(::UnitRange)
2
MethodInstance for Base.Broadcast.axistype(::Any, ::Base.OneTo{Int64})
3
MethodInstance for Base.Broadcast._bcs1(::Base.OneTo{Int64}, ::Any)
4
MethodInstance for Base.Broadcast._bcs(::Tuple{Base.OneTo{Int64}}, ::Tuple)
5
MethodInstance for Base.Broadcast.broadcast_shape(::Tuple{Base.OneTo{Int64}}, ::Tuple)
6
MethodInstance for Base.Broadcast.combine_axes(::Vector{Int64}, ::Array)
7
MethodInstance for Base.Broadcast.instantiate(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{_A}, Nothing, typeof(>=), <:Tuple{Vector{Int64}, Array}} where _A)
8
MethodInstance for Base.Broadcast.materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{_A}, Nothing, typeof(>=), <:Tuple{Vector{Int64}, Array}} where _A)
⋮
2
MethodInstance for all(::Base.IteratorsMD.var"#23#25", ::Tuple{Vararg{OrdinalRange{Int64, Int64}, N}} where N)
2
Tuple{typeof(step), OrdinalRange{Int64, Int64}}
step(::Static.OptionallyStaticStepRange{<:Any, StaticInt{S}}) where S @ Static ~/.julia/packages/Static/WMMz0/src/ranges.jl:169
"jl_method_table_insert"
MethodInstance for ∘(::Function, ::Function)
"invalidate_mt_cache"
MethodInstance for Base.to_index(::Vector{UInt8}, ::Number)
1
MethodInstance for Base._to_indices1(::Vector{UInt8}, ::Tuple{Base.OneTo{Int64}}, ::Number)
2
MethodInstance for to_indices(::Vector{UInt8}, ::Tuple{Base.OneTo{Int64}}, ::Tuple{Number})
3
MethodInstance for to_indices(::Vector{UInt8}, ::Tuple{Number})
4
MethodInstance for getindex(::Vector{UInt8}, ::Number)
5
MethodInstance for Base.to_index(::Number)
"jl_method_table_insert"
to_index(x::StaticInt) @ Static ~/.julia/packages/Static/WMMz0/src/Static.jl:84
"jl_method_table_insert" on both this branch and master. |
Does the invalidation tree show this is due to this PR or a regression from Base |
It was the same on master and this PR, so it's at least unrelated to this PR. |
I'm looking into it. The biggest culprit is inserting zero(T::Type{<:StaticBool}) @ Static ~/projects/Static.jl/src/Static.jl:390 invalidated:
backedges: 1: superseding zero(::Type{T}) where T<:Number @ Base number.jl:309 with MethodInstance for zero(::Type{T} where T<:Integer) (9 children) Which is being fickle with my initial attempts |
If the invalidations are unrelated to this PR, would it be OK to merge this first? |
Thanks! Would you mind releasing a new version as well? This would fix some CI issues we're currently having. |
Fixes #108