mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Small clean-ups
- Comment for Countemove pruning -> Continuation history - Fix comment in input_slice.h - Shorter lines in Makefile - Comment for scale factor - Fix comment for pinners in see_ge() - Change Thread.id() signature to size_t - Trailing space in reprosearch.sh - Add Douglas Matos Gomes to the AUTHORS file - Introduce comment for undo_null_move() - Use Stockfish coding style for export_net() - Change date in AUTHORS file closes https://github.com/official-stockfish/Stockfish/pull/3416 No functional change
This commit is contained in:
parent
61e1c66b7c
commit
f90274d8ce
8 changed files with 31 additions and 26 deletions
3
AUTHORS
3
AUTHORS
|
@ -1,4 +1,4 @@
|
|||
# List of authors for Stockfish, as of March 31, 2021
|
||||
# List of authors for Stockfish, as of May 17, 2021
|
||||
|
||||
# Founders of the Stockfish project and fishtest infrastructure
|
||||
Tord Romstad (romstad)
|
||||
|
@ -52,6 +52,7 @@ Dieter Dobbelaere (ddobbelaere)
|
|||
DiscanX
|
||||
Dominik Schlösser (domschl)
|
||||
double-beep
|
||||
Douglas Matos Gomes (dsmsgms)
|
||||
Eduardo Cáceres (eduherminio)
|
||||
Eelco de Groot (KingDefender)
|
||||
Elvin Liu (solarlight2)
|
||||
|
|
|
@ -96,8 +96,7 @@ endif
|
|||
ifeq ($(ARCH), $(filter $(ARCH), \
|
||||
x86-64-vnni512 x86-64-vnni256 x86-64-avx512 x86-64-bmi2 x86-64-avx2 \
|
||||
x86-64-sse41-popcnt x86-64-modern x86-64-ssse3 x86-64-sse3-popcnt \
|
||||
x86-64 x86-32-sse41-popcnt x86-32-sse2 x86-32 ppc-64 ppc-32 \
|
||||
e2k \
|
||||
x86-64 x86-32-sse41-popcnt x86-32-sse2 x86-32 ppc-64 ppc-32 e2k \
|
||||
armv7 armv7-neon armv8 apple-silicon general-64 general-32))
|
||||
SUPPORTED_ARCH=true
|
||||
else
|
||||
|
@ -840,8 +839,7 @@ config-sanity: net
|
|||
@test "$(optimize)" = "yes" || test "$(optimize)" = "no"
|
||||
@test "$(SUPPORTED_ARCH)" = "true"
|
||||
@test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
|
||||
test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || \
|
||||
test "$(arch)" = "e2k" || \
|
||||
test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "e2k" || \
|
||||
test "$(arch)" = "armv7" || test "$(arch)" = "armv8" || test "$(arch)" = "arm64"
|
||||
@test "$(bits)" = "32" || test "$(bits)" = "64"
|
||||
@test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
|
||||
|
|
|
@ -114,24 +114,28 @@ namespace Eval {
|
|||
}
|
||||
}
|
||||
|
||||
/// NNUE::export_net() exports the currently loaded network to a file
|
||||
void NNUE::export_net(const std::optional<std::string>& filename) {
|
||||
std::string actualFilename;
|
||||
if (filename.has_value()) {
|
||||
actualFilename = filename.value();
|
||||
} else {
|
||||
if (eval_file_loaded != EvalFileDefaultName) {
|
||||
sync_cout << "Failed to export a net. A non-embedded net can only be saved if the filename is specified." << sync_endl;
|
||||
return;
|
||||
}
|
||||
actualFilename = EvalFileDefaultName;
|
||||
|
||||
if (filename.has_value())
|
||||
actualFilename = filename.value();
|
||||
else
|
||||
{
|
||||
if (eval_file_loaded != EvalFileDefaultName)
|
||||
{
|
||||
sync_cout << "Failed to export a net. A non-embedded net can only be saved if the filename is specified." << sync_endl;
|
||||
return;
|
||||
}
|
||||
actualFilename = EvalFileDefaultName;
|
||||
}
|
||||
|
||||
ofstream stream(actualFilename, std::ios_base::binary);
|
||||
if (save_eval(stream)) {
|
||||
|
||||
if (save_eval(stream))
|
||||
sync_cout << "Network saved successfully to " << actualFilename << "." << sync_endl;
|
||||
} else {
|
||||
else
|
||||
sync_cout << "Failed to export a net." << sync_endl;
|
||||
}
|
||||
}
|
||||
|
||||
/// NNUE::verify() verifies that the last net used was loaded successfully
|
||||
|
@ -927,7 +931,7 @@ namespace {
|
|||
Color strongSide = eg > VALUE_DRAW ? WHITE : BLACK;
|
||||
int sf = me->scale_factor(pos, strongSide);
|
||||
|
||||
// If scale factor is not already specific, scale down via general heuristics
|
||||
// If scale factor is not already specific, scale up/down via general heuristics
|
||||
if (sf == SCALE_FACTOR_NORMAL)
|
||||
{
|
||||
if (pos.opposite_bishops())
|
||||
|
|
|
@ -53,7 +53,7 @@ class InputSlice {
|
|||
return true;
|
||||
}
|
||||
|
||||
// Read network parameters
|
||||
// Write network parameters
|
||||
bool write_parameters(std::ostream& /*stream*/) const {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -988,7 +988,7 @@ void Position::do_castling(Color us, Square from, Square& to, Square& rfrom, Squ
|
|||
}
|
||||
|
||||
|
||||
/// Position::do(undo)_null_move() is used to do(undo) a "null move": it flips
|
||||
/// Position::do_null_move() is used to do a "null move": it flips
|
||||
/// the side to move without executing any move on the board.
|
||||
|
||||
void Position::do_null_move(StateInfo& newSt) {
|
||||
|
@ -1027,6 +1027,9 @@ void Position::do_null_move(StateInfo& newSt) {
|
|||
assert(pos_is_ok());
|
||||
}
|
||||
|
||||
|
||||
/// Position::undo_null_move() must be used to undo a "null move"
|
||||
|
||||
void Position::undo_null_move() {
|
||||
|
||||
assert(!checkers());
|
||||
|
@ -1092,8 +1095,8 @@ bool Position::see_ge(Move m, Value threshold) const {
|
|||
if (!(stmAttackers = attackers & pieces(stm)))
|
||||
break;
|
||||
|
||||
// Don't allow pinned pieces to attack (except the king) as long as
|
||||
// there are pinners on their original square.
|
||||
// Don't allow pinned pieces to attack as long as there are
|
||||
// pinners on their original square.
|
||||
if (pinners(~stm) & occupied)
|
||||
stmAttackers &= ~blockers_for_king(stm);
|
||||
|
||||
|
|
|
@ -862,7 +862,6 @@ namespace {
|
|||
&& ttValue != VALUE_NONE
|
||||
&& ttValue < probCutBeta))
|
||||
{
|
||||
|
||||
assert(probCutBeta < VALUE_INFINITE);
|
||||
|
||||
MovePicker mp(pos, ttMove, probCutBeta - ss->staticEval, &captureHistory);
|
||||
|
@ -1025,7 +1024,7 @@ moves_loop: // When in check, search starts from here
|
|||
}
|
||||
else
|
||||
{
|
||||
// Countermoves based pruning (~20 Elo)
|
||||
// Continuation history based pruning (~20 Elo)
|
||||
if ( lmrDepth < 4
|
||||
&& (*contHist[0])[movedPiece][to_sq(move)] < CounterMovePruneThreshold
|
||||
&& (*contHist[1])[movedPiece][to_sq(move)] < CounterMovePruneThreshold)
|
||||
|
@ -1528,7 +1527,7 @@ moves_loop: // When in check, search starts from here
|
|||
[pos.moved_piece(move)]
|
||||
[to_sq(move)];
|
||||
|
||||
// CounterMove based pruning
|
||||
// Continuation history based pruning
|
||||
if ( !captureOrPromotion
|
||||
&& bestValue > VALUE_TB_LOSS_IN_MAX_PLY
|
||||
&& (*contHist[0])[pos.moved_piece(move)][to_sq(move)] < CounterMovePruneThreshold
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
void idle_loop();
|
||||
void start_searching();
|
||||
void wait_for_search_finished();
|
||||
int id() const { return idx; }
|
||||
size_t id() const { return idx; }
|
||||
|
||||
Pawns::Table pawnsTable;
|
||||
Material::Table materialTable;
|
||||
|
|
|
@ -10,7 +10,7 @@ trap 'error ${LINENO}' ERR
|
|||
|
||||
echo "reprosearch testing started"
|
||||
|
||||
# repeat two short games, separated by ucinewgame.
|
||||
# repeat two short games, separated by ucinewgame.
|
||||
# with go nodes $nodes they should result in exactly
|
||||
# the same node count for each iteration.
|
||||
cat << EOF > repeat.exp
|
||||
|
|
Loading…
Add table
Reference in a new issue