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