Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Generate moves for powerful pieces first

This seems to reduce searched nodes by a
surprising 2.5%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
  • Loading branch information...
commit 8a0dd93c56f63de467190145116ed6c5cfd54bc1 1 parent 5a72ff1
@mcostalba authored
Showing with 5 additions and 5 deletions.
  1. +5 −4 src/movegen.cpp
  2. +0 −1  src/movepick.cpp
View
9 src/movegen.cpp
@@ -122,15 +122,16 @@ int generate_captures(const Position& pos, MoveStack* mlist) {
Bitboard target = pos.pieces_of_color(opposite_color(us));
MoveStack* mlist_start = mlist;
+ mlist = generate_piece_moves<QUEEN>(pos, mlist, us, target);
+ mlist = generate_piece_moves<ROOK>(pos, mlist, us, target);
+ mlist = generate_piece_moves<BISHOP>(pos, mlist, us, target);
+ mlist = generate_piece_moves<KNIGHT>(pos, mlist, us, target);
+
if (us == WHITE)
mlist = generate_pawn_captures<WHITE>(pos, mlist);
else
mlist = generate_pawn_captures<BLACK>(pos, mlist);
- mlist = generate_piece_moves<KNIGHT>(pos, mlist, us, target);
- mlist = generate_piece_moves<BISHOP>(pos, mlist, us, target);
- mlist = generate_piece_moves<ROOK>(pos, mlist, us, target);
- mlist = generate_piece_moves<QUEEN>(pos, mlist, us, target);
mlist = generate_piece_moves<KING>(pos, mlist, us, target);
return int(mlist - mlist_start);
}
View
1  src/movepick.cpp
@@ -292,7 +292,6 @@ void MovePicker::score_evasions() {
} else
moves[i].score = H.move_ordering_score(pos.piece_on(move_from(m)), m);
}
- // FIXME try psqt also here
}
void MovePicker::score_qcaptures() {
Please sign in to comment.
Something went wrong with that request. Please try again.