Stockfish 1.8 tweaks

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
QED
Posts: 60
Joined: Thu Nov 05, 2009 8:53 pm

Stockfish 1.8 tweaks

Post by QED » Fri Jul 09, 2010 1:14 am

I will publish all my patches here in this thread.

First, I like makefile to compile fast and not to ask about architecture:

Code: Select all

diff -dur src-ja/Makefile src/Makefile
--- src-ja/Makefile     2010-06-30 03:19:38.000000000 +0200
+++ src/Makefile        2010-07-06 13:19:13.000000000 +0200
@@ -299,7 +299,7 @@
 ### ==========================================================================
 
 default:
-       $(MAKE) ARCH=$(ARCH) COMP=$(COMP) build
+       $(MAKE) ARCH=x86-32 COMP=gcc build
 
 help:
        @echo ""
@@ -408,7 +408,7 @@
        -strip $(BINDIR)/$(EXE)
 
 clean:
-       $(RM) $(EXE) *.o .depend *~ core bench.txt
+       $(RM) $(EXE) *.o .depend *~ core bench.txt *.gcda
 
 testrun:
        @$(PGOBENCH)
Second, I want ucinewgame to clear hash table, and this time also to clear pawn evaluation tables (not sure if I have done it correctly):

Code: Select all

diff -dur src/search.cpp src-Ch/search.cpp
--- src/search.cpp      2010-07-06 13:17:26.000000000 +0200
+++ src-Ch/search.cpp   2010-07-06 14:39:37.000000000 +0200
@@ -455,7 +455,7 @@
 
   // Read UCI option values
   TT.set_size(get_option_value_int("Hash"));
-  if (button_was_pressed("Clear Hash"))
+  if (button_was_pressed("Clear Hash") || button_was_pressed("New Game"))
       TT.clear();
 
   CheckExtension[1]         = Depth(get_option_value_int("Check Extension (PV nodes)"));
@@ -484,7 +484,7 @@
 
   // Set the number of active threads
   int newActiveThreads = get_option_value_int("Threads");
