mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Some minor cleanup stuff
I came across while browsing the code. No functional change.
This commit is contained in:
parent
bbd69c0260
commit
553ead429d
3 changed files with 11 additions and 19 deletions
|
@ -494,7 +494,9 @@ Value do_evaluate(const Position& pos) {
|
||||||
if (ei.attackedBy[Them][PAWN] & s)
|
if (ei.attackedBy[Them][PAWN] & s)
|
||||||
score -= ThreatenedByPawn[Pt];
|
score -= ThreatenedByPawn[Pt];
|
||||||
|
|
||||||
// Penalty for bishop with same coloured pawns
|
if (Pt == BISHOP || Pt == KNIGHT)
|
||||||
|
{
|
||||||
|
// Penalty for bishop with same colored pawns
|
||||||
if (Pt == BISHOP)
|
if (Pt == BISHOP)
|
||||||
score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s);
|
score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s);
|
||||||
|
|
||||||
|
@ -502,8 +504,6 @@ Value do_evaluate(const Position& pos) {
|
||||||
if (Pt == KNIGHT)
|
if (Pt == KNIGHT)
|
||||||
score -= KnightPawns * std::max(5 - pos.count<PAWN>(Them), 0);
|
score -= KnightPawns * std::max(5 - pos.count<PAWN>(Them), 0);
|
||||||
|
|
||||||
if (Pt == BISHOP || Pt == KNIGHT)
|
|
||||||
{
|
|
||||||
// Bishop and knight outposts squares
|
// Bishop and knight outposts squares
|
||||||
if (!(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s)))
|
if (!(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s)))
|
||||||
score += evaluate_outposts<Pt, Us>(pos, ei, s);
|
score += evaluate_outposts<Pt, Us>(pos, ei, s);
|
||||||
|
|
|
@ -391,8 +391,6 @@ namespace {
|
||||||
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
|
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Time::point iterationTime = Time::now() - SearchTime;
|
|
||||||
|
|
||||||
// If skill levels are enabled and time is up, pick a sub-optimal best move
|
// If skill levels are enabled and time is up, pick a sub-optimal best move
|
||||||
if (skill.enabled() && skill.time_to_pick(depth))
|
if (skill.enabled() && skill.time_to_pick(depth))
|
||||||
skill.pick_move();
|
skill.pick_move();
|
||||||
|
@ -417,8 +415,6 @@ namespace {
|
||||||
// Do we have time for the next iteration? Can we stop searching now?
|
// Do we have time for the next iteration? Can we stop searching now?
|
||||||
if (Limits.use_time_management() && !Signals.stop && !Signals.stopOnPonderhit)
|
if (Limits.use_time_management() && !Signals.stop && !Signals.stopOnPonderhit)
|
||||||
{
|
{
|
||||||
bool stop = false; // Local variable, not the volatile Signals.stop
|
|
||||||
|
|
||||||
// Take some extra time if the best move has changed
|
// Take some extra time if the best move has changed
|
||||||
if (depth > 4 && depth < 50 && MultiPV == 1)
|
if (depth > 4 && depth < 50 && MultiPV == 1)
|
||||||
TimeMgr.pv_instability(BestMoveChanges);
|
TimeMgr.pv_instability(BestMoveChanges);
|
||||||
|
@ -426,10 +422,7 @@ namespace {
|
||||||
// Stop the search if only one legal move is available or all
|
// Stop the search if only one legal move is available or all
|
||||||
// of the available time has been used.
|
// of the available time has been used.
|
||||||
if ( RootMoves.size() == 1
|
if ( RootMoves.size() == 1
|
||||||
|| iterationTime > TimeMgr.available_time() )
|
|| Time::now() - SearchTime > TimeMgr.available_time())
|
||||||
stop = true;
|
|
||||||
|
|
||||||
if (stop)
|
|
||||||
{
|
{
|
||||||
// If we are allowed to ponder do not stop the search now but
|
// If we are allowed to ponder do not stop the search now but
|
||||||
// keep pondering until the GUI sends "ponderhit" or "stop".
|
// keep pondering until the GUI sends "ponderhit" or "stop".
|
||||||
|
@ -663,7 +656,7 @@ namespace {
|
||||||
&& abs(beta) < VALUE_MATE_IN_MAX_PLY)
|
&& abs(beta) < VALUE_MATE_IN_MAX_PLY)
|
||||||
{
|
{
|
||||||
Value rbeta = std::min(beta + 200, VALUE_INFINITE);
|
Value rbeta = std::min(beta + 200, VALUE_INFINITE);
|
||||||
Depth rdepth = depth - ONE_PLY - 3 * ONE_PLY;
|
Depth rdepth = depth - 4 * ONE_PLY;
|
||||||
|
|
||||||
assert(rdepth >= ONE_PLY);
|
assert(rdepth >= ONE_PLY);
|
||||||
assert((ss-1)->currentMove != MOVE_NONE);
|
assert((ss-1)->currentMove != MOVE_NONE);
|
||||||
|
@ -1016,7 +1009,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||||
// case of Signals.stop or thread.cutoff_occurred() are set, but this is
|
// case of Signals.stop or thread.cutoff_occurred() are set, but this is
|
||||||
// harmless because return value is discarded anyhow in the parent nodes.
|
// harmless because return value is discarded anyhow in the parent nodes.
|
||||||
// If we are in a singular extension search then return a fail low score.
|
// If we are in a singular extension search then return a fail low score.
|
||||||
// A split node has at least one move - the one tried before to be splitted.
|
// A split node has at least one move - the one tried before to be split.
|
||||||
if (!moveCount)
|
if (!moveCount)
|
||||||
return excludedMove ? alpha
|
return excludedMove ? alpha
|
||||||
: inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()];
|
: inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()];
|
||||||
|
|
1
src/tt.h
1
src/tt.h
|
@ -32,7 +32,6 @@
|
||||||
/// value: 16 bit
|
/// value: 16 bit
|
||||||
/// depth: 16 bit
|
/// depth: 16 bit
|
||||||
/// static value: 16 bit
|
/// static value: 16 bit
|
||||||
/// static margin: 16 bit
|
|
||||||
|
|
||||||
struct TTEntry {
|
struct TTEntry {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue