summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
181d34e)
In this case we call evaluate() being in check and this
is not allowed.
Bug found testing with reduced PLY_MAX value as suggested
by Miguel A. Ballicora on talkchess.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
assert(pos.is_ok());
assert(threadID >= 0 && threadID < THREAD_MAX);
assert(pos.is_ok());
assert(threadID >= 0 && threadID < THREAD_MAX);
+ assert(!pos.is_check());
memset(&ei, 0, sizeof(EvalInfo));
memset(&ei, 0, sizeof(EvalInfo));
EvalInfo ei;
if (ply >= PLY_MAX - 1)
EvalInfo ei;
if (ply >= PLY_MAX - 1)
- return evaluate(pos, ei, threadID);
+ return pos.is_check() ? quick_evaluate(pos) : evaluate(pos, ei, threadID);
// Mate distance pruning
Value oldAlpha = alpha;
// Mate distance pruning
Value oldAlpha = alpha;
EvalInfo ei;
if (ply >= PLY_MAX - 1)
EvalInfo ei;
if (ply >= PLY_MAX - 1)
- return evaluate(pos, ei, threadID);
+ return pos.is_check() ? quick_evaluate(pos) : evaluate(pos, ei, threadID);
// Mate distance pruning
if (value_mated_in(ply) >= beta)
// Mate distance pruning
if (value_mated_in(ply) >= beta)
else
staticValue = evaluate(pos, ei, threadID);
else
staticValue = evaluate(pos, ei, threadID);
- if (ply == PLY_MAX - 1)
- return evaluate(pos, ei, threadID);
+ if (ply >= PLY_MAX - 1)
+ return pos.is_check() ? quick_evaluate(pos) : evaluate(pos, ei, threadID);
// Initialize "stand pat score", and return it immediately if it is
// at least beta.
// Initialize "stand pat score", and return it immediately if it is
// at least beta.