Skip draw by repetition check in qsearch

Cut in half the time spent in pos.draw() that accounts
for a whopping 1% of total time !

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-06-04 11:29:54 +01:00
parent 91407f4f74
commit 3b2bcee0a8
3 changed files with 13 additions and 8 deletions
+3 -3
View File
@@ -763,7 +763,7 @@ namespace {
// Step 2. Check for aborted search and immediate draw
if (( StopRequest
|| pos.is_draw()
|| pos.is_draw<false>()
|| ss->ply > PLY_MAX) && !RootNode)
return VALUE_DRAW;
@@ -1333,7 +1333,7 @@ split_point_start: // At split points actual search starts from here
ss->ply = (ss-1)->ply + 1;
// Check for an instant draw or maximum ply reached
if (ss->ply > PLY_MAX || pos.is_draw())
if (pos.is_draw<true>() || ss->ply > PLY_MAX)
return VALUE_DRAW;
// Decide whether or not to include checks, this fixes also the type of
@@ -2019,7 +2019,7 @@ split_point_start: // At split points actual search starts from here
&& pos.move_is_pl(tte->move())
&& pos.pl_move_is_legal(tte->move(), pos.pinned_pieces(pos.side_to_move()))
&& ply < PLY_MAX
&& (!pos.is_draw() || ply < 2))
&& (!pos.is_draw<false>() || ply < 2))
{
pv[ply] = tte->move();
pos.do_move(pv[ply++], *st++);