-  if (newActiveThreads != TM.active_threads())
+  if (newActiveThreads != TM.active_threads() || button_was_pressed("New Game"))
   {
       TM.set_active_threads(newActiveThreads);
       init_eval(TM.active_threads());
Third, I started to prepare HDE patch. It has many new features, but it is still not polished enough to actually increase elo.

But in the meantime, Tinapa 1.01 was released, so I cloned it back to Stockfish:

Code: Select all

diff -dur src-Ch/search.cpp src-TiCh/search.cpp
--- src-Ch/search.cpp   2010-07-06 14:39:37.000000000 +0200
+++ src-TiCh/search.cpp 2010-07-08 11:50:00.000000000 +0200
@@ -1185,7 +1185,7 @@
         ss->currentMove = MOVE_NULL;
 
         // Null move dynamic reduction based on depth
-        int R = 3 + (depth >= 5 * OnePly ? depth / 8 : 0);
+        int R = 3 + (depth >= 9 ? (depth - 3) / 6 : 0); // inspired by Tinapa 1.01
 
         // Null move dynamic reduction based on value
         if (refinedValue - beta > PawnValueMidgame)
and I saw it still uses 5*OnePly constant reduction for zugzwang verification of null search. I was patching that in 1.7.1 already, but this time I used testposition first, and I have come to conclusion that the best reduction for verification is exactly R:

Code: Select all

diff -dur src-TiCh/search.cpp src-TiAvCh/search.cpp
--- src-TiCh/search.cpp 2010-07-08 11:50:00.000000000 +0200
+++ src-TiAvCh/search.cpp       2010-07-08 11:48:37.000000000 +0200
@@ -1206,11 +1206,11 @@
                 nullValue = beta;
 
             // Do zugzwang verification search at high depths
-            if &#40;depth < 6 * OnePly&#41;
+            if &#40;depth-R*OnePly < OnePly&#41;
                 return nullValue;
 
             ss->skipNullMove = true;
-            Value v = search<NonPV>&#40;pos, ss, alpha, beta, depth-5*OnePly, ply&#41;;
+            Value v = search<NonPV>&#40;pos, ss, alpha, beta, depth-R*OnePly, ply&#41;;
             ss->skipNullMove = false;
 
             if &#40;v >= beta&#41;
And here is my first positive test: Tinapa with constant verification (first 3 patches together) lost to Tinapa with adaptive verification (all 4 patches) by +189 =597 -214 (++21 +=59 +-31 =+42 ==185 =-75 -+15 -=51 --21) that makes bayeselo to say LOS=19:80.

By the way, are there any known testpositions where accuracy (or speed, or both) of verification search is important?
Testing conditions:
tc=/0:40+.1 option.Threads=1 option.Hash=32 option.Ponder=false -pgnin gaviota-starters.pgn -concurrency 1 -repeat -games 1000
hash clear between games
make build ARCH=x86-64 COMP=gcc
around 680kps on 1 thread at startposition.

User avatar
rvida
Posts: 481
Joined: Thu Apr 16, 2009 10:00 am
Location: Slovakia, EU

Re: Stockfish 1.8 tweaks

Post by rvida » Fri Jul 09, 2010 10:30 am

Mate in 15, bm h3

[D]8/8/8/2p5/1pp5/brpp4/1pprp2P/qnkbK3 w - - 0 1

Most engines reach their maximum depth with a draw score.

User avatar
Eelco de Groot
Posts: 4156
Joined: Sun Mar 12, 2006 1:40 am
Location: Groningen

Re: Stockfish 1.8 tweaks

Post by Eelco de Groot » Fri Jul 09, 2010 11:46 am

Here is the output from Rainbow Serpent:

[D]8/8/8/2p5/1pp5/brpp4/1pprp2P/qnkbK3 w - -

Engine: Rainbow Serpent 1.8(s)dc Build 001 (Athlon 2009 MHz, 256 MB)
by Tord Romstad, Marco Costalba, Joona Kiiski

1.00 0:00 -59.07 1.h4 (6) 0

2.00 0:00 -59.27 1.h4 Qa2 (8) 0

3.00 0:00 -58.42 1.h4 Qa2 2.h5 Qa1 (17) 0

4.00 0:00 -57.73 1.h4 Qa2 2.h5 Qa1 3.h6 (27) 0

5.00 0:00 -57.93 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 (40) 0

6.00 0:00 -56.44++ 1.h4 Qa2 (52) 0

6.00 0:00 -56.44++ 1.h4 Qa2 (60) 0

6.00 0:00 -43.19++ 1.h4 Qa2 (69) 0

6.00 0:00 -43.19++ 1.h4 Qa2 (78) 0

6.00 0:00 -43.19++ 1.h4 Qa2 (87) 0

6.00 0:00 -43.19 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1
5.h8Q (99) 0

7.00 0:00 0.00++ 1.h4 Qa2 (141) 0

7.00 0:00 -43.19 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1
5.h8Q Qa2 6.Qh1 (162) 0

8.00 0:00 0.00++ 1.h4 Qa2 (191) 0

8.00 0:00 0.00++ 1.h4 Qa2 (205) 0

8.00 0:00 0.00++ 1.h4 Qa2 (219) 0

8.00 0:00 0.00 1.h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qh1 Qa1 7.Qh8 (6.258.694) 1065

65.01 0:06 0.00 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1
5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 (6.868.967) 1080

66.01 0:07 0.00 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1
5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 (7.776.459) 1086

67.01 0:08 0.00 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1
5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 (9.208.725) 1093

68.01 0:10 0.00 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1
5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 (11.234.999) 1096

69.01 0:12 0.00 1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1
5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 (13.738.024) 1097


69.02 0:12 +M19++ 1.h3 Qa2 (13.739.242) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.739.483) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.739.724) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.739.965) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.740.206) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.740.447) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.740.688) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.740.929) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.741.170) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.741.411) 1097

69.02 0:12 +M19++ 1.h3 Qa2 (13.741.652) 1097


69.02 0:14 +M15 1.h3 Qa2 2.h4 Qa1 3.h5 Qa2 4.h6 Qa1
5.h7 Qa2 6.h8N Qa1 7.Nf7 Qa2 8.Ng5 Qa1
9.Ne6 Qa2 10.Nxc5 Qa1 11.Nd7 Qa2
12.Ne5 Qa1 13.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ugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan

Michel
Posts: 2046
Joined: Sun Sep 28, 2008 11:50 pm

Not a problem for GnuChess!

Post by Michel » Fri Jul 09, 2010 11:50 am

[D]8/8/8/2p5/1pp5/brpp4/1pprp2P/qnkbK3 w - -


