What's Strelka's Secret Sauce?

Discussion of chess software programming and technical issues.

Moderator: Ras

Uri Blass
Posts: 10792
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: What's Strelka's Secret Sauce?

Post by Uri Blass »

ernest wrote:
Guetti wrote: So lets try to summarize the most important Strelka secrets:
1. ...........
2. Implementation of material tables
3. ...........
I think it is these "material tables", which Strelka simply took and copied from Rybka 1.0 Beta, which bring about the great leap in strength (+100 Elo), compared to Fruit 2.1
Without them, we would only have a bitboard Fruit 2.1

Do we know something about these "material tables" ???
I disagree.
Without them strelka may be weaker but the main reason is that the value of the pieces without them is not correct and my guess is that the tables give very little to playing strength(assuming correct value of pieces).

I tested strelka without them and the main problem of it is that it simply has wrong value of pieces when it simply overevaluates pawns and rook relative to bishop and knight and generally overevaluates pawns.

Strelka without material imbalance is not fruit2.1

Here is an example(strelka2A is strelka without material imbalance tables).

Note that strelka2A lost only 11-9 in my match against glaurung2.0.1 and I guess that with correct material values without material imbalance tables strelka2A could win the match against glaurung2.0.1.

6615: Glaurung 2.0.1 - Strelka 2.0 A, URI-AMD, Blitz:1'+1"
[d]r4rk1/p1p1pp2/2p4N/3b2p1/8/8/1P2BPPP/2B2RK1 b - - 0 1

Analysis by Fruit 2.1:

22...Kg8-g7 23.Bc1xg5
+- (1.73) Depth: 1/3 00:00:00
22...Kg8-g7 23.Bc1xg5
+- (1.73) Depth: 2/3 00:00:00
22...Kg8-g7 23.Bc1xg5 Bd5-e4
+- (1.63) Depth: 3/7 00:00:00
22...Kg8-g7 23.Bc1xg5 Kg7-g6 24.h2-h4
+- (1.83) Depth: 4/9 00:00:00
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 Ra8-b8
± (1.19) Depth: 5/15 00:00:00
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 Ra8-b8 25.b2-b3
± (1.27) Depth: 6/15 00:00:00 16kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-d2 Ra8-b8
± (1.22) Depth: 7/16 00:00:00 37kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-d2 Ra8-b8 26.Rf1-b1
± (1.26) Depth: 8/19 00:00:00 79kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-e3 Ra8-b8 26.Rf1-b1 Bd5-e4
± (1.25) Depth: 9/24 00:00:00 163kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-d2 Ra8-b8 26.Bd2-c3 e7-e5 27.Ng4xe5 f6xe5 28.Bc3xe5+ Kg7-g6 29.Be5xh8 Rb8xh8
± (1.25) Depth: 10/25 00:00:01 452kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-d2 Ra8-d8 26.Bd2-b4 e7-e5 27.Rf1-a1 Rd8-b8
± (1.36) Depth: 11/28 00:00:02 2070kN
22...Kg8-g7 23.Bc1xg5 Ra8-b8 24.Bg5-d2 f7-f5 25.Be2-d3 e7-e6 26.Rf1-a1 a7-a5 27.Ra1xa5 Rb8-b3 28.Ra5-a3 Rb3xb2
± (1.23) Depth: 12/31 00:00:08 7670kN

(, 02.02.2008)

6615: Glaurung 2.0.1 - Strelka 2.0 A, URI-AMD, Blitz:1'+1"
r4rk1/p1p1pp2/2p4N/3b2p1/8/8/1P2BPPP/2B2RK1 b - - 0 1

Analysis by Strelka 2.0 A:

22...Kg8-g7 23.Bc1xg5
² (0.27) Depth: 1 00:00:00
22...Kg8-g7 23.Bc1xg5
² (0.27) Depth: 2 00:00:00
22...Kg8-g7 23.Bc1xg5 f7-f5
= (0.20) Depth: 3 00:00:00
22...Kg8-g7 23.Bc1xg5 Kg7-g6 24.Bg5xe7 Kg6xh6 25.Be7xf8+ Ra8xf8
² (0.32) Depth: 4 00:00:00
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 Ra8-b8
= (-0.06) Depth: 5 00:00:00
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 Ra8-b8 25.Rf1-e1
= (-0.02) Depth: 6 00:00:00 8kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-f4 Ra8-b8
= (-0.07) Depth: 7 00:00:00 16kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-f4 Ra8-b8 26.Rf1-b1
= (-0.10) Depth: 8 00:00:00 34kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-e3 Ra8-b8 26.Rf1-b1 Bd5-e4
= (-0.06) Depth: 9 00:00:00 68kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-d2 Ra8-b8 26.Bd2-c3 c6-c5 27.Rf1-d1
= (0.01) Depth: 10 00:00:01 163kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-d2 Bd5-e6 26.Bd2-b4 Ra8-b8 27.Bb4xe7 Be6xg4 28.Be2xg4 Rb8xb2
= (0.04) Depth: 11 00:00:01 369kN
22...Kg8-g7 23.Bc1xg5 Rf8-h8 24.Nh6-g4 f7-f6 25.Bg5-d2 Bd5-e6 26.Bd2-b4 Ra8-b8 27.Bb4xe7 Be6xg4 28.Be2xg4 Rb8xb2
= (0.04) Depth: 12 00:00:01 823kN

