POMDPs.jl icon indicating copy to clipboard operation
POMDPs.jl copied to clipboard

Bizarre bug with deserialization of QuickMDP

Open fredcallaway opened this issue 2 years ago • 2 comments

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

fredcallaway avatar Nov 12 '22 02:11 fredcallaway

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.

zsunberg avatar Nov 12 '22 03:11 zsunberg

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?

rejuvyesh avatar Nov 12 '22 18:11 rejuvyesh