Skip to content

Commit

Permalink
Eval parameters tuning
Browse files Browse the repository at this point in the history
Book: 3mvs 251-350_51933
TC: 100+1
Total/Win/Draw/Lose: 6242 / 1630 / 3100 / 1512
PTNML: 8 / 626 / 1733 / 748 / 6
WinRate: 50.95%
ELO: 6.07[1.80, 10.29]
LOS: 99.72
LLR: 2.93[-2.94, 2.94]
  • Loading branch information
PikaCat-OuO committed Aug 23, 2023
1 parent 521f1d8 commit 35a0518
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ Value Eval::evaluate(const Position& pos) {
Value v = NNUE::evaluate(pos, true);

// Scale nnue score according to material and optimism
Value optimism = pos.this_thread()->optimism[pos.side_to_move()] * abs(pos.material_diff() - v) / 512;
Value material = pos.material_sum() / 64;
v = (v * (601 + material) + optimism * (184 + material)) / 1024;
Value optimism = pos.this_thread()->optimism[pos.side_to_move()] * abs(pos.material_diff() - v) / 568;
Value material = pos.material_sum() / 40;
v = (v * (622 + material) + optimism * (171 + material)) / 1041;

// Damp down the evaluation linearly when shuffling
v = v * (240 - pos.rule60_count()) / 136;
v = v * (258 - pos.rule60_count()) / 134;

// Guarantee evaluation does not hit the mate range
v = std::clamp(v, VALUE_MATED_IN_MAX_PLY + 1, VALUE_MATE_IN_MAX_PLY - 1);
Expand Down
2 changes: 1 addition & 1 deletion src/nnue/evaluate_nnue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace Stockfish::Eval::NNUE {
// overaligning stack variables with alignas() doesn't work correctly.

constexpr uint64_t alignment = CacheLineSize;
constexpr int delta = 24;
constexpr int delta = 26;

#if defined(ALIGNAS_ON_STACK_VARIABLES_BROKEN)
TransformedFeatureType transformedFeaturesUnaligned[
Expand Down

0 comments on commit 35a0518

Please sign in to comment.