mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Combine killer moves
Move the first killer move out of the capture stage, combining treatment of first and second killer move. passed STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 55777 W: 12367 L: 12313 D: 31097 http://tests.stockfishchess.org/tests/view/5a88617e0ebc590297cc8351 Similar to an earlier proposition of Günther Demetz, see pull request #1075. I think it is more robust and readable than master, why hand-unroll the loop over the killer array, and duplicate code ? This version includes review comments from Marco Costalba. Bench: 5227124
This commit is contained in:
parent
2ec36f8ae8
commit
ebb3e7df65
1 changed files with 12 additions and 16 deletions
|
@ -25,7 +25,7 @@
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
enum Stages {
|
enum Stages {
|
||||||
MAIN_SEARCH, CAPTURES_INIT, GOOD_CAPTURES, KILLERS, COUNTERMOVE, QUIET_INIT, QUIET, BAD_CAPTURES,
|
MAIN_SEARCH, CAPTURES_INIT, GOOD_CAPTURES, KILLER0, KILLER1, COUNTERMOVE, QUIET_INIT, QUIET, BAD_CAPTURES,
|
||||||
EVASION, EVASIONS_INIT, ALL_EVASIONS,
|
EVASION, EVASIONS_INIT, ALL_EVASIONS,
|
||||||
PROBCUT, PROBCUT_CAPTURES_INIT, PROBCUT_CAPTURES,
|
PROBCUT, PROBCUT_CAPTURES_INIT, PROBCUT_CAPTURES,
|
||||||
QSEARCH, QCAPTURES_INIT, QCAPTURES, QCHECKS, QSEARCH_RECAPTURES, QRECAPTURES
|
QSEARCH, QCAPTURES_INIT, QCAPTURES, QCHECKS, QSEARCH_RECAPTURES, QRECAPTURES
|
||||||
|
@ -185,24 +185,20 @@ Move MovePicker::next_move(bool skipQuiets) {
|
||||||
*endBadCaptures++ = move;
|
*endBadCaptures++ = move;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
++stage;
|
++stage;
|
||||||
move = killers[0]; // First killer move
|
|
||||||
if ( move != MOVE_NONE
|
|
||||||
&& move != ttMove
|
|
||||||
&& pos.pseudo_legal(move)
|
|
||||||
&& !pos.capture(move))
|
|
||||||
return move;
|
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
|
||||||
case KILLERS:
|
case KILLER0:
|
||||||
++stage;
|
case KILLER1:
|
||||||
move = killers[1]; // Second killer move
|
do
|
||||||
if ( move != MOVE_NONE
|
{
|
||||||
&& move != ttMove
|
move = killers[++stage - KILLER1];
|
||||||
&& pos.pseudo_legal(move)
|
if ( move != MOVE_NONE
|
||||||
&& !pos.capture(move))
|
&& move != ttMove
|
||||||
return move;
|
&& pos.pseudo_legal(move)
|
||||||
|
&& !pos.capture(move))
|
||||||
|
return move;
|
||||||
|
} while (stage <= KILLER1);
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
|
||||||
case COUNTERMOVE:
|
case COUNTERMOVE:
|
||||||
|
|
Loading…
Add table
Reference in a new issue