Open MilesCranmer opened 8 months ago
Update: I have uploaded an rr trace (see original post)
Can't reproduce?
(@v1.6) pkg> add https://github.com/MilesCranmer/SymbolicRegression.jl#bc3d642281e4d99ee3380cea6c21a0abae901790
[...]
julia> include("/home/nsajko/.julia/packages/SymbolicRegression/0Tn2D/test/test_deterministic.jl");
[ Info: Precompiling SymbolicRegression [8254be44-1295-4e6a-a16d-46603ac705cb]
WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier.
julia> versioninfo()
Julia Version 1.6.7
Commit 3b76b25b64 (2022-07-19 15:11 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: AMD Ryzen 3 5300U with Radeon Graphics
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, znver2)
I uploaded the rr trace above. You can see and reproduce the error in that, no?
According to https://discourse.julialang.org/t/unreachable-reached-at-0x13929e935/38528/6?u=milescranmer I am supposed to submit a bug report.
I can reproduce this: With Julia v1.6.7 + SymbolicRegression v0.24.0 #bc3d642
add https://github.com/MilesCranmer/SymbolicRegression.jl#bc3d642281e4d99ee3380cea6c21a0abae901790
# run test code with julia v1.6
julia +1.6 .\53761.jl
And simplified test code:
using SymbolicRegression
X = zeros(2, 1);
Y = zeros(1);
# equation_search(X, Y)
equation_search(X, Y; parallelism=:serial)
Julia v1.6 + SymbolicRegression v0.24.2 just gives LoadError
.
> julia +1.6 .\53761.jl
ERROR: LoadError: return type HallOfFame{Float32, Float32, Node{Float32}} does not match inferred return type Any
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] top-level scope
@ C:\Users\cyhan\Desktop\cyhan\gc\julia\bugs\53761.jl:27
in expression starting at C:\Users\cyhan\Desktop\cyhan\gc\julia\bugs\53761.jl:26
I'm getting the bug
According to discourse, this deserved a bug report.
I get this when running Julia 1.6.7 SymbolicRegression.jl unittests on one of my branches. You can see the log here: https://github.com/MilesCranmer/SymbolicRegression.jl/actions/runs/8309436354/job/22740784019. I can reproduce it on my other Linux machines as well.
It specifically comes from this line: https://github.com/MilesCranmer/SymbolicRegression.jl/blob/bc3d642281e4d99ee3380cea6c21a0abae901790/test/test_deterministic.jl#L22-L30. This is not a new test; it's never had issues before. It seems like something in the type inference is breaking.
I have uploaded an rr trace here, of just running this test (which gets the error): https://s3.amazonaws.com/julialang-dumps/reports/2024-03-16T21-43-57-MilesCranmer.tar.zst so you can walk through it.
You can also reproduce this by checking out commit bc3d642281e4d99ee3380cea6c21a0abae901790 of SymbolicRegression.jl and running the file
test/test_deterministic.jl
for Julia 1.6.7.My guess is that it is related to type inference through
Optim.optimize
when theDynamicExpressions.OperatorEnum
is underspecified (i.e., aUnionAll
). I can get around this bug with this commit: https://github.com/MilesCranmer/SymbolicRegression.jl/pull/271/commits/d19f15b614a950b72371fbf4bcbc2994dea028c7, which specifies the fullOperatorEnum
. I'm not sure if that helps or not.