(, 02.02.2008)
ernest
Posts: 2046
Joined: Wed Mar 08, 2006 8:30 pm

Re: What's Strelka's Secret Sauce?

Post by ernest »

Uri Blass wrote:Strelka without material imbalance is not fruit2.1
Thanks, Uri
I see you studied Strelka quite a bit!

But if it not the material (imbalance) tables, what is it you think that makes Strelka 2.0B so much stronger than Fruit 2.1 and up to the level of(and similar to) Rybka 1.0 Beta?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What's Strelka's Secret Sauce?

Post by bob »

rreagan wrote:
bob wrote:Only tiny exception is for pawns since negative shifts won't work on the PC and I don't want to make it too ugly (yet). I am looking at ways to generate pawn moves without the special-case white/black code as well, although 99% of the pawn generation code is now not duplicated...

Bob
I don't know how efficient this is, but here is something I have done to accomplish this.

Code: Select all

enum { white, black };
BitBoard shift_forward (BitBoard b, int color) {
    return (b << 8) >> (color << 4);
}
pawn_pushes = shift_forward(friendly_pawns, side_to_move);
Substituting a table lookup for (color << 4) would work also.
I'm doing something like that, but it is a special case... that was my point. for most pieces, there are _zero_ differences. But for pawns, their moving in opposite directions requires a hack that is different for black and white..
Uri Blass
Posts: 10792
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: What's Strelka's Secret Sauce?

Post by Uri Blass »

ernest wrote:
Uri Blass wrote:Strelka without material imbalance is not fruit2.1
Thanks, Uri
I see you studied Strelka quite a bit!

But if it not the material (imbalance) tables, what is it you think that makes Strelka 2.0B so much stronger than Fruit 2.1 and up to the level of(and similar to) Rybka 1.0 Beta?
My guess is that better search is the main factor.

In fixed depth game of depth 10 fruit use most of the time.


Uri
Uri Blass
Posts: 10792
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: What's Strelka's Secret Sauce?

Post by Uri Blass »

Uri Blass wrote:
ernest wrote:
Uri Blass wrote:Strelka without material imbalance is not fruit2.1
Thanks, Uri
I see you studied Strelka quite a bit!

But if it not the material (imbalance) tables, what is it you think that makes Strelka 2.0B so much stronger than Fruit 2.1 and up to the level of(and similar to) Rybka 1.0 Beta?
My guess is that better search is the main factor.

In fixed depth game of depth 10 fruit use most of the time.


Uri
I can add that I made a match at fixed depth of 10 plies and fruit2.1 won against strelka convincingly
25-7 and 8 draws.

It seems that strelka simply does more pruning than fruit.
Uri
User avatar
Eelco de Groot
Posts: 4658
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: What's Strelka's Secret Sauce?

Post by Eelco de Groot »

Hello Uri,

Not very important but I think if Strelka does a lot of razoring, dropping into Q-search early it would explain a bad fixed plydepth match because you are just gambling there, hoping to get more plies to compensate for tactical oversights. This razoring is IMO just copied from Glaurung, and in more complex form this is probably older than Nullmove, Rebel and Chess Genius probably had much more complex forward pruning before nullmove was invented. Ed wrote some posts about that how things were before nullmove changed a lot of programs. So again this is just totally taken from other programs just in this case not from Rybka presumably.

But I don't quite agree that the material tables are not important, if without them material values are wrong then it means you will have to correct those values before testing, because normally the table would take care of that.

This table is possibly also influencing positional play? Well I don't know, but if your removal of the table gives bad results it only proves the table could be important after all.

Uri I had another question, am I correct that when you tested Toga in the Crazy Rook position from Vincent Lejeune, this was with bitbases? Or was the mate announcement without bitbases? I could test it again myself but maybe I would get a sightly different result anyway

Regards, Eelco
Uri Blass
Posts: 10792
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: What's Strelka's Secret Sauce?

Post by Uri Blass »

Uri Blass wrote:
Uri Blass wrote:
ernest wrote:
Uri Blass wrote:Strelka without material imbalance is not fruit2.1
Thanks, Uri
I see you studied Strelka quite a bit!

But if it not the material (imbalance) tables, what is it you think that makes Strelka 2.0B so much stronger than Fruit 2.1 and up to the level of(and similar to) Rybka 1.0 Beta?
My guess is that better search is the main factor.

In fixed depth game of depth 10 fruit use most of the time.


Uri
I can add that I made a match at fixed depth of 10 plies and fruit2.1 won against strelka convincingly
25-7 and 8 draws.

It seems that strelka simply does more pruning than fruit.
Uri

I added many matchs at fixed depth(number near the program is simply the depth that was used and all matches are between fruit2.1 and strelka2)

results are:

