Designing an analysis friendly Stockfish?

Code, algorithms, languages, construction...
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Mon Feb 14, 2011 3:14 pm

Uly wrote:Well, yes, the improvement is self-evident, here's an example of a common scenario.

One is analyzing with a margin of 1 centipawn, which means, new mainlines are considered when they beat the old mainline by 0.01, but mainlines with the same score have to be tie-broken (this is trivial, one goes to the tail and forces moves until the score gets +0.01 or -0.01).

Now, assume some deep move of 1.e4 e5 2.Nf3 Nc6 3.Bb5 is scored as 0.16 and falls over the margin, which means one would like to examine early white alternatives that are >0.16. But there's 1.e4 e5 2.Nf3 Nc6 3.Bc4 with a score of 0.16, so one has to examine it deeper until it goes higher (becomes new mainline) or lower (gets refuted so one searches for another alternative, or goes earlier in the mainline to search for better moves, or goes back to extending Bb5).

With granularity=8 one has to examine 3.Bc4 until it goes to either 0.24 or 0.08, which will take a while longer than with granularity=1 where it's very likely that Bb5 and Bc4 don't tie at all, so Bc4 becomes new mainline automatically or the margin can be higher.

This is just an example of an analysis method, but low granularity is conceptually better, for complex positions that don't transpose where one doesn't want to have to refute futile variations, one would even wish to have millipawns granularity available, or something.

Your implementation is working great, since it was granularity=2 I had expected to see only odd or even evaluations but I'm seeing jumps of one centipawn (such as from -0.96 to -0.95) without problems.
It's GrainSize / 100 * (100/198) which works out, when GrainSize is 8 (default), to 0.04. With GrainSize of 2, granularity is 0.01. 198 is the weight of a pawn in the middlegame.

Anyway, glad it's working. When you have a sec, check out some endgame positions and let me know if you see anything grainy...

Jeremy

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Mon Feb 14, 2011 6:00 pm

Engine                         Score                                      St                                    St                                    St                                    St    S-B
Stockfish_201_PA_GTB_Gran2_x64 61,0/109 ····································· 0010=001=1=0100111101101101001001110  1010011=1010111=01=11111000000=111101 100001100101=1=111001001010011111=11   3177,2
Stockfish_201_64_PA_La         58,5/109 1101=110=0=1011000010010010110110001  ····································· 1001010111111000=0111001=10011111100  1110110011011101001010101100101010010  3088,0
Stockfish_201_PAMC_GTBg_x64    50,5/109 0101100=0101000=10=00000111111=000010 0110101000000111=1000110=01100000011  ····································· 111010001100111=11011101110000111000   2776,5
Stockfish-201-64-ja            48,0/109 011110011010=0=000110110101100000=00  0001001100100010110101010011010101101 000101110011000=00100010001111000111  ·····································  2722,7

218 of 600 games played
Level: Blitz 0:05/0,1
Hardware: Intel(R) Xeon(R) CPU  W3520 @ 2.67GHz 2659 MHz with 1,0 GB Memory
Operating system: Windows 7 Professional Professional (Build 7600) 64 bit
Doesn't seem like the improved granularity hurts it. These results don't indicate much more than that; it's simply not getting trampled.

Jeremy

ernest
Posts: 247
Joined: Thu Sep 02, 2010 10:33 am

Re: Designing an analysis friendly Stockfish?

Post by ernest » Mon Feb 14, 2011 9:50 pm

mcostalba wrote:error bar comes from: 40 / sqrt($wins + $losses + $draws) * 7
My 95% error bar (2*Standard Deviation) comes from: 700 * sqrt($wins + $losses) / ($games)
(formula assumes the result of the games is near 50-50)

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Tue Feb 15, 2011 9:27 pm

