Bf6!! difficult move....

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Vempele

Re: Bf6!! difficult move....

Post by Vempele »

BBauer wrote:A program like crafty will *never* find Bf6.
reason: this type of position is about zugzwang.
after Bf6 g6 Qh6 the black Ne6 has cannot move, he has to protect g7.
This has nothing to do with zugzwang.

Zugzwang = any move by black improves white's position more than white's strongest move would (and vice versa, obviously).

As George said, white can just play 3.Rbd1, 4.Rd4, 5.Rh4 (or Rxe4) against any black continuation, including plain nullmoving. I don't see where you got the idea that Ne6 has to move at some point (there's always Ra8-b8-a8 and Qd8-c7-d8, and I don't see how white could prevent both).
BBauer
Posts: 658
Joined: Wed Mar 08, 2006 8:58 pm

Re: Bf6!! difficult move....

Post by BBauer »

Sorry for any confusion,

my wording was poor.
I wanted to say that the problem has to do with selectivity.
IMHO the use of null move pruning is the problem.
As many programs do it the same way, results are the same. :(
Even if you set the selectivity in crafty to (1,2) and search in the given position for Bf6 you get.

Code: Select all

                9->   0.32  -2.62   1. Bf6 gxf6 2. Qh6 Nac5 3. Qxf6 Ba6
                                    4. Nh6+ Kf8 5. Qh8+ Ke7 6. Qxh7 Kd8
                                    7. Qxf7 Qxf7 8. Nxf7+
               10     0.57     +1   1. Bf6!!
               10     0.98  -1.35   1. Bf6 gxf6 2. Nh6+ Kf8 3. Ng4 Qd8
                                    4. Qxh7 Ke7 5. Nh6 Rf8 6. Qf5
               10->   0.98  -1.35   1. Bf6 gxf6 2. Nh6+ Kf8 3. Ng4 Qd8
                                    4. Qxh7 Ke7 5. Nh6 Rf8 6. Qf5
               11     1.71  -1.12   1. Bf6 gxf6 2. Nh6+ Kh8 3. Nxf7+ Kg7
                                    4. Nd6 Qxd6 5. Qxe8 Nac7 6. Qh5 Nc5
                                    7. Bg2
               11->   1.73  -1.12   1. Bf6 gxf6 2. Nh6+ Kh8 3. Nxf7+ Kg7
                                    4. Nd6 Qxd6 5. Qxe8 Nac7 6. Qh5 Nc5
                                    7. Bg2
               12     3.26  -0.92   1. Bf6 gxf6 2. Nh6+ Kf8 3. Ng4 Ke7
                                    4. Qf5 Qa4 5. Qxf6+ Kd6 6. Qe5+ Kc6
                                    7. Nf6 Rd8 8. Rec1+ Nac5
               12->   3.28  -0.92   1. Bf6 gxf6 2. Nh6+ Kf8 3. Ng4 Ke7
                                    4. Qf5 Qa4 5. Qxf6+ Kd6 6. Qe5+ Kc6
                                    7. Nf6 Rd8 8. Rec1+ Nac5
               13     6.46     +1   1. Bf6!!
               13     9.15   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               13->   9.17   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               14    13.65   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               14->  13.65   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               15    25.43   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               15->  25.43   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               16    52.43   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               16->  52.43   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               17     2:10   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
               17->   2:10   0.01   1. Bf6 gxf6 2. Nh6+ Kf8 3. Nf5 Kg8
              time=5:01  mat=-1  n=1168563587  fh=93%  nps=3.9M
              ext-> check=79.5M 1rep=6.4M mate=1.0M pp=209K reduct=79.8M/77.7M
              predicted=0  evals=960.0M  50move=0  EGTBprobes=0  hits=0
              SMP->  splits=405  aborts=34  data=4/256  elap=5:01
kind regards
Bernhard
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Bf6!! difficult move....

Post by Tord Romstad »

George Tsavdaris wrote:
Crafty has no zugzwang detection.
Some progammers think speed is everything, so they will never do it right.
I'm surprised by this comment. I always thought about Crafty as an all-around program that knows all the tricks of Chess, and that it is just not the strongest around.
You are right that this position has nothing to do with zugzwang, and that Crafty has an impressive amount of chess knowledge. But Bernhard still has a good point: The main reason why Crafty isn't the strongest chess program around is that Bob cuts too many little corners in an attempt to squeeze out more speed. Bob is probably the most talented and experienced programmer of us all, and if he spent a month or two concentrating on correctness rather than speed, I think Crafty would be second only to Rybka.

Here are three examples of the many unsound shortcuts Crafty makes in order to improve the speed (based on Crafty 20.14, the latest version I have).

Crafty's static exchange evaluator considers X-ray attacks, which is fine, but it also considers X-ray attacks thorugh kings, which is obviously incorrect. For instance, in a position like this:
[d]4r3/4k3/4p3/4K3/6Q1/8/8/8 w - -
Crafty will evaluate the capture Qxe6 as losing, because of the line Qxe6 Kxe6 Kxe6 Rxe6.

In the quiescence search, Crafty allows to return the static evaluation as a stand pat score even when the side to move is in check. This can happen even when the side to move is checkmated. As a consequence, it can happen that Crafty is checkmated at the position at the end of the main line, without the program being aware of it.

Crafty uses a concept called "tropism" as a cheap surrogate for king safety. It does not consider which enemy pieces attack the squares around the king, but only which pieces are located geometrically close to the king. This is a lot faster, but obviously less precise.

Each of these three examples are quite unimportant by themselves: Fixing any one of the would probably be worth no more than a couple of Elo points. But you can find hundreds of similar examples scattered around in the code. I think fixing them all would make Crafty 20-30% slower, but 200-300 Elo points stronger.

Tord
User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 12:35 pm

Re: Bf6!! difficult move....

Post by George Tsavdaris »

Tord Romstad wrote: But Bernhard still has a good point: The main reason why Crafty isn't the strongest chess program around is that Bob cuts too many little corners in an attempt to squeeze out more speed. Bob is probably the most talented and experienced programmer of us all, and if he spent a month or two concentrating on correctness rather than speed, I think Crafty would be second only to Rybka.

Here are three examples of the many unsound shortcuts Crafty makes in order to improve the speed (based on Crafty 20.14, the latest version I have).

Crafty's static exchange evaluator considers X-ray attacks, which is fine, but it also considers X-ray attacks thorugh kings, which is obviously incorrect. For instance, in a position like this:
4r3/4k3/4p3/4K3/6Q1/8/8/8 w - -
Crafty will evaluate the capture Qxe6 as losing, because of the line Qxe6 Kxe6 Kxe6 Rxe6.

In the quiescence search, Crafty allows to return the static evaluation as a stand pat score even when the side to move is in check. This can happen even when the side to move is checkmated. As a consequence, it can happen that Crafty is checkmated at the position at the end of the main line, without the program being aware of it.

Crafty uses a concept called "tropism" as a cheap surrogate for king safety. It does not consider which enemy pieces attack the squares around the king, but only which pieces are located geometrically close to the king. This is a lot faster, but obviously less precise.

Each of these three examples are quite unimportant by themselves: Fixing any one of the would probably be worth no more than a couple of Elo points. But you can find hundreds of similar examples scattered around in the code.
Oh! All these seem a lot crazy(things i don't understand the reason to happen) to me. :roll:
Not incorrect, but crazy(that means i don't understand the reason behind all these) since:

You present Prof. Hyatt as a speed maniac and not a strength maniac(providing that more speed is not always better).
I mean what's the purpose of doing all these to have speed and even more speed as possible, if this hurts according to you, the strength of the program?

I think fixing them all would make Crafty 20-30% slower, but 200-300 Elo points stronger.
I wonder if he agrees to that.... I guess he doesn't, since then he would probably implement all these and would make Crafty stronger by 200-300 ELO.
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Bf6!! difficult move....

Post by Tord Romstad »

George Tsavdaris wrote: You present Prof. Hyatt as a speed maniac and not a strength maniac(providing that more speed is not always better).
I mean what's the purpose of doing all these to have speed and even more speed as possible, if this hurts according to you, the strength of the program?
Not everybody optimizes his program for strength. Some programs (e.g. Chess System Tal and Glaurung 1.x) are optimized for entertaining style of play, others (e.g. Pikoszachy and Micromax) are optimized for executable size, and others for maximum speed. Bob's main interest doesn't seem to be raw strength in engine vs engine play, but rather good scaling on a big number of CPUs, ability to handle anti-computer chess, bitboards, and low-level speed.
I think fixing them all would make Crafty 20-30% slower, but 200-300 Elo points stronger.
I wonder if he agrees to that.... I guess he doesn't, since then he would probably implement all these and would make Crafty stronger by 200-300 ELO.
I am almost 100% sure he could if he wanted. If Bob's main goal was to climb as high as possible on the CEGT, CCRL and SSDF lists, he would be on place 2 on all three lists within a month or two.

As a comparison, look at Glaurung 2 - ε/5, which has much less chess knowledge than Crafty in all phases of the game, and which is also much slower. Glaurung's only advantage compared to Crafty is that it doesn't take quite as many dubious shortcuts (although Glaurung is also very far from perfect in this respect). Nevertheless, Glaurung doesn't seem to be far behind Crafty on single- and dual-CPU computers. Imagine how strong Crafty would be if it didn't only outclass Glaurung in speed and knowledge, but also in correctness. Bob could do it, quite easily.

Tord
ernst
Posts: 354
Joined: Thu Mar 09, 2006 6:00 pm

Re: Bf6!! difficult move....

Post by ernst »

Deep Fritz 10 does well at this position on my E6600@3375MHz, 1GB hash.

Analysis by Deep Fritz 10:

1.Qh4 Bb7 2.Ne7+ Rxe7 3.Bxe7 Re8 4.Ba3 Nac5 5.Bf5 g6 6.Bxe6 Nxe6 7.Bb2
= (0.14) Depth: 11/35 00:00:00 2814kN
1.Qh4 Bb7 2.Ne7+ Rxe7 3.Bxe7 h6 4.Ba3 d4 5.Bf5 Re8 6.Bc1 Nac5 7.Bd2 Qc7
= (0.13) Depth: 12/31 00:00:01 4991kN
1.Qh4 Bb7 2.Ne7+ Rxe7 3.Bxe7 h6 4.Ba3 d4 5.Bf5 Re8 6.Bc1 Nac5 7.Bd2 Qc7
= (0.13) Depth: 13/33 00:00:02 11234kN
1.Qh4 Bb7 2.Bf6 d4 3.Nxg7 Qd5 4.f3
= (0.00) Depth: 14/39 00:00:06 30555kN
1.Qh4 Bb7 2.Bf6 d4 3.Nxg7 Qd5 4.f3 Qxf3 5.Nxe6 Qh1+ 6.Kf2 Qf3+ 7.Kg1
= (0.00) Depth: 15/48 00:00:21 103mN
1.Re3
= (0.01) Depth: 15/48 00:00:27 133mN
1.Re3
= (0.16) Depth: 15/48 00:00:27 137mN
1.Re3
+/= (0.47) Depth: 15/48 00:00:28 142mN
1.Re3 d4 2.Nxg7 Nxg7 3.Bxd7 dxe3 4.Qg4 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04:01 1195mN
1.Bf6
+- (2.56) Depth: 18/41 00:04:06 1218mN
1.Bf6
+- (3.12) Depth: 18/43 00:04:21 1291mN
1.Bf6 Nac7 2.Re3 d4 3.Re4 Qd5 4.Nh6+ gxh6 5.Rg4+ Qg5 6.Bxg5 hxg5 7.Bg2 f6 8.Be4
+- (3.68) Depth: 18/64 00:07:01 2097mN

(, 20.07.2007)
This post may either be cause or result of misunderstandings.
User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 12:35 pm

Re: Bf6!! difficult move....

Post by George Tsavdaris »

Thank you for your answer.....
I believe you :D , so i hope he will create that 2nd place Crafty....

Also i find somewhat weird the situation we are now and you described indirectly, about the 1st place, that most logical people will agree that it is clearly occupied by the fish and it is almost impossible to dethrone this small fish. :D

It's not like Shredder's 9 domination for example. People accepted its domination but wondered which program will be the new number 1. Now with Rybka things are different: We can only wonder what program will be second..... 8-)
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Bf6!! difficult move....

Post by Tord Romstad »

George Tsavdaris wrote: Also i find somewhat weird the situation we are now and you described indirectly, about the 1st place, that most logical people will agree that it is clearly occupied by the fish and it is almost impossible to dethrone this small fish. :D
It's not impossible, nor even almost impossible, but merely very diffficult. I think Bob would be able to climb to the 2nd place on the rating lists without a lot of effort. To overtake Rybka, he would have to work a lot harder, unless he is better than I think (which is of course very possible).

Tord
Alessandro Scotti

Re: Bf6!! difficult move....

Post by Alessandro Scotti »

At the end of this PV:

Code: Select all

  14   01:18    116.926.664   1.494.556   +0,74   Bg5f6 g7xf6 Nf5h6+ Kg8f8 Nh6g4 Kf8e7 Qh5h4 Qd7a4 Qh4xf6+ Ke7d7 Qf6xf7+ Kd7d8 Qf7f6+ Re8e7 Ng4e5 Qa4e8 Bh3xe6 Bc8xe6 Rb1c1 
Glaurung sees +0,74 advantage for white:

[d]r2kq3/p3r2p/np2bQ2/3pN3/8/6P1/P4P1P/2R1R1K1 b - -

White has a strong attack but black is a piece up and has the move... what are the most important evaluation factor in this position?
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Bf6!! difficult move....

Post by Tord Romstad »

Alessandro Scotti wrote:At the end of this PV:

Code: Select all

  14   01:18    116.926.664   1.494.556   +0,74   Bg5f6 g7xf6 Nf5h6+ Kg8f8 Nh6g4 Kf8e7 Qh5h4 Qd7a4 Qh4xf6+ Ke7d7 Qf6xf7+ Kd7d8 Qf7f6+ Re8e7 Ng4e5 Qa4e8 Bh3xe6 Bc8xe6 Rb1c1 
Glaurung sees +0,74 advantage for white:

[d]r2kq3/p3r2p/np2bQ2/3pN3/8/6P1/P4P1P/2R1R1K1 b - -

White has a strong attack but black is a piece up and has the move... what are the most important evaluation factor in this position?
Hello Alessandro,

Thanks for bringing this to my attention - I didn't look at the main line and the resulting position before I saw your post. I now had a quick look, and it turns out that king safety is by far the most important factor in Glaurung's evaluation function for this position. Glaurung actually evaluates white's attack as being worth 3.44 pawns, which seems completely insane to me. I really should start working on my evaluation function again soon. I see ridiculous misevaluations like this one all the time.

Tord