Hi Marco,elcabesa wrote:today I tried playing with history leaf pruning.
I simple calculate an average HistoryValue that cause alpha to raise indexed by the distance from the root.
Then at depth 1 I prune the quiet move with history <0.1 average HistoryValue.
some first test seems to give me an elo improvement. I'll try to be more precise tomorrow
Code: Select all
global... unsigned long long historyLeafPruningStat[50]={0}, historyLeafPruningCount[50]={0}; ..... ..... if (value>bestmove){ // SAVE AVERAGE HISTORY VALUE OF MOVES THAT RAISES ALPHA if(depth<=1){ historyLeafPruningStat[ply]+=historyTable[color][board.square[m.from]][m.to]; historyLeafPruningCount[ply]++; } } .... .... .... //INSIDE THE FUTILITY PRUNING // history leaf pruning if(depth<=1 && historyLeafPruningCount[ply]!=0 && historyTable[1-color][board.square[m.to]][m.to]<(float)historyLeafPruningStat[ply]/historyLeafPruningCount[ply]*0.1){ board.unmakeMove(); continue; }
I expect you should be able to get an sizeable improvement from this eventually

Some observations:
1. Why do you make the move before trying history leaf (and I presume also futility) pruning? It seems to me that this is a waste of CPU time.
2. Most engines index the history table by [color][piece][to] rather than by [color][from][to], possibly you might like to try it.
3. Eventually you should be able to prune more (0.1x seems very conservative) and also at higher remaining depths too, I would think.
4. Your idea of calculating an average history value by ply seems interesting! I haven't seen this before.
5. Have you tried pruning based on the number of quiet moves played instead (or maybe you already have late move pruning)? Stockfish does this, and it works for Toga too, e.g.:
Code: Select all
static const int QuietMoveCountLimit[6] = {0, 4, 7, 12, 19, 28};
// later in futility pruning ...
// move count based pruning
if (quiet_move_count >= QuietMoveCountLimit[depth])continue;
Jerry