Skip to content

demoplay command doesn't work because of NPE #1163

@KvanTTT

Description

@KvanTTT

It calls getAverageTreeOwnership with uninitialized rootNode when the tool tries to write the current board state into console.

vector<double> Search::getAverageTreeOwnership(const SearchNode* node) const {
if(node == NULL)
node = rootNode;
if(!alwaysIncludeOwnerMap)
throw StringError("Called Search::getAverageTreeOwnership when alwaysIncludeOwnerMap is false");
vector<double> vec(nnXLen*nnYLen,0.0);
auto accumulate = [&vec,this](float* ownership, double selfProp){
for (int pos = 0; pos < nnXLen*nnYLen; pos++)
vec[pos] += selfProp * ownership[pos];
};
int64_t visits = node->stats.visits.load(std::memory_order_acquire);
//Stop deepening when we hit a node whose proportion in the final average would be less than this.
//Sublinear in visits so that the cost of this grows more slowly than overall search depth.
double minProp = 0.5 / pow(std::max(1.0,(double)visits),0.75);
//Entirely drop a node with weight less than this
double pruneProp = minProp * 0.01;
std::unordered_set<const SearchNode*> graphPath;
traverseTreeForOwnership(minProp,pruneProp,1.0,node,graphPath,accumulate);
return vec;
}

That causes Access violation reading location 0x00000050.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions