leios / Fable.jl

General purpose animations via iterated function systems
MIT License
27 stars 4 forks source link

World too new error for Julia1.9 #61

Closed leios closed 1 year ago

leios commented 1 year ago

When running Fae on Julia1.9-rc1, I get the following error:

ERROR: TaskFailedException
Stacktrace:
 [1] wait
   @ ./task.jl:349 [inlined]
 [2] wait
   @ ~/.julia/packages/KernelAbstractions/C8flJ/src/cpu.jl:65 [inlined]
 [3] wait (repeats 2 times)
   @ ~/.julia/packages/KernelAbstractions/C8flJ/src/cpu.jl:29 [inlined]
 [4] run!(layer::FractalLayer; diagnostic::Bool, frame::Int64)
   @ Fae ~/projects/Fae.jl/src/run/fractal_flame.jl:348
 [5] run!
   @ ~/projects/Fae.jl/src/run/fractal_flame.jl:333 [inlined]
 [6] square_example(num_particles::Int64, num_iterations::Int64; ArrayType::Type, dark::Bool)
   @ Main ~/projects/Fae.jl/examples/square.jl:47
 [7] square_example(num_particles::Int64, num_iterations::Int64)
   @ Main ~/projects/Fae.jl/examples/square.jl:9
 [8] top-level scope
   @ REPL[4]:1

    nested task error: TaskFailedException

        nested task error: MethodError: no method matching H_square(::StaticArraysCore.MMatrix{4, 4, Float32, 16}, ::Int64, ::NTuple{5, Float64}, ::UInt64, ::Int64)
        The applicable method may be too new: running in world age 33629, while current world is 33633.

        Closest candidates are:
          H_square(::Any, ::Any, ::Any, ::Any, ::Any) (method too new to be called from this world context.)
           @ Fae none:1

        Stacktrace:
         [1] macro expansion
           @ ~/projects/Fae.jl/src/run/fractal_flame.jl:197 [inlined]
         [2] cpu_semi_random_chaos_kernel!
           @ ~/.julia/packages/KernelAbstractions/C8flJ/src/KernelAbstractions.jl:267 [inlined]
         [3] cpu_semi_random_chaos_kernel!(__ctx__::KernelAbstractions.CompilerMetadata{KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.NoDynamicCheck, CartesianIndex{1}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.StaticSize{(4,)}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, Nothing}}, points::Matrix{Float32}, n::Int64, H1::typeof(Fae.H_square), H1_clrs::typeof(Fae.color_square), H1_probs::NTuple{4, Float64}, H1_symbols::NTuple{5, Float64}, H1_fnums::Tuple{Int64}, H2::typeof(Fae.H_2), H2_clrs::typeof(Fae.color_2), H2_symbols::Tuple{}, H2_probs::Tuple{Float64}, H2_fnums::Tuple{Int64}, layer_values::Matrix{Int64}, layer_reds::Matrix{Float32}, layer_greens::Matrix{Float32}, layer_blues::Matrix{Float32}, layer_alphas::Matrix{Float32}, frame::Int64, bounds::NamedTuple{(:ymin, :ymax, :xmin, :xmax), NTuple{4, Float64}}, bin_widths::Tuple{Float64, Float64}, num_ignore::Int64, max_range::Float64)
           @ Fae ./none:0
         [4] __thread_run(tid::Int64, len::Int64, rem::Int64, obj::KernelAbstractions.Kernel{KernelAbstractions.CPU, KernelAbstractions.NDIteration.StaticSize{(4,)}, KernelAbstractions.NDIteration.DynamicSize, typeof(Fae.cpu_semi_random_chaos_kernel!)}, ndrange::Tuple{Int64}, iterspace::KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.StaticSize{(4,)}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, Nothing}, args::Tuple{Matrix{Float32}, Int64, typeof(Fae.H_square), typeof(Fae.color_square), NTuple{4, Float64}, NTuple{5, Float64}, Tuple{Int64}, typeof(Fae.H_2), typeof(Fae.color_2), Tuple{}, Tuple{Float64}, Tuple{Int64}, Matrix{Int64}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Int64, NamedTuple{(:ymin, :ymax, :xmin, :xmax), NTuple{4, Float64}}, Tuple{Float64, Float64}, Int64, Float64}, dynamic::KernelAbstractions.NDIteration.NoDynamicCheck)
           @ KernelAbstractions ~/.julia/packages/KernelAbstractions/C8flJ/src/cpu.jl:157
         [5] (::KernelAbstractions.var"#27#28"{KernelAbstractions.Kernel{KernelAbstractions.CPU, KernelAbstractions.NDIteration.StaticSize{(4,)}, KernelAbstractions.NDIteration.DynamicSize, typeof(Fae.cpu_semi_random_chaos_kernel!)}, Tuple{Int64}, KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.StaticSize{(4,)}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, Nothing}, Tuple{Matrix{Float32}, Int64, typeof(Fae.H_square), typeof(Fae.color_square), NTuple{4, Float64}, NTuple{5, Float64}, Tuple{Int64}, typeof(Fae.H_2), typeof(Fae.color_2), Tuple{}, Tuple{Float64}, Tuple{Int64}, Matrix{Int64}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Int64, NamedTuple{(:ymin, :ymax, :xmin, :xmax), NTuple{4, Float64}}, Tuple{Float64, Float64}, Int64, Float64}, KernelAbstractions.NDIteration.NoDynamicCheck, Int64})()
           @ KernelAbstractions ./threadingconstructs.jl:340

    ...and 11 more exceptions.

    Stacktrace:
     [1] sync_end(c::Channel{Any})
       @ Base ./task.jl:445
     [2] macro expansion
       @ ./task.jl:477 [inlined]
     [3] __run(obj::KernelAbstractions.Kernel{KernelAbstractions.CPU, KernelAbstractions.NDIteration.StaticSize{(4,)}, KernelAbstractions.NDIteration.DynamicSize, typeof(Fae.cpu_semi_random_chaos_kernel!)}, ndrange::Tuple{Int64}, iterspace::KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.StaticSize{(4,)}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, Nothing}, args::Tuple{Matrix{Float32}, Int64, typeof(Fae.H_square), typeof(Fae.color_square), NTuple{4, Float64}, NTuple{5, Float64}, Tuple{Int64}, typeof(Fae.H_2), typeof(Fae.color_2), Tuple{}, Tuple{Float64}, Tuple{Int64}, Matrix{Int64}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Int64, NamedTuple{(:ymin, :ymax, :xmin, :xmax), NTuple{4, Float64}}, Tuple{Float64, Float64}, Int64, Float64}, dynamic::KernelAbstractions.NDIteration.NoDynamicCheck)
       @ KernelAbstractions ~/.julia/packages/KernelAbstractions/C8flJ/src/cpu.jl:132
     [4] (::KernelAbstractions.var"#19#20"{Nothing, Nothing, typeof(KernelAbstractions.__run), Tuple{KernelAbstractions.Kernel{KernelAbstractions.CPU, KernelAbstractions.NDIteration.StaticSize{(4,)}, KernelAbstractions.NDIteration.DynamicSize, typeof(Fae.cpu_semi_random_chaos_kernel!)}, Tuple{Int64}, KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.StaticSize{(4,)}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, Nothing}, Tuple{Matrix{Float32}, Int64, typeof(Fae.H_square), typeof(Fae.color_square), NTuple{4, Float64}, NTuple{5, Float64}, Tuple{Int64}, typeof(Fae.H_2), typeof(Fae.color_2), Tuple{}, Tuple{Float64}, Tuple{Int64}, Matrix{Int64}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Matrix{Float32}, Int64, NamedTuple{(:ymin, :ymax, :xmin, :xmax), NTuple{4, Float64}}, Tuple{Float64, Float64}, Int64, Float64}, KernelAbstractions.NDIteration.NoDynamicCheck}})()
       @ KernelAbstractions ~/.julia/packages/KernelAbstractions/C8flJ/src/cpu.jl:22

Note that simply running the code again solves this issue. I am not sure how to fix it for now.

leios commented 1 year ago

note the following does not error:

using KernelAbstractions

fx_string = "function check()
@print('check', '\n')
end"

@kernel function whatever_kernel(fx)
    fx()
end

function whatever!(fx)
    whatever_kernel(CPU(), 4)(fx, ndrange=4)
end

fx = eval(Meta.parse(replace(fx_string, "'" => '"')))

whatever!(fx)
vchuravy commented 1 year ago

Oh this is fun...

leios commented 1 year ago

done in #64