void record_best_move(Search *, const Board *, const Move *, const int, const int, const int)
Record best move.
Definition: root.c:150
bool search_SC_NWS(Search *, const int, int *)
Stability Cutoff (TC).
Definition: search.c:1170
void search_cleanup(Search *)
Clean-up some search data.
Definition: search.c:578
bool search_TC_PVS(HashData *, const int, const int, volatile int *, volatile int *, int *)
Transposition Cutoff (TC).
Definition: search.c:1196
int get_pv_extension(const int, const int)
Compute the pv_extension.
Definition: search.c:1012
unsigned long long n_nodes
Definition: search.h:49
int depth
Definition: search.h:63
int n_hints
Definition: search.h:83
Result * result
Definition: search.h:151
#define MAX_THREADS
Definition: const.h:15
MoveList movelist[1]
Definition: search.h:132
bool search_TC_NWS(HashData *, const int, const int, const int, int *)
Transposition Cutoff (TC).
Definition: search.c:1230
volatile unsigned long long child_nodes
Definition: search.h:156
SpinLock spin
Definition: search.h:111
int probcut_level
Definition: search.h:119
long long maxi
Definition: search.h:130
int height
Definition: search.h:133
struct Search * parent
Definition: search.h:112
int search_eval_2(Search *, int, const int)
Evaluate a position at depth 2.
Definition: midgame.c:147
int verbosity
Definition: search.h:142
void search_stop_all(Search *, const Stop)
Stop the search.
Definition: search.c:1335
const int NO_SELECTIVITY
Definition: search.c:94
void show_current_move(FILE *f, Search *, const Move *, const int, const int, const bool)
Definition: root.c:239
long long time
Definition: search.h:70
void search_restore_midgame(Search *, const Move *)
Restore the search state as before a move.
Definition: search.c:964
int move
Definition: search.h:44
struct Level LEVEL[61][61]
#define BOARD_SIZE
Definition: const.h:21
long long extra
Definition: search.h:125
void search_init(Search *)
Init the main search.
Definition: search.c:351
const Selectivity selectivity_table[]
Definition: search.c:97
long long time
Definition: search.h:140
HashTable shallow_table[1]
Definition: search.h:105
void search_print_pv(Search *, const int, const char *, FILE *)
int selectivity
Definition: search.h:43
void search_adjust_time(Search *, const bool)
Give more time.
Definition: search.c:771
int PVS_root(Search *, const int, const int, const int)
Principal Variation Search algorithm at the root of the tree.
Definition: root.c:330
int NWS_endgame(Search *, const int)
Evaluate an endgame position with a Null Window Search algorithm.
Definition: endgame.c:449
Board board[1]
Definition: search.h:96
const int QUADRANT_ID[]
Definition: search.c:81
void search_set_state(Search *, const Stop)
Set the search running/waiting state.
Definition: search.c:1353
bool search_SC_PVS(Search *, volatile int *, volatile int *, int *)
Stability Cutoff (SC).
Definition: search.c:1146
void search_update_pass_midgame(Search *)
Update the search state after a passing move.
Definition: search.c:983
long long mini
Definition: search.h:129
void search_print(Search *, const int, const int, const char, FILE *)
struct Selectivity Selectivity
int search_get_pv_cost(Search *)
Compute a cost as a combination of node count, depth, etc. from hash_table.
Definition: root.c:303
void search_pass_endgame(Search *)
Update the search state after a passing move.
Definition: search.c:928
struct Task * task
Definition: search.h:110
bool search_continue(Search *)
Check if it can iterate more...
Definition: search.c:790
int NWS_midgame(Search *, const int, int, struct Node *)
Evaluate a midgame position with a Null Window Search algorithm.
Definition: midgame.c:473
int percent
Definition: search.h:28
HashTable hash_table[1]
Definition: search.h:103
long long time
Definition: search.h:48
Random random[1]
Definition: search.h:107
bool guess_pv
Definition: search.h:146
int n_moves
Definition: search.h:51
int lower
Definition: search.h:36
struct Search * search
Definition: ybwc.h:59
unsigned int parity
Definition: search.h:120
void search_update_endgame(Search *, const Move *)
Update the search state after a move.
Definition: search.c:900
struct Search::@25 options
void search_global_init(void)
Definition: search.c:151
Stop
Definition: const.h:70
int search_count_tasks(const Search *)
Count the number of tasks used in parallel search.
Definition: search.c:1324
int search_bound(const Search *, int)
bound root scores according to stable squares
Definition: root.c:253
int score
Definition: search.h:45
int PVS_shallow(Search *, int, int, int)
Evaluate a midgame position at shallow depth.
Definition: midgame.c:381
evaluation function
Definition: eval.h:18
bool is_pv_ok(Search *, int, int)
Check if PV is ok.
Definition: root.c:83
int player
Definition: search.h:100
long long search_clock(Search *)
Return the time spent by the search.
Definition: search.c:1049
struct TaskStack * tasks
Definition: search.h:109
int n_moves_left
Definition: search.h:52
int depth
Definition: search.h:117
void search_free(Search *)
Free the search allocated ressource.
Definition: search.c:441
int board_score_1(const Board *, const int, const int)
Get the final score.
Definition: endgame.c:96
int multipv_depth
Definition: search.h:147
int id
Definition: search.h:101
void search_get_movelist(const Search *, MoveList *)
Get a list of legal moves.
Definition: search.c:875
Line pv[1]
Definition: search.h:47
const int PVS_STABILITY_THRESHOLD[]
Definition: search.c:120
bool allow_node_splitting
Definition: search.h:123
int upper
Definition: search.h:37
bool is_depth_solving(const int, const int)
Check if final score use pv_extension or is solved.
Definition: search.c:1032
NodeType
Definition: const.h:80
void search_set_level(Search *, const int, const int)
Set the search level.
Definition: search.c:609
SquareList empties[BOARD_SIZE+2]
Definition: search.h:97
Miscellaneous utilities header.
void search_time_init(Search *)
Initialize the alloted time.
Definition: search.c:697
int search_guess(Search *, const Board *)
Guess the bestmove of a given board.
Definition: search.c:1369
void search_set_board(Search *, const Board *, const int)
Set the board to analyze.
Definition: search.c:593
volatile int n_child
Definition: search.h:115
int search_solve(const Search *)
Get the final score.
Definition: endgame.c:52
void result_print(Result *, FILE *)
Print the current search result.
Definition: search.c:1106
bool keep_date
Definition: search.h:143
int PVS_midgame(Search *, const int, const int, int, struct Node *)
Evaluate a position with a deep Principal Variation Search algorithm.
Definition: midgame.c:585
int search_eval_0(Search *)
evaluate a midgame position with the evaluation function.
Definition: midgame.c:32
struct Search * child[MAX_THREADS]
Definition: search.h:113
double t
Definition: search.h:26
Eval eval[1]
Definition: search.h:106
int upper
Definition: search.h:67
struct Search * master
Definition: search.h:114
int depth
Definition: search.h:42
unsigned long long n_nodes
Definition: search.h:71
int move
Definition: search.h:65
bool book_move
Definition: search.h:72
void search_time_reset(Search *, const Board *)
Reset the alloted time.
Definition: search.c:732
SquareList * x_to_empties[BOARD_SIZE+2]
Definition: search.h:98
void search_restore_endgame(Search *, const Move *)
Restore the search state as before a move.
Definition: search.c:915
int NWS_shallow(Search *, const int, int, HashTable *)
Evaluate a midgame position with a Null Window Search algorithm.
Definition: midgame.c:300
int depth
Definition: search.h:89
int n_empties
Definition: search.h:99
void search_setup(Search *)
Set up various structure once the board has been set.
Definition: search.c:466
int selectivity
Definition: search.h:64
const char * separator
Definition: search.h:145
NodeType next_node_type(const NodeType parent, const bool first_move)
void iterative_deepening(Search *, int, int)
Iterative deepening.
Definition: root.c:621
long long search_time(Search *)
Return the time spent by the search.
Definition: search.c:1061
const int SQUARE_TYPE[]
Definition: search.c:132
void search_clone(Search *, Search *)
Clone a search for parallel search.
Definition: search.c:540
void * search_run(void *)
Search the bestmove of a given board.
Definition: root.c:810
bool extended
Definition: search.h:127
SpinLock spin
Definition: search.h:53
void search_observer(Result *)
default observer.
Definition: search.c:1083
int score
Definition: search.h:66
void pv_debug(Search *, const Move *, FILE *)
Debug PV.
Definition: root.c:33
#define GAME_SIZE
Definition: const.h:25
int search_solve_0(const Search *)
Get the final score.
Definition: endgame.c:80
bool search_ETC_NWS(Search *, MoveList *, unsigned long long, const int, const int, const int, int *)
Enhanced Transposition Cutoff (ETC).
Definition: search.c:1264
void search_resize_hashtable(Search *)
Definition: search.c:333
int hash_size
Definition: search.h:148
int search_eval_1(Search *, const int, int)
Evaluate a position at depth 1.
Definition: midgame.c:74
const char * header
Definition: search.h:144
volatile Stop stop
Definition: search.h:122
int selectivity
Definition: search.h:118
Line pv[1]
Definition: search.h:69
NodeType node_type[GAME_SIZE]
Definition: search.h:134
void search_set_ponder_level(Search *, const int, const int)
Set the search level while pondering.
Definition: search.c:629
void(* observer)(Result *)
Definition: search.h:153
void search_set_move_time(Search *, const long long)
set time to search.
Definition: search.c:686
int lower
Definition: search.h:68
int solvable_depth(const long long, int)
Compute the deepest level that can be solved given a limited time...
Definition: search.c:650
bool search_ETC_PVS(Search *, MoveList *, unsigned long long, const int, const int, volatile int *, volatile int *, int *)
bool time_per_move
Definition: search.h:141
const int NWS_STABILITY_THRESHOLD[]
Definition: search.c:108
void search_share(const Search *, Search *)
Share search information.
Definition: search.c:1312
#define MAX_MOVE
Definition: const.h:18
int aspiration_search(Search *, int, int, const int, int)
Aspiration window.
Definition: root.c:451
void search_swap_parity(Search *, const int)
Change parity.
Definition: search.c:860
void search_check_timeout(Search *search)
Check if it can iterate more...
Definition: search.c:800
volatile unsigned long long n_nodes
Definition: search.h:155
bool book_move
Definition: search.h:50
Hint hint[MAX_MOVE+2]
Definition: search.h:82
int depth_pv_extension
Definition: search.h:121
unsigned long long search_count_nodes(Search *)
Return the number of nodes searched.
Definition: search.c:1073
void search_update_midgame(Search *, const Move *)
Update the search state after a move.
Definition: search.c:942
int selectivity
Definition: search.h:90
void search_restore_pass_midgame(Search *)
Update the search state after a passing move.
Definition: search.c:998
void search_set_task_number(Search *, const int)
Change the number of task.
Definition: search.c:847
void search_set_game_time(Search *, const long long)
set time to search.
Definition: search.c:671
Bound bound[BOARD_SIZE+2]
Definition: search.h:46
int level
Definition: search.h:27
bool can_update
Definition: search.h:128
Bound stability_bound
Definition: search.h:135
void search_set_observer(Search *, void(*Observer)(Result *))
set observer.
Definition: search.c:1095
HashTable pv_table[1]
Definition: search.h:104
volatile long long spent
Definition: search.h:126
struct Node * parent
Definition: ybwc.h:61