Closed lemonsqueeze closed 4 years ago
Something weird going on with tree garbage collection, Losing search results sometimes when analyze is resumed if it's allowed to happen, Investigate ...
The pondering hack shouldn't even work ! There's no way the logger thread can stop search - of which it is part - without deadlocking itself. I have no idea what's going on =)
Rewritten and cleaned up so it can be integrated properly, this is looking good now. Ended up adding flags support to the search api, trying to tweak it from the outside was getting really messy.
Turns out code was deadlocking but pthread_join() is smart enough to detect it and return right away. So just do it from a detached thread and check pthread_join() from now on.
I think I'll leave tree auto_alloc enabled by default,
Can be turned off with auto_alloc=0
or fixed_mem
uct parameters.
One issue is now max_tree_size
param is not the max amount of memory used for tree search anymore, just the initial amount. ie it can grow beyond max_tree_size which is confusing. I guess it'd be better to
tree_size
max_tree_size
meaning unchanged: don't grow tree memory beyond max_tree_sizeOr rename it and add something to control max memory:
tree_size
: amount of memory reserved for tree search initiallymax_mem
: max amount of memory Or simply
mem
: amount of memory reserved for tree search initiallymax_mem
: max amount of memorySettling on:
tree_size
: initial amount of memory allocated for tree searchmax_tree_size
: max amount tree memory can grow to (default: unlimited)max_mem
: max total amount (taking space needed for reallocation into account)
Attempt to automatically grow tree memory once tree is full. kind of
max_tree_size=auto
Right now you have to choose
max_tree_size
in advance which sucks if you don't know how much you're going to need: Pick too large and memory is wasted, too low and search stops when limit is reached... So idea is to seamlessly allocate a bigger tree, copy current one over and resume search when memory is full. Tricky because this needs to happen within search itself...Very much of a hack right now, But seems to be doing ok so far, can analyze forever in Sabaki or genmove / ponder over very long thinking times without having to worry about
max_tree_size
.