### Built-in benchmark for pgo-builds
PGOBENCH = ./$(EXE) bench
- ### Object files
- OBJS = benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o \
- material.o misc.o movegen.o movepick.o partner.o parser.o pawns.o piece.o position.o psqt.o \
- search.o thread.o timeman.o tt.o uci.o ucioption.o variant.o xboard.o tune.o syzygy/tbprobe.o
+ ### Source and object files
+ SRCS = benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp main.cpp \
- material.cpp misc.cpp movegen.cpp movepick.cpp pawns.cpp position.cpp psqt.cpp \
- search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp tune.cpp syzygy/tbprobe.cpp
++ material.cpp misc.cpp movegen.cpp movepick.cpp partner.cpp parser.cpp pawns.cpp piece.cpp position.cpp psqt.cpp \
++ search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp variant.cpp xboard.cpp tune.cpp syzygy/tbprobe.cpp
+
+ OBJS = $(notdir $(SRCS:.cpp=.o))
+
+ VPATH = syzygy
### Establish the operating system name
KERNEL = $(shell uname -s)
S(0, 0), S(10, 28), S(17, 33), S(15, 41), S(62, 72), S(168, 177), S(276, 260)
};
+ // KingProximity contains a penalty according to distance from king
+ constexpr Score KingProximity = S(1, 3);
+ constexpr Score EndgameKingProximity = S(0, 10);
+
// Assorted bonuses and penalties
constexpr Score BishopPawns = S( 3, 7);
+ constexpr Score BishopXRayPawns = S( 4, 5);
constexpr Score CorneredBishop = S( 50, 50);
constexpr Score FlankAttacks = S( 8, 0);
constexpr Score Hanging = S( 69, 36);
score -= BishopPawns * pos.pawns_on_same_color_squares(Us, s)
* (!(attackedBy[Us][PAWN] & s) + popcount(blocked & CenterFiles));
+ // Penalty for all enemy pawns x-rayed
- score -= BishopXRayPawns * popcount(PseudoAttacks[BISHOP][s] & pos.pieces(Them, PAWN));
++ score -= BishopXRayPawns * popcount(PseudoAttacks[Us][BISHOP][s] & pos.pieces(Them, PAWN));
+
// Bonus for bishop on a long diagonal which can "see" both center squares
if (more_than_one(attacks_bb<BISHOP>(s, pos.pieces(PAWN)) & Center))
score += LongDiagonalBishop;
sf = 22 + 3 * pos.count<ALL_PIECES>(strongSide);
}
else
- sf = std::min(sf, 36 + 7 * pos.count<PAWN>(strongSide));
+ sf = std::min(sf, 36 + 7 * (pos.count<PAWN>(strongSide) + pos.count<SOLDIER>(strongSide)));
-
- sf = std::max(0, sf - (pos.rule50_count() - 12) / 4);
}
return ScaleFactor(sf);
Trace::add(TOTAL, score);
}
- return (pos.side_to_move() == WHITE ? v : -v) + Eval::tempo_value(pos); // Side to move point of view
+ // Side to move point of view
- return (pos.side_to_move() == WHITE ? v : -v) + Tempo;
++ return (pos.side_to_move() == WHITE ? v : -v) + Eval::tempo_value(pos);
}
} // namespace
struct Cluster {
TTEntry entry[ClusterSize];
- char padding[2]; // Pad to 32 bytes
+ char padding[4]; // Pad to 64 bytes
};
- static_assert(sizeof(Cluster) == 32, "Unexpected Cluster size");
+ static_assert(sizeof(Cluster) == 64, "Unexpected Cluster size");
public:
- ~TranspositionTable() { free(mem); }
+ ~TranspositionTable() { aligned_ttmem_free(mem); }
void new_search() { generation8 += 8; } // Lower 3 bits are used by PV flag and Bound
TTEntry* probe(const Key key, bool& found) const;
int hashfull() const;