Skip to content

No method matching reprcontext #193

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

Closed
tlienart opened this issue Jan 4, 2021 · 6 comments
Closed

No method matching reprcontext #193

tlienart opened this issue Jan 4, 2021 · 6 comments

Comments

@tlienart
Copy link

tlienart commented Jan 4, 2021

I tried to use SnoopCompile with Franklin's tests today but the SnoopCompile.parcel(inf_timing) step failed with

MethodError: no method matching reprcontext(::Module, ::Core.TypeofVararg)
Closest candidates are:
  reprcontext(::Module, !Matched::Type) at /Users/tlienart/.julia/packages/SnoopCompile/qKfrD/src/parcel_snoopi.jl:178
(::SnoopCompile.var"#10#13"{Module})(T::Core.TypeofVararg) at parcel_snoopi.jl:270
iterate at generator.jl:47 [inlined]
collect_to!(dest::Vector{String}, itr::Base.Generator{Base.Iterators.Drop{Core.SimpleVector}, SnoopCompile.var"#10#13"{Module}}, offs::Int64, st::Int64) at array.jl:710
collect_to_with_first! at array.jl:688 [inlined]
collect(itr::Base.Generator{Base.Iterators.Drop{Core.SimpleVector}, SnoopCompile.var"#10#13"{Module}}) at array.jl:669
map(f::Function, A::Base.Iterators.Drop{Core.SimpleVector}) at abstractarray.jl:2311
parcel(tinf::Vector{Tuple{Float64, Core.MethodInstance}}; subst::Vector{Pair{String, String}}, exclusions::Vector{String}, remove_exclusions::Bool, check_eval::Bool, blacklist::Nothing, remove_blacklist::Nothing) at parcel_snoopi.jl:270
parcel(tinf::Vector{Tuple{Float64, Core.MethodInstance}}) at parcel_snoopi.jl:228
top-level scope at snoop.jl:6
eval at boot.jl:369 [inlined]

what I did is simply

inf_timing = @snoopi include("test/runtests.jl")
pc = SnoopCompile.parcel(inf_timing)

A basic guess would be that SnoopCompile doesn't like the creation of module and evaluation of code within these temporary modules. But would there maybe be a way to skip this rather than fail? Or should I just have a simpler example for @snoopi than the full test suite?

thanks!

PS: maybe a workaround is to filter the result of inf_timing to remove things that throw off parcel? if so how would I do this?

@timholy
Copy link
Owner

timholy commented Jan 4, 2021

Which branch are you on? Recommended is teh/subflames, which is just a tiny bit ahead of #192.

@tlienart
Copy link
Author

tlienart commented Jan 4, 2021

I'll try this

Note: what I did for the moment is:

function snoopf!(v)
    remove = Int[]
    for i in 1:length(v)
        try; SnoopCompile.parcel(v[i:i]); catch; push!(remove, i); end
    end
    return deleteat!(v, remove)
end

which works well. (I get 819 / 868)

I'll report what happens with teh/subflames

@tlienart
Copy link
Author

tlienart commented Jan 4, 2021

With teh/subflames I get 1045/1089, better!

@timholy
Copy link
Owner

timholy commented Jan 4, 2021

Oh wait, you were using a released version of SnoopCompile?

That error looks like it must be due to JuliaLang/julia#38136. I've not updated this to nightly yet. It seems to work on release-1.6, though.

@tlienart
Copy link
Author

tlienart commented Jan 4, 2021

Ah I should have thought of that, sorry!

The error reported above is with v"1.7.0-DEV.137" ; I just tried with 1.5.3 and there's no error.

Thanks Tim and apologies for the spam!

@tlienart tlienart closed this as completed Jan 4, 2021
@timholy
Copy link
Owner

timholy commented Jan 4, 2021

Not spam. And the current situation may not be clear, so just FYI:

  • the teh/subflames branch represents a tip of huge change (estimated 61 commits between the released version and it)
  • with that branch, and Julia 1.6, you have access to information that is neither available on any earlier release of Julia or on any earlier release of SnoopCompile
  • @snoopi_deep essentially replaces @snoopi, although the latter is kept for compatibility purposes. It's better than @snoopi at parcel/write but it also gives a lot more.

Docs for the new version can be viewed from preview in #192.

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

No branches or pull requests

2 participants