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

Look up correct framecode for invoke #352

Merged
merged 2 commits into from
Dec 3, 2019
Merged

Look up correct framecode for invoke #352

merged 2 commits into from
Dec 3, 2019

Conversation

timholy
Copy link
Member

@timholy timholy commented Nov 29, 2019

Prior to this the tests failed due to the following:

julia> using JuliaInterpreter

julia> sin(1)
0.8414709848078965

julia> @interpret sin(1)
0.8370984093755471

This turns out to be due to the new evalpoly, it was looking up the wrong framecode. This might have been a bug on all previous versions, but only detected now because of the change from macro to generated function.

@timholy
Copy link
Member Author

timholy commented Nov 29, 2019

OSX and Windows test failures seem unrelated (install_archive).

@jmert
Copy link

jmert commented Nov 30, 2019

For what it's worth, this helps with a case that interprets an invoked call with a where clause — I was trying to debug a code path, but kept getting that the type variables were unknown. Merging this locally fixed the issue.

julia> using Debugger, LinearAlgebra

julia> f(d::Diagonal{T}) where {T} = invoke(f, Tuple{AbstractMatrix}, d)
f (generic function with 1 method)

julia> f(m::AbstractMatrix{T}) where {T} = T
f (generic function with 2 methods)

julia> D = Diagonal([1.0, 2.0])
2×2 Diagonal{Float64,Array{Float64,1}}:
 1.0    
     2.0

julia> f(D)
Float64

julia> @run f(D)
Breaking for error:
ERROR: UndefVarError: T not defined
Stacktrace:
 [1] f(::Diagonal{Float64,Array{Float64,1}}) at REPL[3]:1
 [2] f(::Diagonal{Float64,Array{Float64,1}}) at REPL[2]:1

In f(m) at REPL[3]:1
>1  f(m::AbstractMatrix{T}) where {T} = T

About to run: return $(QuoteNode(:($(Expr(:static_parameter, 1)))))
1|debug> q

julia> 

@timholy
Copy link
Member Author

timholy commented Dec 1, 2019

Thanks @jmert, I shamelessly stole this test and added it here. I can verify that it fails on current master.

@timholy
Copy link
Member Author

timholy commented Dec 3, 2019

Why is this still using

Julia Version 1.4.0-DEV.535
Commit 9babbf5dc6 (2019-11-30 20:29 UTC)

There's a newer version available:

Julia Version 1.4.0-DEV.546
Commit 84e839227f (2019-12-03 02:31 UTC)

Interestingly, over at timholy/SnoopCompile.jl#43 one sees the "push" build is using a different nightly from the "pr" build on linux. (OSX is using a consistent nightly.)

CC @StefanKarpinski

@StefanKarpinski
Copy link

I don't know. I'm not really an expert on these CI systems. Perhaps @staticfloat knows?

@staticfloat
Copy link

I don't know why. I re-ran the job and it got a newer one. There are levels of caching that happen between the CI services and the buildbot output, and the caching is implemented differently for different CI providers (such as MacOS on Travis or Linux on Travis, which are within different datacenters)

@timholy
Copy link
Member Author

timholy commented Dec 3, 2019

While nightly continues to be problematic, on my machine master passes, so I'll merge this.

@timholy timholy merged commit 32c7a32 into master Dec 3, 2019
@timholy timholy deleted the teh/invoke branch December 3, 2019 23:20
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.

4 participants