mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Some renaming in MovePicker
No functional change.
This commit is contained in:
parent
71dd8a333f
commit
f73bb438aa
2 changed files with 12 additions and 12 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
enum Sequencer {
|
enum Stages {
|
||||||
MAIN_SEARCH, CAPTURES_S1, KILLERS_S1, QUIETS_1_S1, QUIETS_2_S1, BAD_CAPTURES_S1,
|
MAIN_SEARCH, CAPTURES_S1, KILLERS_S1, QUIETS_1_S1, QUIETS_2_S1, BAD_CAPTURES_S1,
|
||||||
EVASION, EVASIONS_S2,
|
EVASION, EVASIONS_S2,
|
||||||
QSEARCH_0, CAPTURES_S3, QUIET_CHECKS_S3,
|
QSEARCH_0, CAPTURES_S3, QUIET_CHECKS_S3,
|
||||||
|
@ -82,11 +82,11 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const HistoryStats&
|
||||||
ss = s;
|
ss = s;
|
||||||
|
|
||||||
if (p.checkers())
|
if (p.checkers())
|
||||||
phase = EVASION;
|
stage = EVASION;
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
phase = MAIN_SEARCH;
|
stage = MAIN_SEARCH;
|
||||||
|
|
||||||
// Consider sligtly negative captures as good if at low depth and far from beta
|
// Consider sligtly negative captures as good if at low depth and far from beta
|
||||||
if (ss->staticEval < beta - PawnValueMg && d < 3 * ONE_PLY)
|
if (ss->staticEval < beta - PawnValueMg && d < 3 * ONE_PLY)
|
||||||
|
@ -107,14 +107,14 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const HistoryStats&
|
||||||
assert(d <= DEPTH_ZERO);
|
assert(d <= DEPTH_ZERO);
|
||||||
|
|
||||||
if (p.checkers())
|
if (p.checkers())
|
||||||
phase = EVASION;
|
stage = EVASION;
|
||||||
|
|
||||||
else if (d > DEPTH_QS_NO_CHECKS)
|
else if (d > DEPTH_QS_NO_CHECKS)
|
||||||
phase = QSEARCH_0;
|
stage = QSEARCH_0;
|
||||||
|
|
||||||
else if (d > DEPTH_QS_RECAPTURES)
|
else if (d > DEPTH_QS_RECAPTURES)
|
||||||
{
|
{
|
||||||
phase = QSEARCH_1;
|
stage = QSEARCH_1;
|
||||||
|
|
||||||
// Skip TT move if is not a capture or a promotion, this avoids qsearch
|
// Skip TT move if is not a capture or a promotion, this avoids qsearch
|
||||||
// tree explosion due to a possible perpetual check or similar rare cases
|
// tree explosion due to a possible perpetual check or similar rare cases
|
||||||
|
@ -124,7 +124,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const HistoryStats&
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
phase = RECAPTURE;
|
stage = RECAPTURE;
|
||||||
recaptureSquare = sq;
|
recaptureSquare = sq;
|
||||||
ttm = MOVE_NONE;
|
ttm = MOVE_NONE;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, const HistoryStats& h, Piece
|
||||||
|
|
||||||
assert(!pos.checkers());
|
assert(!pos.checkers());
|
||||||
|
|
||||||
phase = PROBCUT;
|
stage = PROBCUT;
|
||||||
|
|
||||||
// In ProbCut we generate only captures better than parent's captured piece
|
// In ProbCut we generate only captures better than parent's captured piece
|
||||||
captureThreshold = PieceValue[MG][pt];
|
captureThreshold = PieceValue[MG][pt];
|
||||||
|
@ -226,7 +226,7 @@ void MovePicker::generate_next() {
|
||||||
|
|
||||||
cur = moves;
|
cur = moves;
|
||||||
|
|
||||||
switch (++phase) {
|
switch (++stage) {
|
||||||
|
|
||||||
case CAPTURES_S1: case CAPTURES_S3: case CAPTURES_S4: case CAPTURES_S5: case CAPTURES_S6:
|
case CAPTURES_S1: case CAPTURES_S3: case CAPTURES_S4: case CAPTURES_S5: case CAPTURES_S6:
|
||||||
end = generate<CAPTURES>(pos, moves);
|
end = generate<CAPTURES>(pos, moves);
|
||||||
|
@ -282,7 +282,7 @@ void MovePicker::generate_next() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT: case RECAPTURE:
|
case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT: case RECAPTURE:
|
||||||
phase = STOP;
|
stage = STOP;
|
||||||
case STOP:
|
case STOP:
|
||||||
end = cur + 1; // Avoid another next_phase() call
|
end = cur + 1; // Avoid another next_phase() call
|
||||||
return;
|
return;
|
||||||
|
@ -307,7 +307,7 @@ Move MovePicker::next_move<false>() {
|
||||||
while (cur == end)
|
while (cur == end)
|
||||||
generate_next();
|
generate_next();
|
||||||
|
|
||||||
switch (phase) {
|
switch (stage) {
|
||||||
|
|
||||||
case MAIN_SEARCH: case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT:
|
case MAIN_SEARCH: case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT:
|
||||||
cur++;
|
cur++;
|
||||||
|
|
|
@ -102,7 +102,7 @@ private:
|
||||||
Move ttMove;
|
Move ttMove;
|
||||||
ExtMove killers[4];
|
ExtMove killers[4];
|
||||||
Square recaptureSquare;
|
Square recaptureSquare;
|
||||||
int captureThreshold, phase;
|
int captureThreshold, stage;
|
||||||
ExtMove *cur, *end, *endQuiets, *endBadCaptures;
|
ExtMove *cur, *end, *endQuiets, *endBadCaptures;
|
||||||
ExtMove moves[MAX_MOVES];
|
ExtMove moves[MAX_MOVES];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue