Skip to content

Conversation

@rahulsavani
Copy link
Member

resolves #606

@rahulsavani rahulsavani requested a review from tturocy November 12, 2025 19:40
@rahulsavani
Copy link
Member Author

poker.efg is still used in the user guide. I left it in tests/test_games, but now realise that for the user guide it likely reads it from contrib/games. We then may want to delete poker.efg from tests/test_games.

Copy link
Member

@tturocy tturocy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have just one version of this game. It is at the moment awkward that we have games in tests/test_games and in contrib/games. But we will need to sort that out later, and I expect it will gradually come out in the was as we build out tests for algorithms and solution concepts.

We should decide which version we want to have, because there are several issues here:

  • We want a version that uses rational fractions rather than decimal representation. The decimal representation version would be very old (when "floating point" payoffs were permitted). We want to encourage the use of rational payoffs where it makes sense to do so.

  • I believe Myerson (1991) likely gets priority on this game as written, I do not have an earlier citation and there is none in his textbook. However two issues to consider:

    • Myerson treats Red (high card) followed by Fold as a win for the informed player. This is consistent with the narrative exposition in the book, but is not consistent with how "poker" works. Alternatively, the version of this game used in Reiley's classroom experiment follows the "normal" rules of poker.
    • Myerson does not actually give the players human names. However the names Fred and Alice are consistent with his textbook, as he uses male pronouns for odd-numbered players and female for even-numbered ones.
  • We also need a name for the game. Calling this 2-card poker is not accurate. In Myerson's description, the deals are "red" and "black" because they're dealt from a standard deck of cards but only the suit colour matters for payoffs. Further, calling it 2-card poker makes it sound more like e.g. Borel or von Neumann's versions, where each player gets a "card" (a draw from the uniform distribution).

Tagging @edwardchalstrey1 because this interacts with the relevant tutorial.

@rahulsavani
Copy link
Member Author

Yes, that all makes sense @tturocy.

Happy to make the required further changes once we agree what we want to do.

Note this is not the only example of duplication between contrib/games and tests/test_games:

cat duplicates.txt
1732067649 429 ./games/poker.efg
1732067649 429 ./test_games/poker.efg
1954241526 939 ./games/2x2.agg
1954241526 939 ./test_games/2x2.agg
2764097499 358 ./games/e01.efg
2764097499 358 ./test_games/e01.efg
3644076083 110 ./games/e02.nfg
3644076083 110 ./test_games/e02.nfg
3794749701 273 ./games/e02.efg
3794749701 273 ./test_games/e02.efg
3831085167 147 ./games/zero.nfg
3831085167 147 ./test_games/zero.nfg
872932573 1542 ./games/cent3.efg
872932573 1542 ./test_games/cent3.efg

@tturocy
Copy link
Member

tturocy commented Nov 13, 2025

Right, that is something we know about. :) But in those cases there's just one version of the file (as far as I know), just kept in two places.

The way out of that would be to have something like a "library of standard games" which could be packaged and imported directly - something we've talked about before, perhaps we need to start thinking about articulating that as a facility and a project to do...

@rahulsavani
Copy link
Member Author

The decimal representation version would be very old (when "floating point" payoffs were permitted)

The myerson_2_card_poker.efg is the one with floating point, and then only for the chance probabilities:

c "" 1 "(0,1)" { "RED" 0.500000 "BLACK" 0.500000 } 1 "Outcome 3" { -1, 1 }

I have just checked and all tests (on this branch) still pass with this changed to rational probabilities, i.e.:

c "" 1 "(0,1)" { "RED" 1/2 "BLACK" 1/2 } 1 "Outcome 3" { -1, 1 }

Thus, we just need to decide on game naming/actions labels etc. and I can update myerson_2_card_poker.efg and the tests (only in terms of action labels, and the file name) accordingly.

@edwardchalstrey1
Copy link
Member

Tagging @edwardchalstrey1 because this interacts with the relevant tutorial.

In the tutorial the efg file isn't used as the game is constructed via the code so not to worry

@tturocy
Copy link
Member

tturocy commented Nov 13, 2025

Yes @edwardchalstrey1, but it would be good that the game we build there matches the saved file, just for the avoidance of any confusion!!! :)

@rahulsavani
Copy link
Member Author

@tturocy: The tests now only use stripped_down_poker.efg, which is faithful to Reiley et al in terms of action labels and payoffs. The reuse of action labels ("Fold" and "Bet" in particular) means that a couple of tests were simply dropped, since they relied on the uniqueness of said labels. I don't think that's a problem. I didn't want to drop some other tests that used infoset labels, so I inserted the infoset labels from the old myerson_2_card_poker.efg into stripped_down_poker.efg, which was adapted from poker.efg which had empty infoset labels.

@edwardchalstrey1 : For after this is settled on any merged into the tests:

contrib/games still contains poker.efg, and tests/test_userguide.py still contains test_myerson_poker(). If you could update both of these when you update the user guide that would be great (putting stripped_down_poker.efg in contrib/games, and, assuming we keep test_userguid.py, updating it to create the right game, exactly as in the updated user guide, not mentioning Myerson at all, but Reiley et al (2008).

@rahulsavani rahulsavani requested a review from tturocy November 14, 2025 13:22
@edwardchalstrey1
Copy link
Member

edwardchalstrey1 commented Nov 17, 2025

assuming we keep test_userguide.py

@rahulsavani I actually dropped this test and replaced it with a new one that checks all tutorials can be run without error, which doesn't need to be updated when any new tutorials are added or existing ones changed, looks like Reiley et al (2008) is cited correctly as well Edit: actually it mentions them both, so should I drop the Myerson citation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TEST: Duplicated game (simple poker) in test suite

4 participants