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

Reproduction of hashing test failure #30

Closed
GunnarFarneback opened this issue Feb 14, 2019 · 4 comments
Closed

Reproduction of hashing test failure #30

GunnarFarneback opened this issue Feb 14, 2019 · 4 comments

Comments

@GunnarFarneback
Copy link

GunnarFarneback commented Feb 14, 2019

For me, hashing is an X rather than a ☠️. Anyway, this is as far as I can reduce it. Probably not minimal but rather brittle.

With /tmp/hashing_test.jl containing

vals = Any[
    [0], [1], [2],
    [2, 1, 2, 3], [2, 3, 2, 1], [2, 2, 3, 2],
    [0, 0], [0, 0, 0], [0, 1], [1, 0],
    [0, 0, 1], [0, 1, 0], [1, 0, 0], [0, 1, 2],
    [0, 0], [1, 0], [0, 1], [0, 0], [0, 0],
    [5, 1], [1, 1], [0, 2], [0, 2], [4, 0],
    [0, 0], [1, 0], [0, 0, 2], [0 0 7],
    [4 0 0], [0 2 4],
]

b = vals

then

include("utils.jl")
dotest1("hashing", "/tmp/hashing_test.jl", 10000)

results in

ERROR: UndefVarError: vals not defined
Stacktrace:
 [1] _step_expr!(::Array{JuliaStackFrame,1}, ::JuliaStackFrame, ::Any, ::JuliaProgramCounter, ::Bool) at /home/gunnar/.julia/dev/JuliaInterpreter/src/interpret.jl:419
 [2] limited_finish_and_return!(::Array{JuliaStackFrame,1}, ::JuliaStackFrame, ::Int64, ::JuliaProgramCounter, ::Bool) at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:197
 [3] (::getfield(Main, Symbol("##11#13")){Int64})(::JuliaStackFrame) at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:210
 [4] #invokelatest#1 at ./essentials.jl:761 [inlined]
 [5] invokelatest at ./essentials.jl:760 [inlined]
 [6] lower!(::Any, ::Dict{Module,Array{Expr,1}}, ::Array{LineNumberNode,1}, ::Module, ::Expr) at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:96
 [7] lower_incrementally!(::Any, ::Dict{Module,Array{Expr,1}}, ::Array{LineNumberNode,1}, ::Expr, ::Module, ::Expr) at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:74
 [8] lower_incrementally!(::Any, ::Dict{Module,Array{Expr,1}}, ::Array{LineNumberNode,1}, ::Expr, ::Module, ::Array{Any,1}) at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:83
 [9] lower_incrementally!(::Any, ::Dict{Module,Array{Expr,1}}, ::Array{LineNumberNode,1}, ::Expr, ::Module, ::Expr) at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:47
 [10] lower_incrementally! at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:40 [inlined]
 [11] lower_incrementally at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:36 [inlined]
 [12] (::getfield(Main, Symbol("##10#12")){String,Int64,Module,Expr})() at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:296
 [13] cd(::getfield(Main, Symbol("##10#12")){String,Int64,Module,Expr}, ::String) at ./file.jl:96
 [14] dotest1(::String, ::String, ::Int64) at /home/gunnar/.julia/dev/JuliaInterpreter/test/utils.jl:293
 [15] top-level scope at REPL[2]:1

Removing e.g. the first element from vals makes the test pass.

@GunnarFarneback
Copy link
Author

It passes when I test it on Julia 1.1. The above was with master.

@GunnarFarneback
Copy link
Author

Running the hashing tests on Julia 1.1 fails quite differently from Julia master. Are both interesting to pin down or is the focus on master?

@timholy
Copy link
Member

timholy commented Feb 15, 2019

Interesting! What happens here is that lower_incrementally splits this into two chunks. On some Julia versions, the first chunk takes more than 10^4 statements to complete; if it aborts, then vals doesn't get defined and consequently the second expression errors.

This makes it clear that the nstmts limit is not as straightforward a solution as I had hoped. In principle it would be possible to detect this kind of interdependency automatically by scanning the lowered code for rhs Symbols and then seeing if they are already defined in JuliaTests. We could add a 2nd category of failure for this.

timholy added a commit that referenced this issue Feb 17, 2019
Also fixes a bug when trying to run a :thunk expr in Compiled mode.
@timholy
Copy link
Member

timholy commented Feb 18, 2019

Table in #13 updated, now we are much closer.

KristofferC pushed a commit that referenced this issue Feb 20, 2019
Also fixes a bug when trying to run a :thunk expr in Compiled mode.
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