Thanks in advance, Volker for any results you would share!
In the meantime, I allowed myself to try this with an old version of Glaurung (namely 0.2.3) because of
the similar way the history is used for ordering. I really hope that Tord wouldn't mind if i post some code.
Originally, the history update was done like that:
Code: Select all
void inc_history(move_t m, int side, int depth, int value) {
if(!CAPTURE(m) && !PROMOTION(m)) {
HISTORY(side, m) += (depth>>5);
FailHighStats[HINDEX2(m)].success++;
SearchStack[Ply].killer2 = SearchStack[Ply].killer;
SearchStack[Ply].killer = m;
}
if(value==MATE_VALUE-Ply-1) SearchStack[Ply].mate_killer = m;
}
I separated the killers and history:
Code: Select all
void inc_history(move_t m, int side, int depth, int value) {
if(!CAPTURE(m) && !PROMOTION(m))
HISTORY(side, m) += (depth>>5);
}
void inc_killers(move_t m, int side, int depth, int value) {
if(!CAPTURE(m) && !PROMOTION(m)) {
FailHighStats[HINDEX2(m)].success++;
SearchStack[Ply].killer2 = SearchStack[Ply].killer;
SearchStack[Ply].killer = m;
}
if(value==MATE_VALUE-Ply-1) SearchStack[Ply].mate_killer = m;
}
and then in search and root search instead of:
Code: Select all
//main search:
if(value>bestvalue) {
bestvalue = value;
if(value>alpha) {
alpha = value;
update_pv(move);
if(value>=beta) {
inc_history(move, Side, depth, value);
break;
}
}
}
//root search:
if(value>bestvalue) {
bestvalue = value;
if(value>alpha) {
alpha = value;
update_pv(move);
update_root_pv();
if(iteration>1) print_pv(iteration, value);
if(value>=beta) {
inc_history(move, Side, depth, value);
break;
}
}
I did it the way I've already described:
Code: Select all
//main search:
if(value>bestvalue) {
bestvalue = value;
if(value>alpha) {
alpha = value;
update_pv(move);
if(value>=beta) {
inc_killers(move, Side, depth, value);
break;
}
inc_history(move, Side, depth, value);
}
}
//root search:
if(value>bestvalue) {
bestvalue = value;
if(value>alpha) {
alpha = value;
update_pv(move);
update_root_pv();
if(iteration>1) print_pv(iteration, value);
if(value>=beta) {
inc_killers(move, Side, depth, value);
break;
}
inc_history(move, Side, depth, value);
}
}
These are the only changes and compiles are both equivalent. And here are some quick head-to-head results:
Code: Select all
Rank Name Elo + - games score oppo. draws
1 Glaurung 0.2.3-h 17 14 14 400 55% -17 42%
2 Glaurung 0.2.3 -17 14 14 400 45% 17 42%
Glaurung-h is the modified.
I've noticed that in Fire Xtreme this is named good and bad history, but I guess it's not so bad
at all and it's the ONLY history usage that is giving me some good results.
The reason to write all of this is just a request to anybody who is willing to test it.
I'm sorry in advance if your time gets wasted by this, but either I've had the very unfortunate luck
to get the wrong results over and over again, or it's just works better.
History is used in move ordering like:
every move that is not the bestmove, capture, promotion or killer gets scored from the history array.