From 99e24a5c2414d7388a2363c4ed022bf04ab84582 Mon Sep 17 00:00:00 2001 From: Maurizio Monge Date: Fri, 5 Oct 2007 00:40:12 +0200 Subject: [PATCH] Tuned late move reduction. --- search.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/search.cpp b/search.cpp index 861069d..021e1c9 100644 --- a/search.cpp +++ b/search.cpp @@ -934,9 +934,9 @@ int16_t Engine::search(int ply, int depth, bool pv, int16_t alpha, int16_t beta) // if((sdepth>0) && !s->under_check && depth<=3*PLY && s->moves[i].val<28000 && // (history_hit[HISTORY_INDEX(s->moves[i])]+1)*3 // < (history_tot[HISTORY_INDEX(s->moves[i])]+1)) - if((sdepth>0) && !s->under_check && s->moves[i].val<28000 && i>=7 ) + if((sdepth>0) && !s->under_check && s->moves[i].val<28000 && (i>=7 || (i>=5 && s->moves[i].val<350) ) ) { - val = -search( ply+1, sdepth - 60, false, -alpha-1, -alpha ); + val = -search( ply+1, sdepth - PLY, false, -alpha-1, -alpha ); if(val <= alpha) goto skip_search; /* reduced search was effective */ } @@ -1028,7 +1028,7 @@ search_done: bestmv = board.compress_move(s->moves[best_mv_found]); /* write the value in the hash, with the index of the best move */ - write_hash( best > s->alpha ? MIN(best, beta) : -INF, + write_hash( best > s->alpha ? best : -INF, best < beta ? MAX(best, s->alpha) : +INF, MAX(s->base_depth,-500), bestmv); -- 2.11.4.GIT