No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) const {
Key key = pos.get_material_key();
- MaterialInfo* mi = find(key);
+ MaterialInfo* mi = probe(key);
// If mi->key matches the position's material hash key, it means that we
// have analysed this material configuration before, and we can simply
assert(pos.is_ok());
Key key = pos.get_pawn_key();
- PawnInfo* pi = find(key);
+ PawnInfo* pi = probe(key);
// If pi->key matches the position's pawn hash key, it means that we
// have analysed this pawn structure before, and we can simply return
excludedMove = ss->excludedMove;
posKey = excludedMove ? pos.get_exclusion_key() : pos.get_key();
- tte = TT.retrieve(posKey);
+ tte = TT.probe(posKey);
ttMove = tte ? tte->move() : MOVE_NONE;
// At PV nodes we check for exact scores, while at non-PV nodes we check for
ss->skipNullMove = false;
ttMove = ss->bestMove;
- tte = TT.retrieve(posKey);
+ tte = TT.probe(posKey);
}
split_point_start: // At split points actual search starts from here
// Transposition table lookup. At PV nodes, we don't use the TT for
// pruning, but only for move ordering.
- tte = TT.retrieve(pos.get_key());
+ tte = TT.probe(pos.get_key());
ttMove = (tte ? tte->move() : MOVE_NONE);
if (!PvNode && tte && ok_to_use_TT(tte, ttDepth, beta, ss->ply))
pos.do_move(pv[0], *st++);
- while ( (tte = TT.retrieve(pos.get_key())) != NULL
+ while ( (tte = TT.probe(pos.get_key())) != NULL
&& tte->move() != MOVE_NONE
&& pos.move_is_legal(tte->move())
&& ply < PLY_MAX
do {
k = pos.get_key();
- tte = TT.retrieve(k);
+ tte = TT.probe(k);
// Don't overwrite existing correct entries
if (!tte || tte->move() != pv[ply])
}
-/// TranspositionTable::retrieve() looks up the current position in the
+/// TranspositionTable::probe() looks up the current position in the
/// transposition table. Returns a pointer to the TTEntry or NULL if
/// position is not found.
-TTEntry* TranspositionTable::retrieve(const Key posKey) const {
+TTEntry* TranspositionTable::probe(const Key posKey) const {
uint32_t posKey32 = posKey >> 32;
TTEntry* tte = first_entry(posKey);
void set_size(size_t mbSize);
void clear();
void store(const Key posKey, Value v, ValueType type, Depth d, Move m, Value statV, Value kingD);
- TTEntry* retrieve(const Key posKey) const;
+ TTEntry* probe(const Key posKey) const;
void new_search();
TTEntry* first_entry(const Key posKey) const;
void refresh(const TTEntry* tte) const;
virtual ~SimpleHash() { delete [] entries; }
- Entry* find(Key key) const { return entries + ((uint32_t)key & (HashSize - 1)); }
- void prefetch(Key key) const { ::prefetch((char*)find(key)); }
+ Entry* probe(Key key) const { return entries + ((uint32_t)key & (HashSize - 1)); }
+ void prefetch(Key key) const { ::prefetch((char*)probe(key)); }
protected:
Entry* entries;
string token;
SearchLimits limits;
- Move searchMoves[MAX_MOVES] = { MOVE_NONE };
- Move* cur = searchMoves;
+ Move searchMoves[MAX_MOVES], *cur = searchMoves;
int time[] = { 0, 0 }, inc[] = { 0, 0 };
while (up >> token)
else if (token == "movetime")
up >> limits.maxTime;
else if (token == "searchmoves")
- {
while (up >> token)
*cur++ = move_from_uci(pos, token);
-
- *cur = MOVE_NONE;
- }
}
- assert(pos.is_ok());
-
+ *cur = MOVE_NONE;
limits.time = time[pos.side_to_move()];
limits.increment = inc[pos.side_to_move()];
+ assert(pos.is_ok());
+
return think(pos, limits, searchMoves);
}