Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Something wrong with my futility pruning?

Author: Tim Foden

Date: 15:03:13 12/05/00

Go up one level in this thread


On December 05, 2000 at 16:46:17, Severi Salminen wrote:

>Hi!
>
>Check out this position:
>
>[D]rnbqkbnr/ppp2ppp/8/3pp3/3PP3/8/PPP2PPP/RNBQKBNR w
>
Without futility pruning GreenLight (2.12) does this:

>anal
 Game stage: Opening
 Current eval: 0.00
 Ply  Time  Score   Nodes  Principal Variation
  4   0.07   0.11    7011  dxe5 dxe4 Qxd8+ Kxd8 Bg5+ f6 Bh4
  4   0.13   0.11   12626  dxe5 dxe4 Qxd8+ Kxd8 Bg5+ f6 Bh4
  5   0.20   0.14   21844  dxe5 dxe4 Qxd8+ Kxd8 Bd2 Nc6 Nc3
  5   0.34   0.14   39475  dxe5 dxe4 Qxd8+ Kxd8 Bd2 Nc6 Nc3
  6   0.53   0.11   62262  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Ne2 Ne7
  6   1.06   0.11  122072  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Ne2 Ne7
  7   1.70   0.25  193419  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Nxe5 Ne2
  7   2.83   0.25  315878  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Nxe5 Ne2
  8   4.80   0.10  547795  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Ke8 Bd3
  8   9.59   0.10 1104039  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Ke8 Bd3
  9  15.18   0.23 1820354  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Bd2 Nc6 Nxe4 Bxd2+ Kxd2
Nxe5 Rd1
  9  23.66   0.23 2832132  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Bd2 Nc6 Nxe4 Bxd2+ Kxd2
Nxe5 Rd1
 10  46.89   0.15 5701743  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Be7 Bxe7+
Kxe7 Ng3 Bxc2 Nf3
 10   1:17   0.15 9407294  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Be7 Bxe7+
Kxe7 Ng3 Bxc2 Nf3
>exit
 local:  t=1:19  nps=121295.3  n=9602221  (f=1706584  q=7895637)
 total:  t=1:19  nps=121295.3  n=9602221
 ext:  check=275426  recap=60209  ppush=2981  1rep=13901  thrt=166
 q-moves:  gen=5989111  tested=3223797  made/un=1497282  max-dep=15
 max eval diff:  part-1=1.91  part-2=1.58

With futility pruning it does this:

>anal
 Game stage: Opening
 Current eval: 0.00
 Ply  Time  Score   Nodes  Principal Variation
  4   0.08   0.11    6947  dxe5 dxe4 Qxd8+ Kxd8 Bg5+ f6 Bh4
  4   0.13   0.11   12384  dxe5 dxe4 Qxd8+ Kxd8 Bg5+ f6 Bh4
  5   0.21   0.14   20146  dxe5 dxe4 Qxd8+ Kxd8 Bd2 Nc6 Nc3
  5   0.36   0.14   37108  dxe5 dxe4 Qxd8+ Kxd8 Bd2 Nc6 Nc3
  6   0.54   0.11   57676  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Ne2 Ne7
  6   1.07   0.11  109903  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Ne2 Ne7
  7   1.71   0.25  174778  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Nxe5 Ne2
  7   2.83   0.25  287706  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Nxe5 Ne2
  8   4.77   0.10  502250  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Ke8 Bd3
  8   9.53   0.10  990464  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Ke8 Bd3
  9  15.08   0.23 1615234  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Bd2 Nc6 Nxe4 Bxd2+ Kxd2
Nxe5 Rd1
  9  23.50   0.23 2514645  dxe5 dxe4 Qxd8+ Kxd8 Nc3 Bb4 Bd2 Nc6 Nxe4 Bxd2+ Kxd2
Nxe5 Rd1
 10  46.57   0.15 5046491  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Be7 Bxe7+
Kxe7 Ng3 Bxc2 Nf3
 10   1:16   0.15 8133475  dxe5 dxe4 Qxd8+ Kxd8 Nd2 Nc6 Nxe4 Bf5 Bg5+ Be7 Bxe7+
Kxe7 Ng3 Bxc2 Nf3
>exit
 local:  t=1:16  nps=106178.4  n=8174781  (f=1678606  q=6496175)
 total:  t=1:16  nps=106178.4  n=8174781
 ext:  check=271394  recap=58565  ppush=2785  1rep=13414  thrt=165
 q-moves:  gen=5911127  tested=3175621  made/un=1470532  max-dep=15
 max eval diff:  part-1=1.91  part-2=1.58

As you can see, there is a substancial saving in nodes/iteration.  There is no
time saving in GLC though.

The code I added to glc for this was:

	int	mat = m_wtm ? -m_material : m_material;
	if( !m_plyInfo[ply + 1].m_isCheck && depth < PLY &&
		mat + CPiece::Value(taken) + 150 < alpha )
	{
		UnMakeMove();
		nValidMoves++;	// assume we pruned a valid move
		continue;
	}


>
>Why the h?%l is the one without futility pruning faster and has less nodes? I
>use futility margin of 2 pawns.
>My futility code is something like: (I prune check now also...)
>
>if(depth==1)
>  if(futility_condition(Moves[k].value)<=alpha)
>    continue;
>
>the futility_condition() returns the current material balance + the material
>gain of the move+ 200.
>
>Any ideas?

Are you sure you have the material balance with the correct sign.  I initially
had it the wrong way around in GLC, and it made the node counts higher.

>
>BTW. Does my node counts look reasonable? I'm using MVV/LVA ordering in qsearch
>+ nullmoves (R=2).
>
>Severi



This page took 0 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.