From 3104cd72d531dd4908bbaa01d3206a62112c3c74 Mon Sep 17 00:00:00 2001 From: mstembera Date: Sun, 12 Jan 2025 16:31:59 -0800 Subject: [PATCH] Fix initialization of TTData. https://tests.stockfishchess.org/tests/view/6757757686d5ee47d9541de9 LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 151200 W: 39396 L: 39306 D: 72498 Ptnml(0-2): 445, 16404, 41781, 16556, 414 Discussed in more detail here #5766 closes https://github.com/official-stockfish/Stockfish/pull/5773 No functional change --- src/tt.cpp | 4 +++- src/tt.h | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/tt.cpp b/src/tt.cpp index 50f5ca45af8..5d8457611dd 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -238,7 +238,9 @@ std::tuple TranspositionTable::probe(const Key key) cons > tte[i].depth8 - tte[i].relative_age(generation8) * 2) replace = &tte[i]; - return {false, TTData(), TTWriter(replace)}; + return {false, + TTData{Move::none(), VALUE_NONE, VALUE_NONE, DEPTH_ENTRY_OFFSET, BOUND_NONE, false}, + TTWriter(replace)}; } diff --git a/src/tt.h b/src/tt.h index f0936fd282c..065380ca8ba 100644 --- a/src/tt.h +++ b/src/tt.h @@ -51,6 +51,15 @@ struct TTData { Depth depth; Bound bound; bool is_pv; + + TTData() = delete; + TTData(Move m, Value v, Value ev, Depth d, Bound b, bool pv) : + move(m), + value(v), + eval(ev), + depth(d), + bound(b), + is_pv(pv) {}; };