LMR and PVS
Posted: Fri Feb 10, 2017 2:28 am
I saw some code that added LMR to an alpha/beta search and the approach made sense, but unfortunately, I've implemented PVS and I haven't seen a good example of the proper way to add LMR to the PVS framework.
Here is how I implemented PVS. I've taken out the extemporary stuff to make it readable.
From the CPW pages, a set of rules to control LPR as when NOT to use LMR follows:
•Still working on the first few moves
•Tactical moves (captures and promotions)
•Moves while in check
•Moves which give check
•Moves that cause a search extension
•Anytime in a PV-Node in a PVS search
•Depth < 3 (sometimes depth < 2)
I interpreted the rule "Anytime in a PV-Node in a PVS search" to mean, don't do a reduction in the above code shown here..
if that is correct, then that means the only places to the reduction are in the narrow window search or the research if the narrow window search fails. Or does it mean you have to scrap this model and use a different calling sequence.
Reducing the narrow search by 1-ply didn't seem to do much in way of speeding up my searches, so I'm a loss to know where to insert the reduction.
I don't just want to try stuff willy/nilly, I want to understand why I'm doing it.
any insight is appreciated.
Here is how I implemented PVS. I've taken out the extemporary stuff to make it readable.
Code: Select all
if (PVFound) // we already found the PV
{
score = -ABTT( depth - 1, -alpha - 1, -alpha, NO_PV, DO_NULL);
if ((score > alpha) && (score < beta))
score = -ABTT( depth - 1, -beta, -alpha, IS_PV, DO_NULL);
}
else // PV code goes here
score = -ABTT( depth - 1, -beta, -alpha, IsPV, DO_NULL);
•Still working on the first few moves
•Tactical moves (captures and promotions)
•Moves while in check
•Moves which give check
•Moves that cause a search extension
•Anytime in a PV-Node in a PVS search
•Depth < 3 (sometimes depth < 2)
I interpreted the rule "Anytime in a PV-Node in a PVS search" to mean, don't do a reduction in the above code shown here..
Code: Select all
else // PV code goes here
score = -ABTT( depth - 1, -beta, -alpha, IsPV, DO_NULL);
Reducing the narrow search by 1-ply didn't seem to do much in way of speeding up my searches, so I'm a loss to know where to insert the reduction.
I don't just want to try stuff willy/nilly, I want to understand why I'm doing it.
any insight is appreciated.