mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 18:46:59 +08:00
Expose the lazy threshold for the feature transformer PSQT as a parameter.
Definition of the lazy threshold moved to evaluate.cpp where all others are. Lazy threshold only used for real searches, not used for the "eval" call. This preserves the purity of NNUE evaluation, which is useful to verify consistency between the engine and the NNUE trainer. closes https://github.com/official-stockfish/Stockfish/pull/3499 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
e044068b43
commit
9d53129075
@@ -134,7 +134,7 @@ namespace Stockfish::Eval::NNUE {
|
||||
}
|
||||
|
||||
// Evaluation function. Perform differential calculation.
|
||||
Value evaluate(const Position& pos, bool adjusted) {
|
||||
Value evaluate(const Position& pos, bool adjusted, Value lazyThreshold) {
|
||||
|
||||
// We manually align the arrays on the stack because with gcc < 9.3
|
||||
// overaligning stack variables with alignas() doesn't work correctly.
|
||||
@@ -158,7 +158,7 @@ namespace Stockfish::Eval::NNUE {
|
||||
ASSERT_ALIGNED(buffer, alignment);
|
||||
|
||||
const std::size_t bucket = (pos.count<ALL_PIECES>() - 1) / 4;
|
||||
const auto [psqt, lazy] = featureTransformer->transform(pos, transformedFeatures, bucket);
|
||||
const auto [psqt, lazy] = featureTransformer->transform(pos, transformedFeatures, bucket, lazyThreshold);
|
||||
|
||||
if (lazy)
|
||||
return static_cast<Value>(psqt / OutputScale);
|
||||
|
||||
Reference in New Issue
Block a user