Note that some pawns and material info has been switched
to int from int8_t.
This is a waste of space but it is not clear if we have a
faster or slower code (or nothing changed), some test should be
needed.
Few warnings still are alive.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
int i, j, b;
for(i = 0; i < 24576; i++) {
for(b = 0, j = 0; j < 8; b |= (compress_result(Bitbase[8*i+j]) << j), j++);
int i, j, b;
for(i = 0; i < 24576; i++) {
for(b = 0, j = 0; j < 8; b |= (compress_result(Bitbase[8*i+j]) << j), j++);
+ bitbase[i] = (uint8_t)b;
}
// Release allocated memory:
}
// Release allocated memory:
}
for (Bitboard b = 0ULL; b < 256ULL; b++)
}
for (Bitboard b = 0ULL; b < 256ULL; b++)
- BitCount8Bit[b] = count_1s(b);
+ BitCount8Bit[b] = (uint8_t)count_1s(b);
uint8_t factor[2];
EndgameEvaluationFunctionBase* evaluationFunction;
EndgameScalingFunctionBase* scalingFunction[2];
uint8_t factor[2];
EndgameEvaluationFunctionBase* evaluationFunction;
EndgameScalingFunctionBase* scalingFunction[2];
Value Position::compute_non_pawn_material(Color c) const {
Value result = Value(0);
Value Position::compute_non_pawn_material(Color c) const {
Value result = Value(0);
for (PieceType pt = KNIGHT; pt <= QUEEN; pt++)
{
Bitboard b = pieces_of_color_and_type(c, pt);
for (PieceType pt = KNIGHT; pt <= QUEEN; pt++)
{
Bitboard b = pieces_of_color_and_type(c, pt);
- s = pop_1st_bit(&b);
- assert(piece_on(s) == piece_of_color_and_type(c, pt));
+ assert(piece_on(first_1(b)) == piece_of_color_and_type(c, pt));
+ pop_1st_bit(&b);
result += piece_value_midgame(pt);
}
}
result += piece_value_midgame(pt);
}
}
// Iteration counters
int Iteration;
// Iteration counters
int Iteration;
BetaCounterType BetaCounter;
// Scores and number of times the best move changed for each iteration:
BetaCounterType BetaCounter;
// Scores and number of times the best move changed for each iteration:
int SearchStartTime;
int MaxNodes, MaxDepth;
int MaxSearchTime, AbsoluteMaxSearchTime, ExtraSearchTime;
int SearchStartTime;
int MaxNodes, MaxDepth;
int MaxSearchTime, AbsoluteMaxSearchTime, ExtraSearchTime;
- Move BestRootMove, PonderMove, EasyMove;
int RootMoveNumber;
bool InfiniteSearch;
bool PonderSearch;
int RootMoveNumber;
bool InfiniteSearch;
bool PonderSearch;
// Initialize global search variables
Idle = false;
SearchStartTime = get_system_time();
// Initialize global search variables
Idle = false;
SearchStartTime = get_system_time();
- BestRootMove = MOVE_NONE;
- PonderMove = MOVE_NONE;
EasyMove = MOVE_NONE;
for (int i = 0; i < THREAD_MAX; i++)
{
EasyMove = MOVE_NONE;
for (int i = 0; i < THREAD_MAX; i++)
{
ValueByIteration[0] = Value(0);
ValueByIteration[1] = rml.get_move_score(0);
Iteration = 1;
ValueByIteration[0] = Value(0);
ValueByIteration[1] = rml.get_move_score(0);
Iteration = 1;
- LastIterations = false;
EasyMove = rml.scan_for_easy_move();
EasyMove = rml.scan_for_easy_move();
ExtraSearchTime = BestMoveChangesByIteration[Iteration] * (MaxSearchTime / 2)
+ BestMoveChangesByIteration[Iteration-1] * (MaxSearchTime / 3);
ExtraSearchTime = BestMoveChangesByIteration[Iteration] * (MaxSearchTime / 2)
+ BestMoveChangesByIteration[Iteration-1] * (MaxSearchTime / 3);
- // Try to guess if the current iteration is the last one or the last two
- LastIterations = (current_search_time() > ((MaxSearchTime + ExtraSearchTime)*58) / 128);
-
// Stop search if most of MaxSearchTime is consumed at the end of the
// iteration. We probably don't have enough time to search the first
// move at the next iteration anyway.
// Stop search if most of MaxSearchTime is consumed at the end of the
// iteration. We probably don't have enough time to search the first
// move at the next iteration anyway.
TTEntry::TTEntry(Key k, Value v, ValueType t, Depth d, Move m,
int generation) :
key_ (k), data((m & 0x7FFFF) | (t << 20) | (generation << 23)),
TTEntry::TTEntry(Key k, Value v, ValueType t, Depth d, Move m,
int generation) :
key_ (k), data((m & 0x7FFFF) | (t << 20) | (generation << 23)),
- value_(v), depth_(int16_t(d)) {}
+ value_(int16_t(v)), depth_(int16_t(d)) {}