Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-evaluate some small net positions for more accurate evals #5238

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
Value nnue = smallNet ? networks.small.evaluate(pos, &caches.small, true, &nnueComplexity)
: networks.big.evaluate(pos, &caches.big, true, &nnueComplexity);

if (smallNet && (nnue * simpleEval < 0 || std::abs(nnue) < 500))
nnue = networks.big.evaluate(pos, &caches.big, true, &nnueComplexity);

const auto adjustEval = [&](int nnueDiv, int pawnCountConstant, int pawnCountMul,
int npmConstant, int evalDiv, int shufflingConstant) {
// Blend optimism and eval with nnue complexity and material imbalance
Expand Down
2 changes: 1 addition & 1 deletion src/evaluate.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Position;

namespace Eval {

constexpr inline int SmallNetThreshold = 1274;
constexpr inline int SmallNetThreshold = 1174;

// 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
Expand Down