google-deepmind / open_spiel

OpenSpiel is a collection of environments and algorithms for research in general reinforcement learning and search/planning in games.
Apache License 2.0
4.27k stars 936 forks source link

Oh Hell test seems flaky #396

Closed lanctot closed 4 years ago

lanctot commented 4 years ago

Hi @solinas ,

Seems like the Oh Hell test occasionally has trouble on Travis, printing out a lot of output and then the job fails. Here's an example: https://travis-ci.org/github/deepmind/open_spiel/jobs/733161684 . It fills Travis's output buffer.

I wonder if it's hitting a case where there is a never-ending episode? If we're not using a fixed seed in the test then we should change that, because it seems to be non-deterministic.

Also, if there are sequences that could result in no terminal, maybe we should end the episode after a fixed number of turns? (I'm not saying you didn't do this -- haven't looked at the code)

Any ideas?

gabrfarina commented 4 years ago

I've done a bit of debugging, and turns out InformationStateTensorTest can fail, so I think there's a bug either in the tests or in the implementation. I've pasted the relevant portion of the log below:

Spiel Fatal Error: /home/gfarina/research/open_spiel/open_spiel/games/oh_hell_test.cc:230 infostate_string == rebuilt_infostate_string
infostate_string = Num Total Tricks: 17
Dealer: 0
Num Cards Dealt: 52
Trump: C6
Player: 2
    C: AKT84
    D: JT7432
    S: KT7
    H: J75

Bids:        -1 17 -1
Tricks Won:    0 0 0
, rebuilt_infostate_string = Num Total Tricks: 17
Dealer: 0
Num Cards Dealt: 52
Trump: C6
Player: 2
    C: AKT84
    D: JT7432
    S: KT7
    H: J75

Bids:        -1 0 -1
Tricks Won:    0 0 0
solinas commented 4 years ago

Hi,

@gabrfarina thanks for the info.

I can reproduce it, and it looks like an off-by-one error in the tests rather than the implementation. I should have a fix ready shortly.

lanctot commented 4 years ago

Thanks for the quick fix @solinas , I will import it tonight!

lanctot commented 4 years ago

Seems to be fixed by https://github.com/deepmind/open_spiel/pull/397