mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Small cleanups 13
No functional change
This commit is contained in:
parent
f9595828eb
commit
027626db1e
7 changed files with 13 additions and 14 deletions
2
AUTHORS
2
AUTHORS
|
@ -44,6 +44,7 @@ Daniel Dugovic (ddugovic)
|
|||
Dariusz Orzechowski (dorzechowski)
|
||||
David Zar
|
||||
Daylen Yang (daylen)
|
||||
Deshawn Mohan-Smith (GoldenRare)
|
||||
DiscanX
|
||||
Dominik Schlösser (domschl)
|
||||
double-beep
|
||||
|
@ -64,7 +65,6 @@ Gary Heckman (gheckman)
|
|||
George Sobala (gsobala)
|
||||
gguliash
|
||||
Gian-Carlo Pascutto (gcp)
|
||||
Deshawn Mohan-Smith (GoldenRare)
|
||||
Gontran Lemaire (gonlem)
|
||||
Goodkov Vasiliy Aleksandrovich (goodkov)
|
||||
Gregor Cramer
|
||||
|
|
|
@ -1025,7 +1025,7 @@ Value Eval::evaluate(const Position& pos) {
|
|||
{
|
||||
// Scale and shift NNUE for compatibility with search and classical evaluation
|
||||
auto adjusted_NNUE = [&](){
|
||||
int mat = pos.non_pawn_material() + PieceValue[MG][PAWN] * pos.count<PAWN>();
|
||||
int mat = pos.non_pawn_material() + PawnValueMg * pos.count<PAWN>();
|
||||
return NNUE::evaluate(pos) * (720 + mat / 32) / 1024 + Tempo;
|
||||
};
|
||||
|
||||
|
@ -1041,10 +1041,10 @@ Value Eval::evaluate(const Position& pos) {
|
|||
// For the case of opposite colored bishops, switch to NNUE eval with
|
||||
// small probability if the classical eval is less than the threshold.
|
||||
if ( largePsq
|
||||
&& (abs(v) * 16 < NNUEThreshold2 * r50
|
||||
|| ( pos.opposite_bishops()
|
||||
&& abs(v) * 16 < (NNUEThreshold1 + pos.non_pawn_material() / 64) * r50
|
||||
&& !(pos.this_thread()->nodes & 0xB))))
|
||||
&& ( abs(v) * 16 < NNUEThreshold2 * r50
|
||||
|| ( pos.opposite_bishops()
|
||||
&& abs(v) * 16 < (NNUEThreshold1 + pos.non_pawn_material() / 64) * r50
|
||||
&& !(pos.this_thread()->nodes & 0xB))))
|
||||
v = adjusted_NNUE();
|
||||
}
|
||||
|
||||
|
|
|
@ -583,11 +583,10 @@ namespace CommandLine {
|
|||
string argv0; // path+name of the executable binary, as given by argv[0]
|
||||
string binaryDirectory; // path of the executable directory
|
||||
string workingDirectory; // path of the working directory
|
||||
string pathSeparator; // Separator for our current OS
|
||||
|
||||
void init(int argc, char* argv[]) {
|
||||
(void)argc;
|
||||
string separator;
|
||||
string pathSeparator;
|
||||
|
||||
// extract the path+name of the executable binary
|
||||
argv0 = argv[0];
|
||||
|
|
|
@ -247,7 +247,7 @@ namespace Eval::NNUE {
|
|||
// Look for a usable accumulator of an earlier position. We keep track
|
||||
// of the estimated gain in terms of features to be added/subtracted.
|
||||
StateInfo *st = pos.state(), *next = nullptr;
|
||||
int gain = popcount(pos.pieces()) - 2;
|
||||
int gain = pos.count<ALL_PIECES>() - 2;
|
||||
while (st->accumulator.state[c] == EMPTY)
|
||||
{
|
||||
auto& dp = st->dirtyPiece;
|
||||
|
|
|
@ -176,8 +176,8 @@ namespace {
|
|||
score -= Doubled * doubled
|
||||
+ WeakLever * more_than_one(lever);
|
||||
|
||||
if (blocked && r > RANK_4)
|
||||
score += BlockedPawn[r-4];
|
||||
if (blocked && r >= RANK_5)
|
||||
score += BlockedPawn[r - RANK_5];
|
||||
}
|
||||
|
||||
return score;
|
||||
|
|
|
@ -1058,7 +1058,7 @@ moves_loop: // When in check, search starts from here
|
|||
&& captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] < 0)
|
||||
continue;
|
||||
|
||||
// See based pruning
|
||||
// SEE based pruning
|
||||
if (!pos.see_ge(move, Value(-221) * depth)) // (~25 Elo)
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -202,8 +202,8 @@ enum PieceType {
|
|||
|
||||
enum Piece {
|
||||
NO_PIECE,
|
||||
W_PAWN = 1, W_KNIGHT, W_BISHOP, W_ROOK, W_QUEEN, W_KING,
|
||||
B_PAWN = 9, B_KNIGHT, B_BISHOP, B_ROOK, B_QUEEN, B_KING,
|
||||
W_PAWN = PAWN, W_KNIGHT, W_BISHOP, W_ROOK, W_QUEEN, W_KING,
|
||||
B_PAWN = PAWN + 8, B_KNIGHT, B_BISHOP, B_ROOK, B_QUEEN, B_KING,
|
||||
PIECE_NB = 16
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue