namespace {
- enum Sequencer {
+ enum Stages {
MAIN_SEARCH, CAPTURES_S1, KILLERS_S1, QUIETS_1_S1, QUIETS_2_S1, BAD_CAPTURES_S1,
EVASION, EVASIONS_S2,
QSEARCH_0, CAPTURES_S3, QUIET_CHECKS_S3,
ss = s;
if (p.checkers())
- phase = EVASION;
+ stage = EVASION;
else
{
- phase = MAIN_SEARCH;
+ stage = MAIN_SEARCH;
// Consider sligtly negative captures as good if at low depth and far from beta
if (ss->staticEval < beta - PawnValueMg && d < 3 * ONE_PLY)
assert(d <= DEPTH_ZERO);
if (p.checkers())
- phase = EVASION;
+ stage = EVASION;
else if (d > DEPTH_QS_NO_CHECKS)
- phase = QSEARCH_0;
+ stage = QSEARCH_0;
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
// tree explosion due to a possible perpetual check or similar rare cases
}
else
{
- phase = RECAPTURE;
+ stage = RECAPTURE;
recaptureSquare = sq;
ttm = MOVE_NONE;
}
assert(!pos.checkers());
- phase = PROBCUT;
+ stage = PROBCUT;
// In ProbCut we generate only captures better than parent's captured piece
captureThreshold = PieceValue[MG][pt];
cur = moves;
- switch (++phase) {
+ switch (++stage) {
case CAPTURES_S1: case CAPTURES_S3: case CAPTURES_S4: case CAPTURES_S5: case CAPTURES_S6:
end = generate<CAPTURES>(pos, moves);
return;
case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT: case RECAPTURE:
- phase = STOP;
+ stage = STOP;
case STOP:
end = cur + 1; // Avoid another next_phase() call
return;
while (cur == end)
generate_next();
- switch (phase) {
+ switch (stage) {
case MAIN_SEARCH: case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT:
cur++;