JuliaReach / Reachability.jl

Reachability and Safety of Nondeterministic Dynamical Systems
MIT License
50 stars 4 forks source link

Broken test convert error #690

Closed mforets closed 4 years ago

mforets commented 4 years ago
Computing successors 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| Time: 0:00:02
Reachability.solve_continuous: Error During Test at /home/mforets/.julia/dev/Reachability/test/Reachability/alltests.jl:2
  Got exception outside of a @test
  LoadError: MethodError: Cannot `convert` an object of type ReachSet{Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}} to an object of type ReachSet{Hyperrectangle{Float64,VNC,VNR} where VNR<:AbstractArray{Float64,1} where VNC<:AbstractArray{Float64,1}}
  Closest candidates are:
    convert(::Type{#s16} where #s16<:Union{Number, T}, !Matched::MultivariatePolynomials.AbstractPolynomialLike{T}) where T at /home/mforets/.julia/packages/MultivariatePolynomials/0oEYT/src/conversion.jl:15
    convert(::Type{T}, !Matched::T) where T at essentials.jl:167
    ReachSet{Hyperrectangle{Float64,VNC,VNR} where VNR<:AbstractArray{Float64,1} where VNC<:AbstractArray{Float64,1}}(::Any, !Matched::Any, !Matched::Any) where SN at /home/mforets/.julia/dev/Reachability/src/ReachSets/ReachSet.jl:16
  Stacktrace:
   [1] setindex!(::Array{ReachSet{Hyperrectangle{Float64,VNC,VNR} where VNR<:AbstractArray{Float64,1} where VNC<:AbstractArray{Float64,1}},1}, ::ReachSet{Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}}, ::Int64) at ./array.jl:766
   [2] project_reach(::Array{SparseReachSet{CartesianProductArray{Float64,LazySet{Float64}}},1}, ::Array{Int64,1}, ::Options) at /home/mforets/.julia/dev/Reachability/src/ReachSets/project_reach.jl:95
   [3] project(::Array{SparseReachSet{CartesianProductArray{Float64,LazySet{Float64}}},1}, ::Options) at /home/mforets/.julia/dev/Reachability/src/ReachSets/project_reach.jl:117
   [4] project(::ReachSolution{CartesianProductArray{Float64,LazySet{Float64}},SparseReachSet{CartesianProductArray{Float64,LazySet{Float64}}}}) at /home/mforets/.julia/dev/Reachability/src/ReachSets/project_reach.jl:120
   [5] top-level scope at /home/mforets/.julia/dev/Reachability/test/Reachability/solve_continuous.jl:37
   [6] include at ./boot.jl:328 [inlined]
   [7] include_relative(::Module, ::String) at ./loading.jl:1094
   [8] include(::Module, ::String) at ./Base.jl:31
   [9] include(::String) at ./client.jl:431
   [10] top-level scope at /home/mforets/.julia/dev/Reachability/test/Reachability/alltests.jl:2
   [11] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Test/src/Test.jl:1113
   [12] top-level scope at /home/mforets/.julia/dev/Reachability/test/Reachability/alltests.jl:2
   [13] top-level scope at util.jl:156
   [14] include at ./boot.jl:328 [inlined]
   [15] include_relative(::Module, ::String) at ./loading.jl:1094
   [16] include(::Module, ::String) at ./Base.jl:31
   [17] include(::String) at ./client.jl:431
   [18] top-level scope at /home/mforets/.julia/dev/Reachability/test/runtests.jl:9
   [19] include at ./boot.jl:328 [inlined]
   [20] include_relative(::Module, ::String) at ./loading.jl:1094
   [21] include(::Module, ::String) at ./Base.jl:31
   [22] exec_options(::Base.JLOptions) at ./client.jl:295
   [23] _start() at ./client.jl:464
  in expression starting at /home/mforets/.julia/dev/Reachability/test/Reachability/solve_continuous.jl:37

Test Summary:                 | Pass  Error  Total
Reachability.solve_continuous |    4      1      5
ERROR: LoadError: LoadError: Some tests did not pass: 4 passed, 0 failed, 1 errored, 0 broken.
mforets commented 4 years ago

This error is allowed in the travis build for this package, as it was introduced in the dev version of LazySets.

schillic commented 4 years ago

Okay, and is it a valid error in LazySets? Then we should fix it there before we make a new release.

schillic commented 4 years ago

I investigated and am pretty sure that the problem occurred by adding new type parameters to Hyperrectangle. But the actual problem lies in Reachability: https://github.com/JuliaReach/Reachability.jl/blob/fbbdc7291bcb37118e2c20678d6807d0ae29e632/src/ReachSets/project_reach.jl#L95 So it seems that our workaround has already found its limits.