/*1Stockfish, a UCI chess playing engine derived from Glaurung 2.12Copyright (C) 2004-2026 The Stockfish developers (see AUTHORS file)34Stockfish is free software: you can redistribute it and/or modify5it under the terms of the GNU General Public License as published by6the Free Software Foundation, either version 3 of the License, or7(at your option) any later version.89Stockfish is distributed in the hope that it will be useful,10but WITHOUT ANY WARRANTY; without even the implied warranty of11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12GNU General Public License for more details.1314You should have received a copy of the GNU General Public License15along with this program. If not, see <http://www.gnu.org/licenses/>.16*/1718#ifndef NNUE_MISC_H_INCLUDED19#define NNUE_MISC_H_INCLUDED2021#include <cstddef>22#include <memory>23#include <string>2425#include "../misc.h"26#include "../types.h"27#include "nnue_architecture.h"2829namespace Stockfish {3031class Position;3233namespace Eval::NNUE {3435// EvalFile uses fixed string types because it's part of the network structure which must be trivial.36struct EvalFile {37// Default net name, will use one of the EvalFileDefaultName* macros defined38// in evaluate.h39FixedString<256> defaultName;40// Selected net name, either via uci option or default41FixedString<256> current;42// Net description extracted from the net file43FixedString<256> netDescription;44};4546struct NnueEvalTrace {47static_assert(LayerStacks == PSQTBuckets);4849Value psqt[LayerStacks];50Value positional[LayerStacks];51std::size_t correctBucket;52};5354struct Networks;55struct AccumulatorCaches;5657std::string trace(Position& pos, const Networks& networks, AccumulatorCaches& caches);5859} // namespace Stockfish::Eval::NNUE60} // namespace Stockfish6162template<>63struct std::hash<Stockfish::Eval::NNUE::EvalFile> {64std::size_t operator()(const Stockfish::Eval::NNUE::EvalFile& evalFile) const noexcept {65std::size_t h = 0;66Stockfish::hash_combine(h, evalFile.defaultName);67Stockfish::hash_combine(h, evalFile.current);68Stockfish::hash_combine(h, evalFile.netDescription);69return h;70}71};7273#endif // #ifndef NNUE_MISC_H_INCLUDED747576