This let us get rid of number_of_evasions()
After 5487 games
Mod- Orig: 851 - 852 - 3784 +0 ELO (+- 3.7)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
MovePicker(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value beta);
MovePicker(const Position& p, Move ttm, Depth d, const History& h);
Move get_next_move();
MovePicker(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value beta);
MovePicker(const Position& p, Move ttm, Depth d, const History& h);
Move get_next_move();
- int number_of_evasions() const;
private:
void score_captures();
private:
void score_captures();
MoveStack moves[MOVES_MAX];
};
MoveStack moves[MOVES_MAX];
};
-
-/// MovePicker::number_of_evasions() simply returns the number of moves in
-/// evasions phase. It is intended to be used in positions where the side to
-/// move is in check, for detecting checkmates or situations where there is
-/// only a single reply to check.
-/// WARNING: It works as long as PH_EVASIONS is the _only_ phase for evasions.
-
-inline int MovePicker::number_of_evasions() const {
- return int(lastMove - moves);
-}
-
#endif // !defined(MOVEPICK_H_INCLUDED)
#endif // !defined(MOVEPICK_H_INCLUDED)
// Extensions. Configurable UCI options
// Array index 0 is used at non-PV nodes, index 1 at PV nodes.
// Extensions. Configurable UCI options
// Array index 0 is used at non-PV nodes, index 1 at PV nodes.
- Depth CheckExtension[2], SingleEvasionExtension[2], PawnPushTo7thExtension[2];
- Depth PassedPawnExtension[2], PawnEndgameExtension[2], MateThreatExtension[2];
+ Depth CheckExtension[2], PawnPushTo7thExtension[2], PassedPawnExtension[2];
+ Depth PawnEndgameExtension[2], MateThreatExtension[2];
// Minimum depth for use of singular extension
const Depth SingularExtensionDepth[2] = { 8 * ONE_PLY /* non-PV */, 6 * ONE_PLY /* PV */};
// Minimum depth for use of singular extension
const Depth SingularExtensionDepth[2] = { 8 * ONE_PLY /* non-PV */, 6 * ONE_PLY /* PV */};
}
template <NodeType PvNode>
}
template <NodeType PvNode>
- Depth extension(const Position& pos, Move m, bool captureOrPromotion, bool moveIsCheck, bool singleEvasion, bool mateThreat, bool* dangerous);
+ Depth extension(const Position& pos, Move m, bool captureOrPromotion, bool moveIsCheck, bool mateThreat, bool* dangerous);
bool check_is_dangerous(Position &pos, Move move, Value futilityBase, Value beta, Value *bValue);
bool connected_moves(const Position& pos, Move m1, Move m2);
bool check_is_dangerous(Position &pos, Move move, Value futilityBase, Value beta, Value *bValue);
bool connected_moves(const Position& pos, Move m1, Move m2);
return rm != Rml.end() ? rm->pv[0] : MOVE_NONE;
}
return rm != Rml.end() ? rm->pv[0] : MOVE_NONE;
}
- int number_of_evasions() const { return (int)Rml.size(); }
RootMoveList::iterator rm;
bool firstCall;
RootMoveList::iterator rm;
bool firstCall;
CheckExtension[1] = Options["Check Extension (PV nodes)"].value<Depth>();
CheckExtension[0] = Options["Check Extension (non-PV nodes)"].value<Depth>();
CheckExtension[1] = Options["Check Extension (PV nodes)"].value<Depth>();
CheckExtension[0] = Options["Check Extension (non-PV nodes)"].value<Depth>();
- SingleEvasionExtension[1] = Options["Single Evasion Extension (PV nodes)"].value<Depth>();
- SingleEvasionExtension[0] = Options["Single Evasion Extension (non-PV nodes)"].value<Depth>();
PawnPushTo7thExtension[1] = Options["Pawn Push to 7th Extension (PV nodes)"].value<Depth>();
PawnPushTo7thExtension[0] = Options["Pawn Push to 7th Extension (non-PV nodes)"].value<Depth>();
PassedPawnExtension[1] = Options["Passed Pawn Extension (PV nodes)"].value<Depth>();
PawnPushTo7thExtension[1] = Options["Pawn Push to 7th Extension (PV nodes)"].value<Depth>();
PawnPushTo7thExtension[0] = Options["Pawn Push to 7th Extension (non-PV nodes)"].value<Depth>();
PassedPawnExtension[1] = Options["Passed Pawn Extension (PV nodes)"].value<Depth>();
ValueType vt;
Value bestValue, value, oldAlpha;
Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
ValueType vt;
Value bestValue, value, oldAlpha;
Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
- bool isPvMove, isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
+ bool isPvMove, isCheck, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
bool mateThreat = false;
int moveCount = 0, playedMoveCount = 0;
int threadID = pos.thread();
bool mateThreat = false;
int moveCount = 0, playedMoveCount = 0;
int threadID = pos.thread();
MovePickerExt<SpNode, Root> mp(pos, ttMove, depth, H, ss, (PvNode ? -VALUE_INFINITE : beta));
CheckInfo ci(pos);
ss->bestMove = MOVE_NONE;
MovePickerExt<SpNode, Root> mp(pos, ttMove, depth, H, ss, (PvNode ? -VALUE_INFINITE : beta));
CheckInfo ci(pos);
ss->bestMove = MOVE_NONE;
- singleEvasion = !SpNode && isCheck && mp.number_of_evasions() == 1;
futilityBase = ss->eval + ss->evalMargin;
singularExtensionNode = !Root
&& !SpNode
futilityBase = ss->eval + ss->evalMargin;
singularExtensionNode = !Root
&& !SpNode
captureOrPromotion = pos.move_is_capture_or_promotion(move);
// Step 11. Decide the new search depth
captureOrPromotion = pos.move_is_capture_or_promotion(move);
// Step 11. Decide the new search depth
- ext = extension<PvNode>(pos, move, captureOrPromotion, moveIsCheck, singleEvasion, mateThreat, &dangerous);
+ ext = extension<PvNode>(pos, move, captureOrPromotion, moveIsCheck, mateThreat, &dangerous);
// Singular extension search. If all moves but one fail low on a search of (alpha-s, beta-s),
// and just one fails high on (alpha, beta), then that move is singular and should be extended.
// Singular extension search. If all moves but one fail low on a search of (alpha-s, beta-s),
// and just one fails high on (alpha, beta), then that move is singular and should be extended.
// extended, as example because the corresponding UCI option is set to zero,
// the move is marked as 'dangerous' so, at least, we avoid to prune it.
template <NodeType PvNode>
// extended, as example because the corresponding UCI option is set to zero,
// the move is marked as 'dangerous' so, at least, we avoid to prune it.
template <NodeType PvNode>
- Depth extension(const Position& pos, Move m, bool captureOrPromotion, bool moveIsCheck,
- bool singleEvasion, bool mateThreat, bool* dangerous) {
+ Depth extension(const Position& pos, Move m, bool captureOrPromotion,
+ bool moveIsCheck, bool mateThreat, bool* dangerous) {
assert(m != MOVE_NONE);
Depth result = DEPTH_ZERO;
assert(m != MOVE_NONE);
Depth result = DEPTH_ZERO;
- *dangerous = moveIsCheck | singleEvasion | mateThreat;
+ *dangerous = moveIsCheck | mateThreat;
if (*dangerous)
{
if (moveIsCheck && pos.see_sign(m) >= 0)
result += CheckExtension[PvNode];
if (*dangerous)
{
if (moveIsCheck && pos.see_sign(m) >= 0)
result += CheckExtension[PvNode];
- if (singleEvasion)
- result += SingleEvasionExtension[PvNode];
-
if (mateThreat)
result += MateThreatExtension[PvNode];
}
if (mateThreat)
result += MateThreatExtension[PvNode];
}
Options["Cowardice"] = Option(100, 0, 200);
Options["Check Extension (PV nodes)"] = Option(2, 0, 2);
Options["Check Extension (non-PV nodes)"] = Option(1, 0, 2);
Options["Cowardice"] = Option(100, 0, 200);
Options["Check Extension (PV nodes)"] = Option(2, 0, 2);
Options["Check Extension (non-PV nodes)"] = Option(1, 0, 2);
- Options["Single Evasion Extension (PV nodes)"] = Option(2, 0, 2);
- Options["Single Evasion Extension (non-PV nodes)"] = Option(2, 0, 2);
Options["Mate Threat Extension (PV nodes)"] = Option(2, 0, 2);
Options["Mate Threat Extension (non-PV nodes)"] = Option(2, 0, 2);
Options["Pawn Push to 7th Extension (PV nodes)"] = Option(1, 0, 2);
Options["Mate Threat Extension (PV nodes)"] = Option(2, 0, 2);
Options["Mate Threat Extension (non-PV nodes)"] = Option(2, 0, 2);
Options["Pawn Push to 7th Extension (PV nodes)"] = Option(1, 0, 2);