Skip to content

Commit

Permalink
Correct the hint threshold, and move the thresholds to evaluate.h
Browse files Browse the repository at this point in the history
Bench: 1741218
  • Loading branch information
XInTheDark committed Mar 10, 2024
1 parent d84ab5f commit 6af79e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ Value Eval::evaluate(const Position& pos, int optimism) {
assert(!pos.checkers());

int simpleEval = simple_eval(pos, pos.side_to_move());
bool smallNet = std::abs(simpleEval) > 1139;
bool psqtOnly = std::abs(simpleEval) > 2500;
bool smallNet = std::abs(simpleEval) > NNUE::smallNetThreshold;
bool psqtOnly = std::abs(simpleEval) > NNUE::psqtOnlyThreshold;

int nnueComplexity;

Expand Down
2 changes: 2 additions & 0 deletions src/evaluate.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ enum NetSize : int;

using EvalFiles = std::unordered_map<Eval::NNUE::NetSize, EvalFile>;

constexpr inline int smallNetThreshold = 1139, psqtOnlyThreshold = 2500;

EvalFiles load_networks(const std::string&, const OptionsMap&, EvalFiles);
void verify(const OptionsMap&, const EvalFiles&);

Expand Down
4 changes: 2 additions & 2 deletions src/nnue/evaluate_nnue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ write_parameters(std::ostream& stream, NetSize netSize, const std::string& netDe
void hint_common_parent_position(const Position& pos) {

int simpleEvalAbs = std::abs(simple_eval(pos, pos.side_to_move()));
if (simpleEvalAbs > 1050)
featureTransformerSmall->hint_common_access(pos, simpleEvalAbs > 2500);
if (simpleEvalAbs > smallNetThreshold)
featureTransformerSmall->hint_common_access(pos, simpleEvalAbs > psqtOnlyThreshold);
else
featureTransformerBig->hint_common_access(pos, false);
}
Expand Down

0 comments on commit 6af79e1

Please sign in to comment.