We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
calling rand with a no-op context causes Anys. Might exacerbate #91
rand
Any
julia> using Cassette julia> Cassette.@context Foo; julia> @code_typed Cassette.overdub(Foo(), rand) CodeInfo( 1 ─ %1 = $(Expr(:foreigncall, :(:jl_threadid), Int16, svec(), 0, :(:ccall)))::Int16 │ %2 = (Core.Intrinsics.sext_int)(Int64, %1)::Int64 │ %3 = (Core.Intrinsics.add_int)(%2, 1)::Int64 │ %4 = invoke Cassette.overdub(_2::Cassette.Context{nametype(Foo),Nothing,Nothing,Cassette.var"##PassType#427",Nothing,Nothing}, Random.default_rng::typeof(Random.default_rng), %3::Int64)::Any │ %5 = Cassette.overdub(##overdub_context#425, rand, %4, Random.Float64)::Any └── return %5 ) => Any
Works on Julia 1.1/1.2 + Cassette master
The text was updated successfully, but these errors were encountered:
Nailed this down to a sequence of type-instable code within Radom.make_seed:
Radom.make_seed
s = read(::Base.OrCmds,::Type{String})::Any x = parse(UInt64, s, base=16)::UInt64
When this code gets overdubbed, we call a generator:
code_warntype(Cassette.overdub, Tuple{typeof(Foo()), typeof(parse), Type{UInt64}, Any}) ERROR: cannot call @generated function `overdub(overdub_context::Cassette.Context, overdub_arguments...) in Cassette at /home/vchuravy/src/Cassette/src/overdub.jl:524` with abstract argument types: Tuple{Cassette.Context{nametype(Foo),Nothing,Nothing,Cassette.var"##PassType#427",Nothing,Nothing},typeof(parse),Type{UInt64},Any}
:/ this unveils a pretty drastic limitation of Cassette (that at least to me, wasn't obvious).
Sorry, something went wrong.
No branches or pull requests
calling
rand
with a no-op context causesAny
s. Might exacerbate #91Works on Julia 1.1/1.2 + Cassette master
The text was updated successfully, but these errors were encountered: