mirror of
https://github.com/sockspls/badfish
synced 2025-05-05 19:09:35 +00:00
Move OpeningBook and RK where are actually used
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
03f4d1e8d6
commit
ca9d40c145
1 changed files with 9 additions and 9 deletions
|
@ -201,9 +201,6 @@ namespace {
|
||||||
|
|
||||||
/// Namespace variables
|
/// Namespace variables
|
||||||
|
|
||||||
// Book
|
|
||||||
Book OpeningBook;
|
|
||||||
|
|
||||||
// Root move list
|
// Root move list
|
||||||
RootMoveList Rml;
|
RootMoveList Rml;
|
||||||
|
|
||||||
|
@ -221,7 +218,6 @@ namespace {
|
||||||
// Skill level adjustment
|
// Skill level adjustment
|
||||||
int SkillLevel;
|
int SkillLevel;
|
||||||
bool SkillLevelEnabled;
|
bool SkillLevelEnabled;
|
||||||
RKISS RK;
|
|
||||||
|
|
||||||
// Node counters, used only by thread[0] but try to keep in different cache
|
// Node counters, used only by thread[0] but try to keep in different cache
|
||||||
// lines (64 bytes each) from the heavy multi-thread read accessed variables.
|
// lines (64 bytes each) from the heavy multi-thread read accessed variables.
|
||||||
|
@ -360,6 +356,8 @@ int64_t perft(Position& pos, Depth depth) {
|
||||||
|
|
||||||
bool think(Position& pos, const SearchLimits& limits, Move searchMoves[]) {
|
bool think(Position& pos, const SearchLimits& limits, Move searchMoves[]) {
|
||||||
|
|
||||||
|
static Book book;
|
||||||
|
|
||||||
// Initialize global search-related variables
|
// Initialize global search-related variables
|
||||||
StopOnPonderhit = StopRequest = QuitRequest = AspirationFailLow = SendSearchedNodes = false;
|
StopOnPonderhit = StopRequest = QuitRequest = AspirationFailLow = SendSearchedNodes = false;
|
||||||
NodesSincePoll = 0;
|
NodesSincePoll = 0;
|
||||||
|
@ -380,10 +378,10 @@ bool think(Position& pos, const SearchLimits& limits, Move searchMoves[]) {
|
||||||
// Look for a book move
|
// Look for a book move
|
||||||
if (Options["OwnBook"].value<bool>())
|
if (Options["OwnBook"].value<bool>())
|
||||||
{
|
{
|
||||||
if (Options["Book File"].value<std::string>() != OpeningBook.name())
|
if (Options["Book File"].value<std::string>() != book.name())
|
||||||
OpeningBook.open(Options["Book File"].value<std::string>());
|
book.open(Options["Book File"].value<std::string>());
|
||||||
|
|
||||||
Move bookMove = OpeningBook.get_move(pos, Options["Best Book Move"].value<bool>());
|
Move bookMove = book.get_move(pos, Options["Best Book Move"].value<bool>());
|
||||||
if (bookMove != MOVE_NONE)
|
if (bookMove != MOVE_NONE)
|
||||||
{
|
{
|
||||||
if (Limits.ponder)
|
if (Limits.ponder)
|
||||||
|
@ -1886,6 +1884,8 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
assert(MultiPV > 1);
|
assert(MultiPV > 1);
|
||||||
|
|
||||||
|
static RKISS rk;
|
||||||
|
|
||||||
// Rml list is already sorted by pv_score in descending order
|
// Rml list is already sorted by pv_score in descending order
|
||||||
int s;
|
int s;
|
||||||
int max_s = -VALUE_INFINITE;
|
int max_s = -VALUE_INFINITE;
|
||||||
|
@ -1896,7 +1896,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
// PRNG sequence should be non deterministic
|
// PRNG sequence should be non deterministic
|
||||||
for (int i = abs(get_system_time() % 50); i > 0; i--)
|
for (int i = abs(get_system_time() % 50); i > 0; i--)
|
||||||
RK.rand<unsigned>();
|
rk.rand<unsigned>();
|
||||||
|
|
||||||
// Choose best move. For each move's score we add two terms both dependent
|
// Choose best move. For each move's score we add two terms both dependent
|
||||||
// on wk, one deterministic and bigger for weaker moves, and one random,
|
// on wk, one deterministic and bigger for weaker moves, and one random,
|
||||||
|
@ -1910,7 +1910,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// This is our magical formula
|
// This is our magical formula
|
||||||
s += ((max - s) * wk + var * (RK.rand<unsigned>() % wk)) / 128;
|
s += ((max - s) * wk + var * (rk.rand<unsigned>() % wk)) / 128;
|
||||||
|
|
||||||
if (s > max_s)
|
if (s > max_s)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue