mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Use Movepick SEE value in search
This halves the calls to the costly pos.see_sign(), speed up is about 1-1.3% Non functional change.
This commit is contained in:
parent
d909d10f33
commit
602d7fbb07
3 changed files with 8 additions and 1 deletions
|
@ -243,6 +243,11 @@ void MovePicker::generate_next_stage() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MovePicker::see_sign() const
|
||||||
|
{
|
||||||
|
return stage == GOOD_CAPTURES ? 1
|
||||||
|
: stage == BAD_CAPTURES ? -1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
/// next_move() is the most important method of the MovePicker class. It returns
|
/// next_move() is the most important method of the MovePicker class. It returns
|
||||||
/// a new pseudo legal move every time it is called, until there are no more moves
|
/// a new pseudo legal move every time it is called, until there are no more moves
|
||||||
|
|
|
@ -104,6 +104,7 @@ public:
|
||||||
MovePicker(const Position&, Move, Depth, Search::Stack*);
|
MovePicker(const Position&, Move, Depth, Search::Stack*);
|
||||||
|
|
||||||
Move next_move();
|
Move next_move();
|
||||||
|
int see_sign() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<GenType> void score();
|
template<GenType> void score();
|
||||||
|
|
|
@ -958,7 +958,8 @@ moves_loop: // When in check search starts from here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( depth < 3 * ONE_PLY
|
else if ( depth < 3 * ONE_PLY
|
||||||
&& pos.see_sign(move) < VALUE_ZERO)
|
&& ( mp.see_sign() < 0
|
||||||
|
|| (!mp.see_sign() && pos.see_sign(move) < VALUE_ZERO)))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue