mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Order bad captures by MVV/LVA
Instead of by SEE. Almost no ELO change but it is a bit easier and is a more natural choice given that good captures are ordered in the same way. After 10424 games Mod vs Orig 1639 - 1604 - 7181 ELO +1 (+-3.8) Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
830ff985db
commit
24b25b4827
2 changed files with 8 additions and 12 deletions
|
@ -64,7 +64,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h,
|
||||||
|
|
||||||
captureThreshold = 0;
|
captureThreshold = 0;
|
||||||
curMove = lastMove = moves;
|
curMove = lastMove = moves;
|
||||||
badCaptures = moves + MAX_MOVES;
|
lastBadCapture = moves + MAX_MOVES - 1;
|
||||||
|
|
||||||
if (p.in_check())
|
if (p.in_check())
|
||||||
phase = EVASION;
|
phase = EVASION;
|
||||||
|
@ -242,10 +242,9 @@ void MovePicker::generate_next() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case BAD_CAPTURES_S1:
|
case BAD_CAPTURES_S1:
|
||||||
// Bad captures SEE value is already calculated so just pick them in order
|
// Just pick them in reverse order to get MVV/LVA ordering
|
||||||
// to get SEE move ordering.
|
curMove = moves + MAX_MOVES - 1;
|
||||||
curMove = badCaptures;
|
lastMove = lastBadCapture;
|
||||||
lastMove = moves + MAX_MOVES;
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case EVASIONS_S2:
|
case EVASIONS_S2:
|
||||||
|
@ -297,13 +296,11 @@ Move MovePicker::next_move() {
|
||||||
{
|
{
|
||||||
assert(captureThreshold <= 0); // Otherwise we cannot use see_sign()
|
assert(captureThreshold <= 0); // Otherwise we cannot use see_sign()
|
||||||
|
|
||||||
int seeScore = pos.see_sign(move);
|
if (pos.see_sign(move) >= captureThreshold)
|
||||||
if (seeScore >= captureThreshold)
|
|
||||||
return move;
|
return move;
|
||||||
|
|
||||||
// Losing capture, move it to the tail of the array
|
// Losing capture, move it to the tail of the array
|
||||||
(--badCaptures)->move = move;
|
(lastBadCapture--)->move = move;
|
||||||
badCaptures->score = seeScore;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -325,8 +322,7 @@ Move MovePicker::next_move() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BAD_CAPTURES_S1:
|
case BAD_CAPTURES_S1:
|
||||||
move = pick_best(curMove++, lastMove)->move;
|
return (curMove--)->move;
|
||||||
return move;
|
|
||||||
|
|
||||||
case EVASIONS_S2: case CAPTURES_S3: case CAPTURES_S4:
|
case EVASIONS_S2: case CAPTURES_S3: case CAPTURES_S4:
|
||||||
move = pick_best(curMove++, lastMove)->move;
|
move = pick_best(curMove++, lastMove)->move;
|
||||||
|
|
|
@ -56,7 +56,7 @@ private:
|
||||||
MoveStack killers[2];
|
MoveStack killers[2];
|
||||||
Square recaptureSquare;
|
Square recaptureSquare;
|
||||||
int captureThreshold, phase;
|
int captureThreshold, phase;
|
||||||
MoveStack *curMove, *lastMove, *lastQuiet, *badCaptures;
|
MoveStack *curMove, *lastMove, *lastQuiet, *lastBadCapture;
|
||||||
MoveStack moves[MAX_MOVES];
|
MoveStack moves[MAX_MOVES];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue