1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 17:49:35 +00:00

Restore calling insert_pv after search is aborted + small clean-up

Restore old behaviour that after search is aborted we call insert_pv,
before breaking out from the iterative deepening loop.

Remove one useless FIXME and document other better.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2009-04-15 18:14:06 +03:00 committed by Marco Costalba
parent ecec7dbf89
commit 7af1b40b4e

View file

@ -712,13 +712,14 @@ namespace {
// Search to the current depth // Search to the current depth
Value value = root_search(p, ss, rml, alpha, beta); Value value = root_search(p, ss, rml, alpha, beta);
if (AbortSearch)
break; // Value cannot be trusted. Break out immediately!
// Write PV to transposition table, in case the relevant entries have // Write PV to transposition table, in case the relevant entries have
// been overwritten during the search. // been overwritten during the search.
TT.insert_pv(p, ss[0].pv); TT.insert_pv(p, ss[0].pv);
if (AbortSearch)
break; // Value cannot be trusted. Break out immediately!
//Save info about search result //Save info about search result
Value speculatedValue; Value speculatedValue;
bool fHigh = false; bool fHigh = false;
@ -857,7 +858,6 @@ namespace {
Value root_search(Position &pos, SearchStack ss[], RootMoveList &rml, Value alpha, Value beta) { Value root_search(Position &pos, SearchStack ss[], RootMoveList &rml, Value alpha, Value beta) {
//FIXME: Implement bestValue
Value oldAlpha = alpha; Value oldAlpha = alpha;
Value value; Value value;
Bitboard dcCandidates = pos.discovered_check_candidates(pos.side_to_move()); Bitboard dcCandidates = pos.discovered_check_candidates(pos.side_to_move());
@ -2507,7 +2507,7 @@ namespace {
return; return;
bool overTime = t > AbsoluteMaxSearchTime bool overTime = t > AbsoluteMaxSearchTime
|| (RootMoveNumber == 1 && t > MaxSearchTime + ExtraSearchTime && !FailLow) //FIXME: BUG?? || (RootMoveNumber == 1 && t > MaxSearchTime + ExtraSearchTime && !FailLow) //FIXME: We are not checking any problem flags, BUG?
|| ( !FailHigh && !FailLow && !fail_high_ply_1() && !Problem || ( !FailHigh && !FailLow && !fail_high_ply_1() && !Problem
&& t > 6*(MaxSearchTime + ExtraSearchTime)); && t > 6*(MaxSearchTime + ExtraSearchTime));