Yes, indeed. This code should hopefully be correct:elcabesa wrote:doing it this way you tell the engine to search a first CUT node and it it fail an ALL node, but you don't tell anything about their child.Code: Select all
if (node_type == PV && first) // search full window score = -search(B, -beta, -alpha, new_depth, PV, ss+1); else { // zero window search (reduced) // we expect the child node to fail high, so we predict a 'Cut' node, right ? score = -search(B, -alpha-1, -alpha, new_depth - ss->reduction, Cut, ss+1); // doesn't fail low: verify at full depth, with zero window if (score > alpha && ss->reduction) // we expect the child node to fail low again, so we predict a 'All' node, right ? score = -search(B, -alpha-1, -alpha, new_depth, All, ss+1); // still doesn't fail low at PV node: full depth and full window if (node_type == PV && score > alpha) score = -search(B, -beta, -alpha, new_depth , PV, ss+1); }
If you search a node as a CUT node then you search all his child as a cut node too ..
maybe you can find some idea here http://chessprogramming.wikispaces.com/ ... rd+Pruning
Code: Select all
if (node_type == PV && first)
// search full window
score = -search(B, -beta, -alpha, new_depth, PV, ss+1);
else
{
const int prediction = node_type == PV ? Cut : (node_type == Cut ? All : Cut);
// zero window search (reduced)
score = -search(B, -alpha-1, -alpha, new_depth - ss->reduction, prediction, ss+1);
// doesn't fail low: verify at full depth, with zero window
if (score > alpha && ss->reduction)
/* should we do 'All' or 'prediction' here ? we expect the child to fail low (with or without reduction). but at the same time, we need to give it a chance to fail high, so if search behaves differently for types of nodes, this can be dangerous. */
score = -search(B, -alpha-1, -alpha, new_depth, prediction, ss+1);
// still doesn't fail low at PV node: full depth and full window
if (is_pv && score > alpha)
score = -search(B, -beta, -alpha, new_depth , PV, ss+1);
}


