d->symlen.resize(number<uint16_t, LittleEndian>(data)); data += sizeof(uint16_t);
d->btree = (LR*)data;
- // The comrpession scheme used is "Recursive Pairing", that replaces the most
+ // The compression scheme used is "Recursive Pairing", that replaces the most
// frequent adjacent pair of symbols in the source message by a new symbol,
// reevaluating the frequencies of all of the symbol pairs with respect to
// the extended alphabet, and then repeating the process.
// All of this means that during probing, the engine must look at captures and probe
// their results and must probe the position itself. The "best" result of these
// probes is the correct result for the position.
-// DTZ table don't store values when a following move is a zeroing winning move
+// DTZ tables do not store values when a following move is a zeroing winning move
// (winning capture or winning pawn move). Also DTZ store wrong values for positions
// where the best move is an ep-move (even if losing). So in all these cases set
// the state to ZEROING_BEST_MOVE.
-template<bool CheckZeroingMoves = false>
+template<bool CheckZeroingMoves>
WDLScore search(Position& pos, ProbeState* result) {
WDLScore value, bestValue = WDLLoss;
moveCount++;
pos.do_move(move, st);
- value = -search(pos, result);
+ value = -search<false>(pos, result);
pos.undo_move(move);
if (*result == FAIL)
WDLScore Tablebases::probe_wdl(Position& pos, ProbeState* result) {
*result = OK;
- return search(pos, result);
+ return search<false>(pos, result);
}
// Probe the DTZ table for a particular position.
// otherwise we will get the dtz of the next move sequence. Search the
// position after the move to get the score sign (because even in a
// winning position we could make a losing capture or going for a draw).
- dtz = zeroing ? -dtz_before_zeroing(search(pos, result))
+ dtz = zeroing ? -dtz_before_zeroing(search<false>(pos, result))
: -probe_dtz(pos, result);
// If the move mates, force minDTZ to 1
int r = dtz > 0 ? (dtz + cnt50 <= 99 && !rep ? 1000 : 1000 - (dtz + cnt50))
: dtz < 0 ? (-dtz * 2 + cnt50 < 100 ? -1000 : -1000 + (-dtz + cnt50))
: 0;
- m.TBRank = r;
+ m.tbRank = r;
// Determine the score to be displayed for this move. Assign at least
// 1 cp to cursed wins and let it grow to 49 cp as the positions gets
// closer to a real win.
- m.TBScore = r >= bound ? VALUE_MATE - MAX_PLY - 1
+ m.tbScore = r >= bound ? VALUE_MATE - MAX_PLY - 1
: r > 0 ? Value((std::max( 3, r - 800) * int(PawnValueEg)) / 200)
: r == 0 ? VALUE_DRAW
: r > -bound ? Value((std::min(-3, r + 800) * int(PawnValueEg)) / 200)
if (result == FAIL)
return false;
- m.TBRank = WDL_to_rank[wdl + 2];
+ m.tbRank = WDL_to_rank[wdl + 2];
if (!rule50)
wdl = wdl > WDLDraw ? WDLWin
: wdl < WDLDraw ? WDLLoss : WDLDraw;
- m.TBScore = WDL_to_value[wdl + 2];
+ m.tbScore = WDL_to_value[wdl + 2];
}
return true;