mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
MovePicker: take advantage of threat move for ordering
If the null move was refuted by a capture then give a bonus if we move away the captured piece. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -72,6 +72,7 @@ MovePicker::MovePicker(const Position& p, bool pv, Move ttm,
|
|||||||
mateKiller = (ss.mateKiller == ttm)? MOVE_NONE : ss.mateKiller;
|
mateKiller = (ss.mateKiller == ttm)? MOVE_NONE : ss.mateKiller;
|
||||||
killer1 = ss.killers[0];
|
killer1 = ss.killers[0];
|
||||||
killer2 = ss.killers[1];
|
killer2 = ss.killers[1];
|
||||||
|
threatMove = ss.threatMove;
|
||||||
depth = d;
|
depth = d;
|
||||||
movesPicked = 0;
|
movesPicked = 0;
|
||||||
numOfMoves = 0;
|
numOfMoves = 0;
|
||||||
@@ -270,10 +271,16 @@ void MovePicker::score_noncaptures() {
|
|||||||
else
|
else
|
||||||
hs = H.move_ordering_score(pos.piece_on(move_from(m)), m);
|
hs = H.move_ordering_score(pos.piece_on(move_from(m)), m);
|
||||||
|
|
||||||
// Ensure moves in history are always sorted as first
|
// If the null move was refuted by a capture then give a
|
||||||
|
// bonus if we move away the captured piece.
|
||||||
|
if (threatMove != MOVE_NONE && move_from(m) == move_to(threatMove))
|
||||||
|
hs *= 3;
|
||||||
|
|
||||||
|
// Ensure history is always preferred to pst
|
||||||
if (hs > 0)
|
if (hs > 0)
|
||||||
hs += 1000;
|
hs += 1000;
|
||||||
|
|
||||||
|
// pst based scoring
|
||||||
moves[i].score = hs + pos.mg_pst_delta(m);
|
moves[i].score = hs + pos.mg_pst_delta(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ private:
|
|||||||
int find_best_index(Bitboard* squares, int values[]);
|
int find_best_index(Bitboard* squares, int values[]);
|
||||||
|
|
||||||
const Position& pos;
|
const Position& pos;
|
||||||
Move ttMove, mateKiller, killer1, killer2;
|
Move ttMove, mateKiller, killer1, killer2, threatMove;
|
||||||
Bitboard pinned, dc;
|
Bitboard pinned, dc;
|
||||||
MoveStack moves[256], badCaptures[64];
|
MoveStack moves[256], badCaptures[64];
|
||||||
bool pvNode;
|
bool pvNode;
|
||||||
|
|||||||
Reference in New Issue
Block a user