-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding game german_whist_foregame #1171
base: master
Are you sure you want to change the base?
Adding game german_whist_foregame #1171
Conversation
Lots of changes, currently endgame compiles but does not run which is an issue
All works
removed dependence on bmi2 intrinsics and x86intrin.h
I hadn't added the game name to the pyspiel tests expected games. |
Removed MTD as it slows generation of tablebase. Removed move ordering heuristics from legalactions as it slows tablebase generation. Hacky move ordering heuristics remain for speeding up verification. Tablebase generation is 50% faster
Modified bzhi bithack so it will compile to bzhi when __bmi2__ is defined. Modified pext bithack so it will call _pext_u64 when __bmi2__ is defined, otherwise it will use the bithack. LoadTTable now warns on failing to load and sets TTable to default value(all 0)
@lanctot Should I remove ismcts_gwhist from the PR? |
No it's ok, you can leave it. Good to have an example and it's in the right place. |
I don't know what is going on but the tests keep failing repeatedly after your last commit. Can you pull changes from master and push the merge commit? (maybe make an inconsequential change to one of your files if necessary to trigger the tests) Apologies on the lateness in looking at this, I will take a look as soon as the tests pass. |
|
||
inline const std::array<uint64_t, 4> kSuitMasks = { bzhi_u64(~0,kNumRanks),bzhi_u64(~0,2 * kNumRanks) ^ bzhi_u64(~0,kNumRanks),bzhi_u64(~0,3 * kNumRanks) ^ bzhi_u64(~0,2 * kNumRanks),bzhi_u64(~0,4 * kNumRanks) ^ bzhi_u64(~0,3 * kNumRanks) }; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some high-level comments to these structures and methods, just generally to explain what they are used for and what they do?
void SetChar(size_t i,size_t j,char value); | ||
char Get(size_t i,size_t j) const; | ||
void Set(size_t i,size_t j,char value); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe take a quick look at Google C++ style. Each line should be at most 80 characters. There are automated linters you can use (see the docs for adding a game, step 9)
Also should be blank lines between definitions of classes and functions (see the other game implementations for examples)
to pass api_test
My apologies for the delay in getting back to you, I have issues getting the python tests to run on my device due to some issues with absl. |
Added playthrough with incorrect tablebase value. Checks for InfoStateString and ObservationString
6727aee
to
a705df1
Compare
Sorry for taking so long to address some of the issues. **Traceback (most recent call last): ======================================================================
|
91dbb2b
to
4cd3016
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @willmcgowan, sorry but I missed a few things that are critical. I had started the import but the changes required are non-trivial. Apologies for the delay.
// Whist | ||
|
||
#include <cassert> | ||
#include <thread> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not realize you were using threads. This is not an approved header. Can you remove the dependence on threading in this implementation? From what I can tell this is only used for the end game solver? We have something similar in Bridge but it's not threaded.
|
||
#include "open_spiel/games/german_whist_foregame/german_whist_foregame.h" | ||
|
||
#include <filesystem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly this is not an approved header. Could you use the utilities library here? I assume that should have everything you need.
German Whist is a 2 player imperfect information trick-taking card game. The rules are outlined here https://en.wikipedia.org/wiki/German_whist#:~:text=German%20whist%20is%20a%20variant,is%20probably%20of%20British%20origin.
Modified from previous pull request, no longer requires x86intrin.h or bmi2 support.