fruit1-strelka1 30-10
strelka2-fruit1 32-8
fruit2-strelka2 26.5-13.5
strelka3-fruit2 32.5-7.5
fruit3-strelka3 23-17
strelka4-fruit3 34-6
fruit4-strelka4 20-20
fruit5-strelka5 24.5-15.5
fruit6-strelka6 22.5-17.5
fruit7-strelka7 20-20
fruit8-strelka8 24-16

I guess that fruit10 was lucky to win 29-11 against strelka10 and it seems that for small depths strelkaX+1 always beat fruitX(I did not try for strelka5 and above but based on experience the difference from one ply is big.

Note that the positions that was used were 1.a3 1.a4 1.b3 1.b4,... when both sides got white and black.

Uri
Uri Blass
Posts: 10792
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: What's Strelka's Secret Sauce?

Post by Uri Blass »

Eelco de Groot wrote:Hello Uri,

Not very important but I think if Strelka does a lot of razoring, dropping into Q-search early it would explain a bad fixed plydepth match because you are just gambling there, hoping to get more plies to compensate for tactical oversights. This razoring is IMO just copied from Glaurung, and in more complex form this is probably older than Nullmove, Rebel and Chess Genius probably had much more complex forward pruning before nullmove was invented. Ed wrote some posts about that how things were before nullmove changed a lot of programs. So again this is just totally taken from other programs just in this case not from Rybka presumably.

But I don't quite agree that the material tables are not important, if without them material values are wrong then it means you will have to correct those values before testing, because normally the table would take care of that.

This table is possibly also influencing positional play? Well I don't know, but if your removal of the table gives bad results it only proves the table could be important after all.

Uri I had another question, am I correct that when you tested Toga in the Crazy Rook position from Vincent Lejeune, this was with bitbases? Or was the mate announcement without bitbases? I could test it again myself but maybe I would get a sightly different result anyway

Regards, Eelco
1)For your second question I did not use bitbases.

2)About material imbalance I found that strelka performed relatively well with wrong material values without material imbalance tables so I guess that with right material values it could perform better than Glaurung2.0.1
and I think that material imbalance is not the main advantage of it.

I do not say that material imbalance give nothing but only that based on my opinion they do not give much to playing strength and the difference from fruit2.1 is mainly because of other factors.

Uri
User avatar
Eelco de Groot
Posts: 4658
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: What's Strelka's Secret Sauce?

Post by Eelco de Groot »

Okay thanks Uri. It is strange, not the bitbases then! Then it must be something in the search from Toga as Robert Hyatt already suggested could be the case. But I'm off topic! Re Strelka there is of course also the passed pawn handling which seems good. But I'll leave that for you to discuss, hope it is not from Rybka code!

Eelco
Uri Blass
Posts: 10792
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: What's Strelka's Secret Sauce?

Post by Uri Blass »

Eelco de Groot wrote:Okay thanks Uri. It is strange, not the bitbases then! Then it must be something in the search from Toga as Robert Hyatt already suggested could be the case. But I'm off topic! Re Strelka there is of course also the passed pawn handling which seems good. But I'll leave that for you to discuss, hope it is not from Rybka code!

Eelco
I agree that there is interesting stuff about passed pawn in strelka
that may help

The passed pawn stuff in strelka is hided by not significant variables and I changed them to significant variables but looking at games I find significant evaluation difference that is not about passed pawns(and also not about material imbalance) even if I looked at depth 1 games so search does not hide information from me.

Here is an example
You can see that strelka2 evaluates the position as more than 0.5 pawn for white when fruit2.1 evaluates it as close to 0.00 at small depth.

No passed pawn and no material imbalance and I even changed the position so no good capture is possible and both programs show the same pv.
Why the difference of more than 0.5 pawn in the evaluation?
The only reason is that strelka is different than fruit and all the people who think that strelka2.0 is fruit2.1 with small changes like imbalance material or passed pawn stuff or bitboards should understand that they are clearly wrong.

New game - Strelka 2.0 B, 10'/40
[d]r2q1rk1/pppbppbp/2np1np1/8/2BPPB2/5N2/PPP2PPP/RN1Q1R1K w - - 0 1

Analysis by Strelka 2.0 B:

10.Nb1-c3
= (0.22) Depth: 1 00:00:00
10.Nb1-c3 Nc6-b4
= (0.03) Depth: 2 00:00:00
10.Nb1-c3 Nc6-a5 11.Bc4-d3
= (0.10) Depth: 3 00:00:00
10.Nb1-c3 Nc6-a5 11.Bc4-d3 Nf6-g4
= (0.02) Depth: 4 00:00:00

New game - Strelka 2.0 B
r2q1rk1/pppbppbp/2np1np1/8/2BPPB2/5N2/PPP2PPP/RN1Q1R1K w - - 0 1

Analysis by Fruit 2.1:

10.Nb1-d2
² (0.46) Depth: 1/1 00:00:00
10.Nb1-c3
± (0.84) Depth: 1/2 00:00:00
10.Nb1-c3 Nc6-b4
² (0.60) Depth: 2/7 00:00:00
10.Nb1-c3 Nc6-a5 11.Bc4-d3
² (0.66) Depth: 3/8 00:00:00
(, 04.02.2008)