mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Provide more info on found TB files
now uses the following format: `info string Found 510 WDL and 510 DTZ tablebase files (up to 6-man).` this clarifies exactly what has been found, as the difference matters, e.g. for the PV extension of TB scores. closes https://github.com/official-stockfish/Stockfish/pull/5471 No functional change
This commit is contained in:
parent
7e72b37e4c
commit
6135a0e2f8
1 changed files with 22 additions and 4 deletions
|
@ -443,6 +443,8 @@ class TBTables {
|
|||
|
||||
std::deque<TBTable<WDL>> wdlTable;
|
||||
std::deque<TBTable<DTZ>> dtzTable;
|
||||
size_t foundDTZFiles = 0;
|
||||
size_t foundWDLFiles = 0;
|
||||
|
||||
void insert(Key key, TBTable<WDL>* wdl, TBTable<DTZ>* dtz) {
|
||||
uint32_t homeBucket = uint32_t(key) & (Size - 1);
|
||||
|
@ -486,8 +488,15 @@ class TBTables {
|
|||
memset(hashTable, 0, sizeof(hashTable));
|
||||
wdlTable.clear();
|
||||
dtzTable.clear();
|
||||
foundDTZFiles = 0;
|
||||
foundWDLFiles = 0;
|
||||
}
|
||||
size_t size() const { return wdlTable.size(); }
|
||||
|
||||
void info() const {
|
||||
sync_cout << "info string Found " << foundWDLFiles << " WDL and " << foundDTZFiles
|
||||
<< " DTZ tablebase files (up to " << MaxCardinality << "-man)." << sync_endl;
|
||||
}
|
||||
|
||||
void add(const std::vector<PieceType>& pieces);
|
||||
};
|
||||
|
||||
|
@ -501,13 +510,22 @@ void TBTables::add(const std::vector<PieceType>& pieces) {
|
|||
|
||||
for (PieceType pt : pieces)
|
||||
code += PieceToChar[pt];
|
||||
code.insert(code.find('K', 1), "v");
|
||||
|
||||
TBFile file(code.insert(code.find('K', 1), "v") + ".rtbw"); // KRK -> KRvK
|
||||
TBFile file_dtz(code + ".rtbz"); // KRK -> KRvK
|
||||
if (file_dtz.is_open())
|
||||
{
|
||||
file_dtz.close();
|
||||
foundDTZFiles++;
|
||||
}
|
||||
|
||||
TBFile file(code + ".rtbw"); // KRK -> KRvK
|
||||
|
||||
if (!file.is_open()) // Only WDL file is checked
|
||||
return;
|
||||
|
||||
file.close();
|
||||
foundWDLFiles++;
|
||||
|
||||
MaxCardinality = std::max(int(pieces.size()), MaxCardinality);
|
||||
|
||||
|
@ -1466,7 +1484,7 @@ void Tablebases::init(const std::string& paths) {
|
|||
}
|
||||
}
|
||||
|
||||
sync_cout << "info string Found " << TBTables.size() << " tablebases" << sync_endl;
|
||||
TBTables.info();
|
||||
}
|
||||
|
||||
// Probe the WDL table for a particular position.
|
||||
|
|
Loading…
Add table
Reference in a new issue