Computer Chess Club Archives


Search

Terms

Messages

Subject: History heuristic

Author: Sergei S. Markoff

Date: 01:32:12 03/18/04


Hello!

First try to index history depending of piece that moves. It's a "free"
improvement. I don't know why Crafty not doing it. See me code (it complicated a
little, but works ok):

#define KING				1
#define KNIGHT				2
#define PAWN				3
#define ROOK				5
#define BISHOP				6
#define QUEEN				7

const int history_group[8]={0,0,0,1,0,2,1,3};
int history[4][64*64*2];

<...>

void History(int Depth,MOVE mv)
{
 int index=((mv&4095)<<1)|SideToMove;
 int index1=history_group[M_PIECE(mv)];

 history[index1][index]+=Depth*Depth;

<...>

The second good idea is to right shift history in case of overflow at least.

 if(history[index1][index]>=MAX_HISTORY)
 {
  int i,j;
  for(j=0;j<4;j++) for(i=0;i<64*64*2;i++) history[j][i]>>=1;
 }

And a last near-free improvement is to include endgame flags into history index.
Or having queens. For example in endgame after queen promotion history values
becomes really unrelevant.

Best wishes,
Sergei.



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.