Got an idea yesterday based on an old idea I never got to work. It's about doing LMR at root moves. LMR at root moves hurts my engine but not that much. Now that I have added special code to it I get a nice improvement by fooling Alpha-Beta (AB) till a given iteration depth.
The idea is to do the first x iterations without AB. What's the effect? You get a fully sorted root move list based on the
real scores. I use these real values for LMR at root moves with a 0.12 margin and reduce one ply after all.
That's it. I call the technique AB_FOOL for the moment.
Some code snippets to clarify.
A value of 4 can be done in 0.1 sec most of the time.
if (ab_depth <= iteration_depth) { don't do AB; }
Only needed in the main-search, keep AB in QS.
Code: Select all
int root_score [max_moves]; // where the normal root scores are
int ab_fool_score [max_moves]; // shadow table for the ab_fool scores
int ab_margin = 12; // educuated guess for the moment.
When the AB_FOOL phase is over then for each root move do the following: get the real score of the root move from ab_fool_score and compare it with the highest real score of ab_fool_score with a margin of ab_margin and reduce one ply. Of course do the normal exclusion checks first (checks, captures etc.)
Possible improvements are:
1. Create 2 margins.
Code: Select all
int ab_margin_1 = 12; // reduce one ply
int ab_margin_2 = 100; // reduce one more
2. Since we are doing the x first iterations without AB we can count the nodes of each variation and store them. This can be used to improve move ordering. When 1-2-3...7 nodes all would give a "real" AB cut-off why not take the one with the lowest nodes as move for the hash table?