mirror of
https://github.com/sockspls/badfish
synced 2025-07-13 04:29:15 +00:00

covers the most important cases from the user perspective: It embeds the default net in the binary, so a download of that binary will result in a working engine with the default net. The engine will be functional in the default mode without any additional user action. It allows non-default nets to be used, which will be looked for in up to three directories (working directory, location of the binary, and optionally a specific default directory). This mechanism is also kept for those developers that use MSVC, the one compiler that doesn't have an easy mechanism for embedding data. It is possible to disable embedding, and instead specify a specific directory, e.g. linux distros might want to use CXXFLAGS="-DNNUE_EMBEDDING_OFF -DDEFAULT_NNUE_DIRECTORY=/usr/share/games/stockfish/" make -j ARCH=x86-64 profile-build passed STC non-regression: https://tests.stockfishchess.org/tests/view/5f4a581c150f0aef5f8ae03a LLR: 2.95 (-2.94,2.94) {-1.25,-0.25} Total: 66928 W: 7202 L: 7147 D: 52579 Ptnml(0-2): 291, 5309, 22211, 5360, 293 closes https://github.com/official-stockfish/Stockfish/pull/3070 fixes https://github.com/official-stockfish/Stockfish/issues/3030 No functional change.
54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
/*
|
|
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
|
|
Copyright (C) 2004-2020 The Stockfish developers (see AUTHORS file)
|
|
|
|
Stockfish is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Stockfish is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef EVALUATE_H_INCLUDED
|
|
#define EVALUATE_H_INCLUDED
|
|
|
|
#include <string>
|
|
|
|
#include "types.h"
|
|
|
|
class Position;
|
|
|
|
namespace Eval {
|
|
|
|
std::string trace(const Position& pos);
|
|
Value evaluate(const Position& pos);
|
|
|
|
extern bool useNNUE;
|
|
extern std::string eval_file_loaded;
|
|
void init_NNUE();
|
|
void verify_NNUE();
|
|
|
|
// The default net name MUST follow the format nn-[SHA256 first 12 digits].nnue
|
|
// for the build process (profile-build and fishtest) to work. Do not change the
|
|
// name of the macro, as it is used in the Makefile.
|
|
#define EvalFileDefaultName "nn-82215d0fd0df.nnue"
|
|
|
|
namespace NNUE {
|
|
|
|
Value evaluate(const Position& pos);
|
|
Value compute_eval(const Position& pos);
|
|
void update_eval(const Position& pos);
|
|
bool load_eval(std::string streamName, std::istream& stream);
|
|
|
|
} // namespace NNUE
|
|
|
|
} // namespace Eval
|
|
|
|
#endif // #ifndef EVALUATE_H_INCLUDED
|