Skip to content
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

remove JET runtime dispatch error #408

Conversation

matthijscox-asml
Copy link
Contributor

I am hunting JET errors in my code and I found the following error in CategoricalArrays that's easy to fix with a tiny rewrite.

This is how I found the JET error:

julia> using JET, CategoricalArrays

julia> @report_opt CategoricalVector{String, UInt8}(String[])
...
│││││││││││┌ push_level!(pool::CategoricalPool{String, UInt8, CategoricalValue{String, UInt8}}, level::String) @ CategoricalArrays C:\Localdata\Repositories\CategoricalArrays.jl\src\pool.jl:71
││││││││││││ runtime dispatch detected: CategoricalArrays.hash(level::String, %33::Union{Nothing, UInt64})::UInt64  
│││││││││││└────────────────────

JET thinks a Nothing might pass into the code, even though the code checks for a nothing. With my change JET doesn't make that mistake anymore. I understand it's a trivial change, but do hope you'll allow this.

@matthijscox-asml
Copy link
Contributor Author

matthijscox-asml commented Dec 12, 2024

Plots.jl fails to precompile for latest Julia on x86 windows :(

Is it possible to accept this PR with that unrelated failure?

@nalimilan nalimilan merged commit d61d911 into JuliaData:master Dec 27, 2024
14 of 16 checks passed
@nalimilan
Copy link
Member

Thanks! It's not great to have to do this kind of change but it seems harmless enough.

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