31 +99.71 5934 0:00.00 h3 Qa2 h4 Qa1 h5 Qa2 h6 Qa1 h7 Qa2 h8=N Qa1 Ng6 Qa2 Nf4 Qa1 Ne6 Qa2 Nxc5 Qa1 Nd7 Qa2 Ne5 Qa1 Nxc4 Qa2 Na5 Qa1 Nxb3#
31 +99.71 5775 0:00.00 h3 Qa2 h4 Qa1 h5 Qa2 h6 Qa1 h7 Qa2 h8=N Qa1 Ng6 Qa2 Nf4 Qa1 Ne6 Qa2 Nxc5 Qa1 Nd7 Qa2 Ne5 Qa1 Nxc4 Qa2 Na5 Qa1 Nxb3#
31 +99.71 5329 0:00.00 h3!
30 0.00 5223 0:00.00 h3 Qa2 h4 Qa1 h5 Qa2 h6 Qa1 h7 Qa2 h8=N Qa1 Ng6 Qa2 Nf4 Qa1 Ne6 Qa2 Nxc5 Qa1 Nd7 Qa2 Ne5 Qa1 Nd7
29 0.00 4741 0:00.00 h3 Qa2 h4 Qa1 h5 Qa2 h6 Qa1 h7 Qa2 h8=N Qa1 Ng6 Qa2 Nf4 Qa1 Ne6 Qa2 Nxc5 Qa1 Nd7 Qa2 Ne5 Qa1 Nd7
28 0.00 4280 0:00.00 h3 Qa2 h4 Qa1 h5 Qa2 h6 Qa1 h7 Qa2 h8=N Qa1 Ng6 Qa2 Nf4 Qa1 Ne6 Qa2 Nxc5 Qa1 Nd7 Qa2 Ne5 Qa1 Nd7
27 0.00 3872 0:00.00 h3 Qa2 h4 Qa1 h5 Qa2 h6 Qa1 h7 Qa2 h8=N Qa1 Ng6 Qa2 Nf4 Qa1 Ne6 Qa2 Nxc5 Qa1 Nd7 Qa2 Ne5 Q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2
5 +99.71 231 0:00.00 h3!
5 -49.26 227 0:00.00 h4 Qa2 h5 Qa1 h6 Qa2
4 -49.13 209 0:00.00 h4 Qa2 h5 Qa1
4 -49.25 203 0:00.00 h3 Qa2 h4 Qa1
4 +99.71 197 0:00.00 h3!
4 -49.13 190 0:00.00 h4 Qa2 h5 Qa1
4 0.00 184 0:00.00 h4!
3 -53.89 159 0:00.00 Kf2 e1=Q+ Kxe1 Rxh2 Kf1
3 -53.87 110 0:00.00 :-(
3 -52.78 100 0:00.00 :-(
3 -51.78 68 0:00.00 :-(
3 +99.71 41 0:00.00 h3!
2 -49.60 31 0:00.00 h4 Qa2
2 -49.92 28 0:00.00 h3 Qa2
2 +99.71 25 0:00.00 h3!
2 -49.60 24 0:00.00 h4 Qa2
2 -48.10 21 0:00.00 h4!
1 -54.05 17 0:00.00 h4

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 7:17 pm

Re: Stockfish 1.8 tweaks

Post by mcostalba » Fri Jul 09, 2010 12:06 pm

QED wrote:I will publish all my patches here in this thread.
Hi Vratko,

nice patches, especially the one on zugzwang verification deserves better understanding, I guess the name is no more appropiate now, if it works I am not sure is due to avoiding zugzwang positions, or due to something else.

As an experimento should be very interesting to print positions where original code fails high and new zugzwang verification fails low so to see if this extra caught positions are actually zugzwang positions or there is something else here going on.

P.S: I really appreciate your verification with 1000 games at 1 minute testing before to post results ;-)

LucenaTheLucid
Posts: 197
Joined: Mon Jul 13, 2009 12:16 am

Re: Stockfish 1.8 tweaks

Post by LucenaTheLucid » Fri Jul 09, 2010 10:56 pm

Stockfish 1.8 JA TACTICAL in 5 seconds.

Code: Select all

New game
8/8/8/2p5/1pp5/brpp4/1pprp2P/qnkbK3 w - - 0 1

Analysis by Stockfish 1.8 JA TACTICAL&#58;

1.h4 Qa2 
  -+  (-56.32 !)   Depth&#58; 6   00&#58;00&#58;00  0kN
1.h4 Qa2 
  -+  (-56.32 !)   Depth&#58; 6   00&#58;00&#58;00  0kN
1.h4 Qa2 
  -+  (-43.07 !)   Depth&#58; 6   00&#58;00&#58;00  0kN
1.h4 Qa2 
  -+  (-43.07 !)   Depth&#58; 6   00&#58;00&#58;00  0kN
1.h4 Qa2 
  -+  (-43.07 !)   Depth&#58; 6   00&#58;00&#58;00  0kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q 
  -+  (-43.07&#41;   Depth&#58; 6   00&#58;00&#58;00  0kN
1.h4 Qa2 
  =  &#40;0.00 !)   Depth&#58; 7   00&#58;00&#58;00  0kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 
  -+  (-43.11&#41;   Depth&#58; 7   00&#58;00&#58;00  0kN
1.h4 Qa2 
  =  &#40;0.00 !)   Depth&#58; 8   00&#58;00&#58;00  0kN
1.h4 Qa2 
  =  &#40;0.00 !)   Depth&#58; 8   00&#58;00&#58;00  0kN
1.h4 Qa2 
  =  &#40;0.00 !)   Depth&#58; 8   00&#58;00&#58;00  0kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 8   00&#58;00&#58;00  0kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 9   00&#58;00&#58;00  0kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 10   00&#58;00&#58;00  1kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 11   00&#58;00&#58;00  1kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.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Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 21   00&#58;00&#58;00  13kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 22   00&#58;00&#58;00  16kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 23   00&#58;00&#58;00  21kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 24   00&#58;00&#58;00  27kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 25   00&#58;00&#58;00  33kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 26   00&#58;00&#58;00  40kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 27   00&#58;00&#58;00  49kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 28   00&#58;00&#58;00  58kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 29   00&#58;00&#58;00  71kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 30   00&#58;00&#58;00  82kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 31   00&#58;00&#58;00  92kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 32   00&#58;00&#58;00  107kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 33   00&#58;00&#58;00  125kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 34   00&#58;00&#58;00  143kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 35   00&#58;00&#58;00  166kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 36   00&#58;00&#58;00  194kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 37   00&#58;00&#58;00  232kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 38   00&#58;00&#58;00  269kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 39   00&#58;00&#58;00  316kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 40   00&#58;00&#58;00  370kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 41   00&#58;00&#58;00  423kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 42   00&#58;00&#58;00  476kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 43   00&#58;00&#58;00  515kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 44   00&#58;00&#58;00  615kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 45   00&#58;00&#58;01  666kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 46   00&#58;00&#58;01  754kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 47   00&#58;00&#58;01  847kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 48   00&#58;00&#58;01  978kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 49   00&#58;00&#58;01  1107kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 50   00&#58;00&#58;01  1245kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 51   00&#58;00&#58;01  1356kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 52   00&#58;00&#58;01  1540kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 53   00&#58;00&#58;01  1663kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 54   00&#58;00&#58;01  1889kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 55   00&#58;00&#58;01  2157kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 56   00&#58;00&#58;02  2451kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 57   00&#58;00&#58;02  2778kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 58   00&#58;00&#58;02  3059kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 59   00&#58;00&#58;02  3366kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 60   00&#58;00&#58;02  3821kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 61   00&#58;00&#58;03  4333kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 62   00&#58;00&#58;03  5113kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 63   00&#58;00&#58;04  6060kN
1.h4 Qa2 2.h5 Qa1 3.h6 Qa2 4.h7 Qa1 5.h8Q Qa2 6.Qh1 Qa1 7.Qh8 
  =  &#40;0.00&#41;   Depth&#58; 64   00&#58;00&#58;05  7706kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7708kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7708kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7709kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7709kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7709kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7709kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7710kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7710kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7710kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7710kN
1.h3 Qa2 
  +-  (#15 !)   Depth&#58; 64   00&#58;00&#58;05  7711kN
1.h3 Qa2 2.h4 Qa1 3.h5 Qa2 4.h6 Qa1 5.h7 Qa2 6.h8N Qa1 7.Nf7 Qa2 8.Ne5 Qa1 9.Nd7 Qa2 10.Nxc5 Qa1 11.Nb7 Qa2 12.Nd6 Qa1 13.Nxc4 Qa2 14.Na5 Qa1 
  +-  (#15&#41;   Depth&#58; 64   00&#58;00&#58;06  10182kN
1.h3 Qa2 2.h4 Qa1 3.h5 Qa2 4.h6 Qa1 5.h7 Qa2 6.h8N Qa1 7.Nf7 Qa2 8.Ne5 Qa1 9.Nd7 Qa2 10.Nxc5 Qa1 11.Nb7 Qa2 12.Nd6 Qa1 13.Nxc4 Qa2 14.Na5 Qa1 
  +-  (#15&#41;   Depth&#58; 65   00&#58;00&#58;06  10853kN
1.h3 Qa2 2.h4 Qa1 3.h5 Qa2 4.h6 Qa1 5.h7 Qa2 6.h8N Qa1 7.Nf7 Qa2 8.Ne5 Qa1 9.Nd7 Qa2 10.Nxc5 Qa1 11.Nb7 Qa2 12.Nd6 Qa1 13.Nxc4 Qa2 14.Na5 Qa1 
  +-  (#15&#41;   Depth&#58; 66   00&#58;00&#58;09  17596kN
1.h3 Qa2 2.h4 Qa1 3.h5 Qa2 4.h6 Qa1 5.h7 Qa2 6.h8N Qa1 7.Nf7 Qa2 8.Ne5 Qa1 9.Nd7 Qa2 10.Nxc5 Qa1 11.Nb7 Qa2 12.Nd6 Qa1 13.Nxc4 Qa2 14.Na5 Qa1 
  +-  (#15&#41;   Depth&#58; 67   00&#58;00&#58;10  18085kN

&#40;Computer,  09.07.2010&#41;

QED
Posts: 60
Joined: Thu Nov 05, 2009 8:53 pm

Re: Stockfish 1.8 tweaks

Post by QED » Sat Jul 10, 2010 5:41 am

@Richard: What is this testposition doing in my thread? I see, Stockfish 1.8 gets this at depth 75 (single thread), and my adaptive verification does not get it till max depth (100). But this serial single move zugzwang is so rare that it does not affect elo in any measurable way. And I really do not like the fact that you made me to spend half a day to develop a signle move zugzwang detection (and then cancellation of any reductions) patch. :) It is still buggy, so no publication yet.

Anyway, I have another patch and test to publish. It is a worsening patch (relative to dynamic Tinapa), but a configurable (therefore promising) one. The motivation this time was the fact, that Chris Formula's formula

Code: Select all

int R = 3 + &#40;depth >= 9 ? &#40;depth - 3&#41; / 6 &#58; 0&#41;; // inspired by Tinapa 1.01
violates the null search condition

Code: Select all

&&  refinedValue >= beta - &#40;depth >= 4 * OnePly ? NullMoveMargin &#58; 0&#41;
at depth == 9 (== 4.5*OnePly).

So I decided to compute the null (and verification) reductions in halfplies. This was tested way before, seeming to be weaker, so I had some creating and tuning to do. After playing with my pet testposition [D]r1bqkb1r/pppp2pp/2n2n2/8/3Q4/2N2N2/PPP2PPP/R1B1KB1R w KQkq - 2 8 [/D]I figured defaults for the two UCI options I introduced:

Code: Select all

diff -dur src-Ch/ucioption.cpp src-TiAvsCh/ucioption.cpp
--- src-Ch/ucioption.cpp        2010-07-06 13&#58;17&#58;26.000000000 +0200
+++ src-TiAvsCh/ucioption.cpp   2010-07-09 05&#58;45&#58;57.000000000 +0200
@@ -101,6 +101,8 @@
     o&#91;"Passed Pawn Extension &#40;non-PV nodes&#41;"&#93; = Option&#40;0, 0, 2&#41;;
     o&#91;"Pawn Endgame Extension &#40;PV nodes&#41;"&#93; = Option&#40;2, 0, 2&#41;;
     o&#91;"Pawn Endgame Extension &#40;non-PV nodes&#41;"&#93; = Option&#40;2, 0, 2&#41;;
+    o&#91;"Null Reduction Base &#40;halfplies&#41;"&#93; = Option&#40;5, -2, 10&#41;;
+    o&#91;"Verification Reduction Shift &#40;halfplies&#41;"&#93; = Option&#40;-4, -10, 10&#41;;
     o&#91;"Randomness"&#93; = Option&#40;0, 0, 10&#41;;
     o&#91;"Minimum Split Depth"&#93; = Option&#40;4, 4, 7&#41;;
     o&#91;"Maximum Number of Threads per Split Point"&#93; = Option&#40;5, 4, 8&#41;;
for ucioptions.cpp and for search.cpp:

Code: Select all

diff -dur src-Ch/search.cpp src-TiAvsCh/search.cpp
--- src-Ch/search.cpp   2010-07-06 14&#58;39&#58;37.000000000 +0200
+++ src-TiAvsCh/search.cpp      2010-07-09 05&#58;25&#58;43.000000000 +0200
@@ -175,6 +175,8 @@
 
   // Step 8. Null move search with verification search
 
+  Depth NullHalfplyBase, NullHalfplyShift;
+
   // Null move margin. A null move search will not be done if the static
   // evaluation of the position is more than NullMoveMargin below beta.
   const Value NullMoveMargin = Value&#40;0x200&#41;;
@@ -458,6 +460,9 @@
   if &#40;button_was_pressed&#40;"Clear Hash") || button_was_pressed&#40;"New Game"))
       TT.clear&#40;);
 
+  NullHalfplyBase  = Depth&#40;get_option_value_int&#40;"Null Reduction Base &#40;halfplies&#41;"));
+  NullHalfplyShift = Depth&#40;get_option_value_int&#40;"Verification Reduction Shift &#40;halfplies&#41;"));
+
   CheckExtension&#91;1&#93;         = Depth&#40;get_option_value_int&#40;"Check Extension &#40;PV nodes&#41;"));
   CheckExtension&#91;0&#93;         = Depth&#40;get_option_value_int&#40;"Check Extension &#40;non-PV nodes&#41;"));
   SingleEvasionExtension&#91;1&#93; = Depth&#40;get_option_value_int&#40;"Single Evasion Extension &#40;PV nodes&#41;"));
@@ -1177,7 +1182,7 @@
     if (   !PvNode
         && !ss->skipNullMove
         &&  depth > OnePly
-        &&  refinedValue >= beta - &#40;depth >= 4 * OnePly ? NullMoveMargin &#58; 0&#41;
+        &&  refinedValue >= beta - &#40;depth - NullHalfplyBase - depth / 3 >= OnePly ? NullMoveMargin &#58; 0&#41;
         && !isCheck
         && !value_is_mate&#40;beta&#41;
         &&  pos.non_pawn_material&#40;pos.side_to_move&#40;)))
@@ -1185,17 +1190,23 @@
         ss->currentMove = MOVE_NULL;
 
         // Null move dynamic reduction based on depth
-        int R = 3 + &#40;depth >= 5 * OnePly ? depth / 8 &#58; 0&#41;;
+        int R2 = NullHalfplyBase + depth / 3; // R2 is reduction in halfplies
 
         // Null move dynamic reduction based on value
+        if &#40;refinedValue - beta > PawnValueMidgame / 3&#41;
+            R2++;
         if &#40;refinedValue - beta > PawnValueMidgame&#41;
-            R++;
+            R2++;
+        if &#40;refinedValue - beta > PawnValueMidgame * 3&#41;
+            R2++;
+        if &#40;refinedValue - beta > PawnValueMidgame * 9&#41;
+            R2++;
 
         pos.do_null_move&#40;st&#41;;
         &#40;ss+1&#41;->skipNullMove = true;
 
-        nullValue = depth-R*OnePly < OnePly ? -qsearch<NonPV>&#40;pos, ss+1, -beta, -alpha, Depth&#40;0&#41;, ply+1&#41;
-                                            &#58; - search<NonPV>&#40;pos, ss+1, -beta, -alpha, depth-R*OnePly, ply+1&#41;;
+        nullValue = depth-R2 < OnePly ? -qsearch<NonPV>&#40;pos, ss+1, -beta, -alpha, Depth&#40;0&#41;, ply+1&#41;
+                                      &#58; - search<NonPV>&#40;pos, ss+1, -beta, -alpha, depth-R2, ply+1&#41;;
         &#40;ss+1&#41;->skipNullMove = false;
         pos.undo_null_move&#40;);
 
@@ -1205,12 +1216,14 @@
             if &#40;nullValue >= value_mate_in&#40;PLY_MAX&#41;)
                 nullValue = beta;
 
+            R2 += NullHalfplyShift;
+
             // Do zugzwang verification search at high depths
-            if &#40;depth < 6 * OnePly&#41;
+            if &#40;depth-R2 < OnePly&#41;
                 return nullValue;
 
             ss->skipNullMove = true;
-            Value v = search<NonPV>&#40;pos, ss, alpha, beta, depth-5*OnePly, ply&#41;;
+            Value v = search<NonPV>&#40;pos, ss, alpha, beta, depth-R2, ply&#41;;
             ss->skipNullMove = false;
 
             if &#40;v >= beta&#41;
So, this patch (tested upon the first two in this thread) lost a match to dynamic Tinapa, but only narrowly (+198 =583 -219 which means LOS=22:77). It still indirectly implies that it is maybe better than constant Tinapa (LOS=52:47). I will test that directly.

@Marco: I examined few games from the match (static vs dynamic Tinapa) but it all looked like a noise. Maybe zugzwangs are not so common, and speeding up verification search generally helps more then hurts. As for the recent patch, it really looks more like relatively small null scout and heavier reduced search (also at lower depths), instead of (relatively) fat null search and lighter verification. Maybe, some time in the future, my idea of returning verification value (instead of null value) would start to gain nonnegative elo. I think that the main risk of doing big reductions (in either searches of step 8) is usually not falling for zugzwang traps, but underestimating sidelines that have score steadily increasing with search depth (aka converting initiative).
Testing conditions:
tc=/0:40+.1 option.Threads=1 option.Hash=32 option.Ponder=false -pgnin gaviota-starters.pgn -concurrency 1 -repeat -games 1000
hash clear between games
make build ARCH=x86-64 COMP=gcc
around 680kps on 1 thread at startposition.

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 7:17 pm

Re: Stockfish 1.8 tweaks

Post by mcostalba » Sat Jul 10, 2010 8:31 am

QED wrote:I think that the main risk of doing big reductions (in either searches of step 8) is usually not falling for zugzwang traps, but underestimating sidelines that have score steadily increasing with search depth (aka converting initiative).
I also would think this especially if the deeper verification search works, it measn is no more zugzwang we are talking about but a wider set of positions wrongly evaluated by null search.

Intuitively _could_ work the idea of reducing null depth and countereffect this deepening verification search, but this is a tricky proposition to test because you need a double change and is not easy to split the good from the bad when you test more then one change at the same time.

OTOH is not so clear that say a null search at depth 13 + verification at depth 8 is equivalent or even better then null search at depth 11 and verification at depth 10. Because with the null search in the first case you reach depths never reached by the second approach.

Uri Blass
Posts: 8586
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: Stockfish 1.8 tweaks

Post by Uri Blass » Sat Jul 10, 2010 10:47 am

rvida wrote:Mate in 15, bm h3

[D]8/8/8/2p5/1pp5/brpp4/1pprp2P/qnkbK3 w - - 0 1

Most engines reach their maximum depth with a draw score.
Movei see the mate at depth 20.

It does not use null move pruning here.
I guess that most engines use null move pruning
single reply extensions for the cases that the opponent has material advantage together with disabling null move pruning when the opponent has a very small number of legal moves can help to solve it.

In movei I disable null move pruning when the number of moves is smaller than 9.

I guess that the stockfish team did not even try it and I do not plan to work on the stockfish code in the near future but maybe another person is going to be interested in implementing this idea in stockfish and testing it.

In this case
the first question is if it is possible to implement it in stockfish in a way that it does not make stockfish significantly slower in nodes per seconds.

Note that if you see that counting the number of legal moves cause the program to become significantly slower you can do it only in cases when the depth is big enough that means that the rules for allowing null move pruning and extensions may be the same when the depth is smaller than 7(or different number) and only when the depth is bigger you simply count the number of legal moves to decide about extensions and null move pruning.

Uri

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 7:17 pm

Re: Stockfish 1.8 tweaks

Post by mcostalba » Sat Jul 10, 2010 11:06 am

Uri Blass wrote: I guess that the stockfish team did not even try it and I do not plan to work on the stockfish code in the near future but maybe another person is going to be interested in implementing this idea in stockfish and testing it.
In SF move generation is staged, so you don't know the number of possible moves of a node until the last stage is reached.

As you can imagine ;-) I don't like a lot the idea to tweak the staging move generation with tricks like: if we are at depth > 9 generate all the moves otherwise stage them...but of course, as always, if someone likes the idea enough to write the patch, test it and prove is better then current I, gladly, am very happy to change my mind :-)

Post Reply