Skip to content

Commit

Permalink
Use gain table to order non-captures
Browse files Browse the repository at this point in the history
Gain value is multiplied by 16 to be of comparable magnitudo
of negative history, on average.

This patch shows very good results in tactical tests, but
started very bad in real games, so I have run two test matches.

After 896 games at 1+0
Mod vs Orig +187 =525 -184 +1 ELO

After 999 games at 1+0
Mod vs Orig +223 =590 -186 +13 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
  • Loading branch information
mcostalba committed Feb 7, 2010
1 parent 9429d2d commit 2e70a28
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/movepick.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -213,14 +213,22 @@ void MovePicker::score_noncaptures() {
Move m; Move m;
Piece piece; Piece piece;
Square from, to; Square from, to;
int hs;


for (MoveStack* cur = moves; cur != lastMove; cur++) for (MoveStack* cur = moves; cur != lastMove; cur++)
{ {
m = cur->move; m = cur->move;
from = move_from(m); from = move_from(m);
to = move_to(m); to = move_to(m);
piece = pos.piece_on(from); piece = pos.piece_on(from);
cur->score = H.move_ordering_score(piece, to); hs = H.move_ordering_score(piece, to);

// Ensure history has always highest priority
if (hs > 0)
hs += 10000;

// Gain table based scoring
cur->score = hs + 16 * H.gain(piece, to);
} }
} }


Expand Down

0 comments on commit 2e70a28

Please sign in to comment.