JuliaPOMDP / POMDPs.jl

MDPs and POMDPs in Julia - An interface for defining, solving, and simulating fully and partially observable Markov decision processes on discrete and continuous spaces.
http://juliapomdp.github.io/POMDPs.jl/latest/
Other
657 stars 100 forks source link

Bizarre bug with deserialization of QuickMDP #447

Open fredcallaway opened 1 year ago

fredcallaway commented 1 year ago

This one's a real doozy. It looks like a Quick(PO)MDP can't be deserialized twice into the same session, except the one it was defined in.

Understood if this is too much of an edge case to be worth fixing, but I wanted to flag it nonetheless.

simple_mdp = QuickPOMDP(
    states = [1],
    actions = [1],
    observations = [1],
    initialstate = Deterministic([1]),
    discount = 0.95,
    transition = (s, a) -> Deterministic([1]),
    observation = (s, a, sp) -> Deterministic([1]),
    reward = (s, a) -> 1
)

serialize("test", simple_mdp)
deserialize("test")  # okay
deserialize("test")  # okay

# spin up a new julia REPL
deserialize("test")  # okay
deserialize("test")  # ERROR: invalid redefinition of constant ##377
zsunberg commented 1 year ago

Thanks for reporting. I never thought about this, but yeah, QuickPOMDPs seem like a nightmare for serialization.

I hope this is not a problem for distributed computing.

rejuvyesh commented 1 year ago

I'm not sure this counts as bug necessarily? This is more in the territory of issues w.r.t StaticCompilation.jl and maybe how Julia handles external linkages for example?