So that tournament ended well for the Gran2 version:
Engine                         Score                                                                                                      St                                                                                                   St                                                                                                   St                                                                                                   St    S-B
Stockfish_201_PAMC_GTBg_x64    165,5/300 ···································································································· 0101100=0101000=10=00000111111=000010110001101111101011011110101111010001=110101101011=0010110101111 0110101000000111=1000110=01100000011110110011111110111010111111001000001111011101=0=1011110011101101 111010001100111=110111011100001110000100001000111000101111001111111011101111100100100011001000001011  23978,
Stockfish_201_PA_GTB_Gran2_x64 157,0/300 1010011=1010111=01=11111000000=111101001110010000010100100001010000101110=001010010100=1101001010000 ···································································································· 0010=001=1=01001111011011010010011100111111=01110110000111011001001001010100110011110111001000010100 100001100101=1=111001001010011111=1110101010111111101110111011000=000=0110011111111110010100011=1101  22961,
Stockfish_201_64_PA_La         142,0/300 1001010111111000=0111001=10011111100001001100000001000101000000110111110000100010=1=0100001100010010 1101=110=0=10110000100100101101100011000000=10001001111000100110110110101011001100001000110111101011 ···································································································· 1110110011011101001010101100101010010011100101000100001001100111011001101110110101011110001000000111  21563,
Stockfish-201-64-ja            135,5/300 000101110011000=001000100011110001111011110111000111010000110000000100010000011011011100110111110100 011110011010=0=000110110101100000=0001010101000000010001000100111=111=1001100000000001101011100=0010 0001001100100010110101010011010101101100011010111011110110011000100110010001001010100001110111111000 ····································································································  20933,

600 games played / Tournament is finished
Level: Blitz 0:05/0,1
Hardware: Intel(R) Xeon(R) CPU  W3520 @ 2.67GHz 2659 MHz with 1,0 GB Memory
Operating system: Windows 7 Professional Professional (Build 7600) 64 bit
I would call it a tie.

jb

User avatar
Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: Designing an analysis friendly Stockfish?

Post by Uly » Wed Feb 16, 2011 3:34 am

Still nice to see Default at the bottom ;)

snino64
Posts: 10
Joined: Fri Jul 09, 2010 12:45 am
Real Name: Benigno Hdez

Re: Designing an analysis friendly Stockfish?

Post by snino64 » Wed Feb 16, 2011 10:15 am

I have a problem with the use of end tables Gaviota
Why if you put the value multipv 3, 5, 7 or an odd number the engine does not return the main line?
If multipv = 3, returns the second and third line (two lines)
If you do not use the end tables work correctly
I'm using scid.

snino64
Posts: 10
Joined: Fri Jul 09, 2010 12:45 am
Real Name: Benigno Hdez

Re: Designing an analysis friendly Stockfish?

Post by snino64 » Wed Feb 16, 2011 10:20 am

I have a problem with the use of end tables Gaviota
Why if you put the value multipv 3, 5, 7 or an odd number the engine does not return the main line?
If multipv = 3, returns many times the second and third line (two lines) and lack the main line
If you do not use the end tables work correctly
I'm using scid.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Wed Feb 16, 2011 12:40 pm

snino64 wrote:I have a problem with the use of end tables Gaviota
Why if you put the value multipv 3, 5, 7 or an odd number the engine does not return the main line?
If multipv = 3, returns the second and third line (two lines)
If you do not use the end tables work correctly
I'm using scid.
Thanks. I'll check it out.

jb

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Designing an analysis friendly Stockfish?

Post by Jeremy Bernstein » Wed Feb 16, 2011 5:11 pm

Jeremy Bernstein wrote:
snino64 wrote:I have a problem with the use of end tables Gaviota
Why if you put the value multipv 3, 5, 7 or an odd number the engine does not return the main line?
If multipv = 3, returns the second and third line (two lines)
If you do not use the end tables work correctly
I'm using scid.
Thanks. I'll check it out.

jb
Can you please try this version? I've refined the GTB access at the root a bit.
Attachments
Stockfish_201_PA_GTB_Gran2b_x64.7z
(306.98 KiB) Downloaded 184 times

keoki010
Posts: 32
Joined: Mon Aug 16, 2010 4:53 pm

Re: Designing an analysis friendly Stockfish?

Post by keoki010 » Wed Feb 16, 2011 6:58 pm

Jeremy, both gran versions have problems with this game fraqment. They seem to get stuck on d=1 for some reason. If you go back and forth sometimes it'll display a full pv.
[GameID "0"]
[SetUp "1"]
[WhiteElo "0"]

48... e4 49. Rxf7 Re6 50. Nc4 e3 51. Nxe3 {^13 ^10 } {i get mate in 43 with
rondo^13 ^10 } {^13 ^10 } {David Evans^13 ^10 } {^13 ^10 } {I see mate in 42
Rybka on I7 950.^13 ^10 } {^13 ^10 } {Rubén Cómes} 51... Rxe3 52. Rf6 a5
{Black resigns.2011.02.11.} 1-0

Post Reply