pre-Beta Rybkas

Code, algorithms, languages, construction...
BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

pre-Beta Rybkas

Post by BB+ » Tue Oct 18, 2011 10:05 am

bob wrote:I did not spend a lot of time, but certainly 1.4 was very different, which is beyond strange. You'd think a clean copy of Crafty would start a new major version rather than just a 1.5 to 1.6 (I do not remember what I found in 1.4/1.5, but one of them was clearly not crafty, Actually, I just looked and it looks like neither is Crafty after a fairly quick glance, while 1.6.1 is absolutely no doubt Crafty 19.x...
Most of the elements listed on the ICGA wiki [like EvaluateWinner() and NextMove()] already appear in Rybka 1.4. I was unable to determine if the Edwards kludge was there. This Rybka version did not have Nalimov capabilities attached (though Rybka 1.5 [or at least 2 of 3 of the renditions -- there was a repetition bug to fix], sent 3-5 days later to Deville, did have them).
Rebel wrote:I had a quick look at the 1.6.1 version and the "999999" makes a compelling case. But you [Bob] also said: IMHO, it is not even clear that 1.6.1 was what played in the CCT event.

That's news for me because the accusation always has been it did play in CCT.
I can find no record of this "accusation". The Report does not mention it. The wiki says: A version of Rybka containing these Crafty code segments competed in AEGT 3 [...] and the same is likely true for Chess War V-VII, Le Système du Suisse 3, and CCT6. It later says:
2004
In January, Rybka competes in CCT6, the largest online author-based tournament (a posting of Rajlich's from time gives a "Rybka 1.3" as a version number). In April, Rybka 1.5 enters the privately-run author-based tournaments Chess War V and Le Systeme du Saison. In October(?), Rybka 1.6 enters Chess War VI and AEGT 3. Rybka 1.6 also competed in Chess War VII.
There is ample evidence that the latter two versions contained large amounts of Crafty code, in direct contravention of both the relevant Crafty license and the rules of these tournaments. [...]
I have no idea where the claim that "Rybka 1.6.1" played in CCT6 derives (as it was the version of 9 months later), though at one point the Rybka forum was rumbling that the exact version that played was unknown (and thus wasn't considered by the ICGA Panel), so it couldn't be disqualified due to lack of due process, etc.

Also, Rybka 1.4 seems not to have -999999 (0xfff0bdc1) as the sentinel in sorting in NextMove() (it uses 0xfffe7961 instead, namely -99999). Rybka 1.5 uses -999999, as Rybka 1.6 does. [See the ICGA wiki for more on the NextMove() routine].

Here is a timeline
Feb 1 2004, CCT6 takes place, Rajlich participating with Rybka
Feb 6 2004, Rajlich posts to CCC, asking Nalimov for permission with TBs (#347508)
Mar 27 2004, Rajlich posts to CCC, giving NPS numbers for Rybka 1.3 (#356880)
Mar 31 2004, Rajilch sends Rybka 1.4 to ChessWar (and other places)
             (the deadline is the 5th, Deville says he will test it before that, VR hopes to get Nalimov by then...)
Apr 1 2004, Rajlich sends a version to deal with Deville's time control better
Apr 2 2004, Rajlich sends a bug fix (Rybka was losing on time)
Apr 5 2004, Rajlich sends Rybka 1.5
Apr 7 2004, Rajlich sends a bug fix (repetition)
Apr 8 2004, "The bugfix from yesterday was not perfect."
Nov 25 2004, Deville asks Rajlich for a new version. He sends 1.6.1 ("around 6 months old")

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: pre-Beta Rybkas

Post by Rebel » Tue Oct 18, 2011 12:57 pm

Rebel wrote:That's news for me because the accusation always has been it did play in CCT.
2004 - In January, Rybka competes in CCT6, the largest online author-based tournament (a posting of Rajlich's from time gives a "Rybka 1.3" as a version number).
Ok, just want to have the facts straight.
Nov 25 2004, Deville asks Rajlich for a new version. He sends 1.6.1 ("around 6 months old")
Still a question, this R161 version which Oliver mailed you (I presume) was checked with the games it played in ChessWars? Identical moves, score, PV's. IOW, the non-public (I assume again) R161.EXE did really play?

I could have missed that cause I never gave the R14/R15/R16 issue much attention.

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

Re: pre-Beta Rybkas

Post by hyatt » Tue Oct 18, 2011 5:05 pm

I took a quick glance last night, for curiosity. The things that stuck out to me.

1. 1.6.1 includes nalimov egtb code. Earlier versions do not. Can't imagine why since Nalimov was available starting in Crafty version 16.0, which dates back to pre-2000 at least. So why was it not in Rybka versions prior to 1.6.1? Unknown.

2. 1.6.1 contains an exact copy of bench.c from Crafty. This, too, has been around forever. Why in 1.6.1 but not earlier versions?

3. the "if (ms == 99999)" was added in 18.0... Before that version was released, EvaluateMates() was cleaned up and that 99999 return value was removed. Although I had carefully looked at the 1.6.1 issues and found that some of them dated to 19.0 or later, because some of the "quirks" found in 1.6.1 were not in versions earlier than 19.0.

My comment on ccc was, as I said, based on a quick glance and version 1.5 is certainly different from 1.6.1 in that there is no egtb.cpp, bench.c, etc. May be that he stripped everything out except the actual search/eval code. . I did just remember that every version has always had the ability to compile Nalimov support in or out with the -DEGTB compile-time definition, so perhaps he excluded that knowing that EGTBs were not going to be used. Leaving the code out makes it very slightly faster, which is how I run on our cluster...

As to what played in CCT, at some point, somone posted a link that gave 1.6.1 as an entrant. I do not remember who. I seem to recall the link pointing to a crosstable somewhere that listed Rybka 1.6.1 near the bottom. But more than that, I do not remember. I do find the -999999 thing strange as I looked at all my old versions and -999999 has been used since I started using anything at all, never been changed.

Anyway, my $.02 on 1.6.1 and earlier. I do agree that at least 1.4/1.5 are crafty, after looking a little deeper. Just seems a bit strange that they differ from 1.6.1 in some ways...

BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Re: pre-Beta Rybkas

Post by BB+ » Wed Oct 19, 2011 7:02 am

Rebel wrote:Still a question, this R161 version which Oliver mailed you (I presume) was checked with the games it played in ChessWars? Identical moves, score, PV's. IOW, the non-public (I assume again) R161.EXE did really play?
Here is the chain of custody: I was mailed the lot (9 total emails, with files attached) from the Secretariat, who received it from Deville. I'm not sure how my word in this regard is any more reliable that theirs.

ChessWar does not list PVs. And it is impossible to get exact matches, due to hash effects, etc. Here is one game played by Rybka 1.6.1.[Event "ChessWar VII C 40m/20'"]
[Site "CHESSWAR"]
[Date "2005.07.03"]
[Round "1.1"]
[White "Toga II 0.93"]
[Black "Rybka 1.6.1"]
[Result "1-0"]
[ECO "C69"]
[WhiteElo "2337"]
[BlackElo "2133"]
[PlyCount "161"]
[EventDate "2005.??.??"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O f6 6. d4 exd4 7. Nxd4 c5 8. Ne2 Qxd1 9. Rxd1 Bd7 10. Nbc3 O-O-O 11. Be3 Re8 12. Rd2 Bc6 13. Rad1 b6 14. f3 Ne7 15. Nf4 Ng6 16. Nxg6 {+0.28/14 35} 16... hxg6 {-0.12/16 150} 17. Bf4 { +0.33/15 46} 17... Be7 {-0.12/15 52} 18. Nd5 {+0.53/15 46} 18... Bd8 { -0.12/15 52} 19. Bg3 {+0.52/15 46} 19... g5 {-0.06/14 60} 20. h3 {+0.52/15 39} 20... g6 {0.00/13 40} 21. b3 {+0.48/14 102} 21... f5 {+0.06/14 74} 22. Re1 { +0.36/14 44} 22... Re6 {-0.12/13 47} 23. c4 {+0.19/15 56} 23... Bb7 { -0.12/14 47} 24. Kf1 {+0.26/14 48} 24... Rf8 {0.00/12 31} 25. Bf2 {+0.26/15 116
} 25... a5 {0.00/14 77} 26. Rde2 {+0.27/14 43} 26... c6 {-0.06/15 44} 27. Nc3 { +0.27/15 33} 27... Bc7 {-0.06/13 49} 28. exf5 {+0.26/15 73} 28... Rxe2 {+0.06/16 42} 29. Rxe2 {+0.32/17 29} 29... gxf5 {0.00/15 36} 30. Re7 {+0.32/15 37} 30... Kb8 {+0.12/13 38} 31. Be3 {+0.36/15 45} 31... Rg8 {+0.12/13 33} 32. Bd2 {+0.38/15 28} 32... Bc8 {0.00/13 29} 33. Kf2 {+0.52/15 24} 33... Bd6 {0.00/14 46} 34. Rf7 {+0.47/15 36} 34... Be5 {0.00/13 31} 35. Ne2 {+0.55/15 27} 35... Bc7 {0.00/12 40} 36. Ng3 {+0.71/16 45} 36... f4 {-0.43/14 37} 37. Ne4 {+0.77/16 45} 37... Bd8 {-0.68/14 33} 38. h4 {+1.26/18 48} 38... gxh4
{-0.68/15 32} 39. Bxf4+ {+1.24/18 39} 39... Ka8 {-0.75/16 41} 40. Nd6 {
+1.29/18 40} 40... Be6 {-0.68/14 13} 41. Rh7 {+1.28/17 38} 41... Rf8 {
-0.68/15 40} 42. Be5 {+1.48/17 40} 42... Bg5 {-0.93/14 25} 43. Rh5 {+1.47/17 27
} 43... Bd8 {-0.93/15 27} 44. Rh6 {+1.49/17 40} 44... Bd7 {-0.93/14 36} 45. f4
{+1.64/17 32} 45... Bg4 {-1.00/14 32} 46. Rh7 {+1.93/16 21} 46... Bf6 {
-1.06/14 29} 47. Ke3 {+2.01/16 32} 47... Bd8 {-1.12/14 30} 48. Ke4 {+2.59/16 23
} 48... Bd1 {-1.43/12 36} 49. Rg7 {+2.91/15 30} 49... Bf6 {-2.75/14 31} 50.
Bxf6 {+3.64/17 24} 50... Rxf6 {-2.68/14 28} 51. Ke5 {+3.87/17 17} 51... Rf8 {
-3.00/13 28} 52. f5 {+4.24/17 19} 52... a4 {-3.50/13 35} 53. bxa4 {+4.80/18 32}
53... Rh8 {-5.00/13 30} 54. f6 {+5.42/18 29} 54... Bh5 {-5.93/14 30} 55. f7 {
+5.66/19 30} 55... Rb8 {-6.18/15 29} 56. Ke6 {+5.66/17 29} 56... Bxf7+ {
-7.06/14 46} 57. Nxf7 {+6.30/19 29} 57... Rb7 {-7.12/14 24} 58. Rh7 {
+6.56/18 25} 58... b5 {-7.12/14 23} 59. Rh8+ {+6.78/17 22} 59... Ka7 {
-8.00/14 46} 60. Nd8 {+7.76/16 30} 60... Rg7 {-8.06/14 38} 61. Nxc6+ {
+8.76/16 28} 61... Kb6 {-8.12/14 67} 62. axb5 {+9.16/17 19} 62... Kc7 {
-8.12/13 24} 63. a4 {+11.58/16 32} 63... Rg6+ {-8.25/13 45} 64. Kd5 {
+15.09/18 32} 64... Rg5+ {-8.43/13 39} 65. Ne5 {+15.56/18 31} 65... Kb6 {
-8.68/13 24} 66. Rh6+ {+15.57/17 26} 66... Ka5 {-8.75/14 37} 67. Ra6+ {
+15.92/17 20} 67... Kb4 68. b6 {+15.92/17 32} 68... Rg7 {-8.75/13 29} 69. Ra7 {
+16.48/16 32} 69... Rg8 {-8.81/13 30} 70. b7 {+16.72/16 33} 70... Kc3 {
-8.87/13 43} 71. Ra8 {+17.15/14 33} 71... Rxg2 {-8.87/12 26} 72. b8=Q {
+17.65/12 11} 72... Rb2 {-9.25/12 51} 73. Qh8 {+M8/13 144} 73... Rb7 {
-9.37/11 32} 74. Nc6+ {+M7/10 23} 74... Kd3 {-9.75/11 30} 75. Kxc5 {+M6/11 13}
75... Rc7 76. Rf8 {+M5/16 15} 76... Rxc6+ 77. Kxc6 {+M4/47 6} 77... Kd2 78.
Qb2+ {+M3/50 20} 78... Ke3 79. Qf2+ {+M2/50 29} 79... Ke4 80. Rf3 {+M1/50 38}
80... h3 81. Qe3# {+M0/47 28 Mat} 1-0For the Rybka 1.6.1 I have, at move 17, after about 15 seconds it shows Be7 with a score of 0.12. Similarly at move 26, with c6 and a score of 0.06. At move 36, it first wants to play Bxg3, then switches to f4 with a score of 0.31, then 0.37, and finally 0.43. On move 42 it likes Bg5, with scores of 0.75, 0.81, 0.87, 0.93. On move 48 it likes Bd1 with scores about (but not exactly) the given 1.43. On move 49 it first likes Rh8 at about 1.89, then switches to Bf6 at 2.62, then 2.81. At move 53 it likes h3 at 4.0, then 4.4, then 5.12. Then it switches to Rh8 at 5.37.

In all cases, I think the moves/scores are within the tolerable error. [Again, I could be making this up, and so could Deville. :mrgreen: ]

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: pre-Beta Rybkas

Post by Rebel » Thu Oct 20, 2011 11:11 am

Tx for the info Mark. Oliver was so kind to mail me the same stuff.

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: pre-Beta Rybkas

Post by Rebel » Thu Oct 20, 2011 11:23 pm

[Event "ChessWar VII C 40m/20'"]
[Site "CHESSWAR"]
[Date "2005.07.03"]
[Round "1.1"]
[White "Toga II 0.93"]
[Black "Rybka 1.6.1"]
[Result "1-0"]
[ECO "C69"]
[WhiteElo "2337"]
[BlackElo "2133"]
[PlyCount "161"]
[EventDate "2005.??.??"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O f6 6. d4 exd4 7. Nxd4 c5 8. Ne2 Qxd1 9. Rxd1 Bd7 10. Nbc3 O-O-O 11. Be3 Re8 12. Rd2 Bc6 13. Rad1 b6 14. f3 Ne7 15. Nf4 Ng6 16. Nxg6 {+0.28/14 35} 16... hxg6 {-0.12/16 150} 17. Bf4 { +0.33/15 46} 17... Be7 {-0.12/15 52} 18. Nd5 {+0.53/15 46} 18... Bd8 { -0.12/15 52} 19. Bg3 {+0.52/15 46} 19... g5 {-0.06/14 60} 20. h3 {+0.52/15 39} 20... g6 {0.00/13 40} 21. b3 {+0.48/14 102} 21... f5 {+0.06/14 74} 22. Re1 { +0.36/14 44} 22... Re6 {-0.12/13 47} 23. c4 {+0.19/15 56} 23... Bb7 { -0.12/14 47} 24. Kf1 {+0.26/14 48} 24... Rf8 {0.00/12 31} 25. Bf2 {+0.26/15 116
} 25... a5 {0.00/14 77} 26. Rde2 {+0.27/14 43} 26... c6 {-0.06/15 44} 27. Nc3 { +0.27/15 33} 27... Bc7 {-0.06/13 49} 28. exf5 {+0.26/15 73} 28... Rxe2 {+0.06/16 42} 29. Rxe2 {+0.32/17 29} 29... gxf5 {0.00/15 36} 30. Re7 {+0.32/15 37} 30... Kb8 {+0.12/13 38} 31. Be3 {+0.36/15 45} 31... Rg8 {+0.12/13 33} 32. Bd2 {+0.38/15 28} 32... Bc8 {0.00/13 29} 33. Kf2 {+0.52/15 24} 33... Bd6 {0.00/14 46} 34. Rf7 {+0.47/15 36} 34... Be5 {0.00/13 31} 35. Ne2 {+0.55/15 27} 35... Bc7 {0.00/12 40} 36. Ng3 {+0.71/16 45} 36... f4 {-0.43/14 37} 37. Ne4 {+0.77/16 45} 37... Bd8 {-0.68/14 33} 38. h4 {+1.26/18 48} 38... gxh4
{-0.68/15 32} 39. Bxf4+ {+1.24/18 39} 39... Ka8 {-0.75/16 41} 40. Nd6 {
+1.29/18 40} 40... Be6 {-0.68/14 13} 41. Rh7 {+1.28/17 38} 41... Rf8 {
-0.68/15 40} 42. Be5 {+1.48/17 40} 42... Bg5 {-0.93/14 25} 43. Rh5 {+1.47/17 27
} 43... Bd8 {-0.93/15 27} 44. Rh6 {+1.49/17 40} 44... Bd7 {-0.93/14 36} 45. f4
{+1.64/17 32} 45... Bg4 {-1.00/14 32} 46. Rh7 {+1.93/16 21} 46... Bf6 {
-1.06/14 29} 47. Ke3 {+2.01/16 32} 47... Bd8 {-1.12/14 30} 48. Ke4 {+2.59/16 23
} 48... Bd1 {-1.43/12 36} 49. Rg7 {+2.91/15 30} 49... Bf6 {-2.75/14 31} 50.
Bxf6 {+3.64/17 24} 50... Rxf6 {-2.68/14 28} 51. Ke5 {+3.87/17 17} 51... Rf8 {
-3.00/13 28} 52. f5 {+4.24/17 19} 52... a4 {-3.50/13 35} 53. bxa4 {+4.80/18 32}
53... Rh8 {-5.00/13 30} 54. f6 {+5.42/18 29} 54... Bh5 {-5.93/14 30} 55. f7 {
+5.66/19 30} 55... Rb8 {-6.18/15 29} 56. Ke6 {+5.66/17 29} 56... Bxf7+ {
-7.06/14 46} 57. Nxf7 {+6.30/19 29} 57... Rb7 {-7.12/14 24} 58. Rh7 {
+6.56/18 25} 58... b5 {-7.12/14 23} 59. Rh8+ {+6.78/17 22} 59... Ka7 {
-8.00/14 46} 60. Nd8 {+7.76/16 30} 60... Rg7 {-8.06/14 38} 61. Nxc6+ {
+8.76/16 28} 61... Kb6 {-8.12/14 67} 62. axb5 {+9.16/17 19} 62... Kc7 {
-8.12/13 24} 63. a4 {+11.58/16 32} 63... Rg6+ {-8.25/13 45} 64. Kd5 {
+15.09/18 32} 64... Rg5+ {-8.43/13 39} 65. Ne5 {+15.56/18 31} 65... Kb6 {
-8.68/13 24} 66. Rh6+ {+15.57/17 26} 66... Ka5 {-8.75/14 37} 67. Ra6+ {
+15.92/17 20} 67... Kb4 68. b6 {+15.92/17 32} 68... Rg7 {-8.75/13 29} 69. Ra7 {
+16.48/16 32} 69... Rg8 {-8.81/13 30} 70. b7 {+16.72/16 33} 70... Kc3 {
-8.87/13 43} 71. Ra8 {+17.15/14 33} 71... Rxg2 {-8.87/12 26} 72. b8=Q {
+17.65/12 11} 72... Rb2 {-9.25/12 51} 73. Qh8 {+M8/13 144} 73... Rb7 {
-9.37/11 32} 74. Nc6+ {+M7/10 23} 74... Kd3 {-9.75/11 30} 75. Kxc5 {+M6/11 13}
75... Rc7 76. Rf8 {+M5/16 15} 76... Rxc6+ 77. Kxc6 {+M4/47 6} 77... Kd2 78.
Qb2+ {+M3/50 20} 78... Ke3 79. Qf2+ {+M2/50 29} 79... Ke4 80. Rf3 {+M1/50 38}
80... h3 81. Qe3# {+M0/47 28 Mat} 1-0

I have been replaying the same game. Thing I noticed R161 scores go in steps by 0.06 / 0.07

Question for Bob, is this typical Crafty behaviour ?

Technical now:

Rybka 1.4 (size 2.2 Mb) clean, no Crafty code (no 99999 etc found)

Rybka 1.5 (size 2.2 Mb) Crafty code (99999 present)
Rybka 1.5a (size 2.5 Mb) Crafty code (99999 present)
Rybka 1.5b (size 2.5 Mb) Crafty code (99999 present)

Rybka 1.6.1 (size 2.7 Mb) Crafty code (99999 present)

On the R15's and R161 IDA reports that debug code is inside.

Could that mean that no death-code optimizing was done by the compiler?

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

Re: pre-Beta Rybkas

Post by hyatt » Fri Oct 21, 2011 3:22 am

Rebel wrote:[Event "ChessWar VII C 40m/20'"]
[Site "CHESSWAR"]
[Date "2005.07.03"]
[Round "1.1"]
[White "Toga II 0.93"]
[Black "Rybka 1.6.1"]
[Result "1-0"]
[ECO "C69"]
[WhiteElo "2337"]
[BlackElo "2133"]
[PlyCount "161"]
[EventDate "2005.??.??"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. O-O f6 6. d4 exd4 7. Nxd4 c5 8. Ne2 Qxd1 9. Rxd1 Bd7 10. Nbc3 O-O-O 11. Be3 Re8 12. Rd2 Bc6 13. Rad1 b6 14. f3 Ne7 15. Nf4 Ng6 16. Nxg6 {+0.28/14 35} 16... hxg6 {-0.12/16 150} 17. Bf4 { +0.33/15 46} 17... Be7 {-0.12/15 52} 18. Nd5 {+0.53/15 46} 18... Bd8 { -0.12/15 52} 19. Bg3 {+0.52/15 46} 19... g5 {-0.06/14 60} 20. h3 {+0.52/15 39} 20... g6 {0.00/13 40} 21. b3 {+0.48/14 102} 21... f5 {+0.06/14 74} 22. Re1 { +0.36/14 44} 22... Re6 {-0.12/13 47} 23. c4 {+0.19/15 56} 23... Bb7 { -0.12/14 47} 24. Kf1 {+0.26/14 48} 24... Rf8 {0.00/12 31} 25. Bf2 {+0.26/15 116
} 25... a5 {0.00/14 77} 26. Rde2 {+0.27/14 43} 26... c6 {-0.06/15 44} 27. Nc3 { +0.27/15 33} 27... Bc7 {-0.06/13 49} 28. exf5 {+0.26/15 73} 28... Rxe2 {+0.06/16 42} 29. Rxe2 {+0.32/17 29} 29... gxf5 {0.00/15 36} 30. Re7 {+0.32/15 37} 30... Kb8 {+0.12/13 38} 31. Be3 {+0.36/15 45} 31... Rg8 {+0.12/13 33} 32. Bd2 {+0.38/15 28} 32... Bc8 {0.00/13 29} 33. Kf2 {+0.52/15 24} 33... Bd6 {0.00/14 46} 34. Rf7 {+0.47/15 36} 34... Be5 {0.00/13 31} 35. Ne2 {+0.55/15 27} 35... Bc7 {0.00/12 40} 36. Ng3 {+0.71/16 45} 36... f4 {-0.43/14 37} 37. Ne4 {+0.77/16 45} 37... Bd8 {-0.68/14 33} 38. h4 {+1.26/18 48} 38... gxh4
{-0.68/15 32} 39. Bxf4+ {+1.24/18 39} 39... Ka8 {-0.75/16 41} 40. Nd6 {
+1.29/18 40} 40... Be6 {-0.68/14 13} 41. Rh7 {+1.28/17 38} 41... Rf8 {
-0.68/15 40} 42. Be5 {+1.48/17 40} 42... Bg5 {-0.93/14 25} 43. Rh5 {+1.47/17 27
} 43... Bd8 {-0.93/15 27} 44. Rh6 {+1.49/17 40} 44... Bd7 {-0.93/14 36} 45. f4
{+1.64/17 32} 45... Bg4 {-1.00/14 32} 46. Rh7 {+1.93/16 21} 46... Bf6 {
-1.06/14 29} 47. Ke3 {+2.01/16 32} 47... Bd8 {-1.12/14 30} 48. Ke4 {+2.59/16 23
} 48... Bd1 {-1.43/12 36} 49. Rg7 {+2.91/15 30} 49... Bf6 {-2.75/14 31} 50.
Bxf6 {+3.64/17 24} 50... Rxf6 {-2.68/14 28} 51. Ke5 {+3.87/17 17} 51... Rf8 {
-3.00/13 28} 52. f5 {+4.24/17 19} 52... a4 {-3.50/13 35} 53. bxa4 {+4.80/18 32}
53... Rh8 {-5.00/13 30} 54. f6 {+5.42/18 29} 54... Bh5 {-5.93/14 30} 55. f7 {
+5.66/19 30} 55... Rb8 {-6.18/15 29} 56. Ke6 {+5.66/17 29} 56... Bxf7+ {
-7.06/14 46} 57. Nxf7 {+6.30/19 29} 57... Rb7 {-7.12/14 24} 58. Rh7 {
+6.56/18 25} 58... b5 {-7.12/14 23} 59. Rh8+ {+6.78/17 22} 59... Ka7 {
-8.00/14 46} 60. Nd8 {+7.76/16 30} 60... Rg7 {-8.06/14 38} 61. Nxc6+ {
+8.76/16 28} 61... Kb6 {-8.12/14 67} 62. axb5 {+9.16/17 19} 62... Kc7 {
-8.12/13 24} 63. a4 {+11.58/16 32} 63... Rg6+ {-8.25/13 45} 64. Kd5 {
+15.09/18 32} 64... Rg5+ {-8.43/13 39} 65. Ne5 {+15.56/18 31} 65... Kb6 {
-8.68/13 24} 66. Rh6+ {+15.57/17 26} 66... Ka5 {-8.75/14 37} 67. Ra6+ {
+15.92/17 20} 67... Kb4 68. b6 {+15.92/17 32} 68... Rg7 {-8.75/13 29} 69. Ra7 {
+16.48/16 32} 69... Rg8 {-8.81/13 30} 70. b7 {+16.72/16 33} 70... Kc3 {
-8.87/13 43} 71. Ra8 {+17.15/14 33} 71... Rxg2 {-8.87/12 26} 72. b8=Q {
+17.65/12 11} 72... Rb2 {-9.25/12 51} 73. Qh8 {+M8/13 144} 73... Rb7 {
-9.37/11 32} 74. Nc6+ {+M7/10 23} 74... Kd3 {-9.75/11 30} 75. Kxc5 {+M6/11 13}
75... Rc7 76. Rf8 {+M5/16 15} 76... Rxc6+ 77. Kxc6 {+M4/47 6} 77... Kd2 78.
Qb2+ {+M3/50 20} 78... Ke3 79. Qf2+ {+M2/50 29} 79... Ke4 80. Rf3 {+M1/50 38}
80... h3 81. Qe3# {+M0/47 28 Mat} 1-0

I have been replaying the same game. Thing I noticed R161 scores go in steps by 0.06 / 0.07

Question for Bob, is this typical Crafty behaviour ?

Technical now:

Rybka 1.4 (size 2.2 Mb) clean, no Crafty code (no 99999 etc found)

Rybka 1.5 (size 2.2 Mb) Crafty code (99999 present)
Rybka 1.5a (size 2.5 Mb) Crafty code (99999 present)
Rybka 1.5b (size 2.5 Mb) Crafty code (99999 present)

Rybka 1.6.1 (size 2.7 Mb) Crafty code (99999 present)

On the R15's and R161 IDA reports that debug code is inside.

Could that mean that no death-code optimizing was done by the compiler?
(1) Hard to say. There has been a "wtm" bonus which for pretty static searches could make the eval oscillate back and forth by 0.05, which is (I think) the wtm bonus. I'd have to look more carefully at 19.x which I have not looked at in any detail in 5 years or so...

(2) I am certain that at least some of the non-chess code (initialization and such) was compiled without optimizing. I seem to recall more than one place where you look at something and think "why did it produce code that looks like that." Wylie, Mark and I had a discussion either in the panel, on open-chess, or via email, about this issue. But it seemed to be only in the non-time-critical places, and not all of them.

For the EGTB code Vas copied, and the if (ms = 99999) the compiler can not optimize that away. It can't determine at compile time whether the 99999 return value can ever be possible or not, if that is what you are asking about...

(3) 99999 is not the only thing. the -999999 is another good sentinel as this is used in NextMove. That was a simple trick I used to make sure the hash move was pushed to the bottom of the move list since it has already been searched by the time we get to the capture search... BTW Mark has verified that there are still parts of Crafty in 1.4... probably from an earlier version. I think the ms = 99999 code was added in 18.0...

BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Re: pre-Beta Rybkas

Post by BB+ » Fri Oct 21, 2011 5:47 am

Rebel wrote:I have been replaying the same game. Thing I noticed R161 scores go in steps by 0.06 / 0.07
Rybka used MTD(f) at that time. In June 2005 Rajlich concluded that MTD(f) was not worth the trouble. Similarly, while the R161 eval has some Crafty parts, other parts follow his description here. [And there's the material imbalance table, of course].
Rybka 1.4 (size 2.2 Mb) clean, no Crafty code (no 99999 etc found)
Here are some Crafty parts in Rybka 1.4 -- these correspond to the ICGA webpages on such:

Code: Select all

0x00405917:     xor    %eax,%eax
0x00405919:     lea    0x0(%esp),%esp
0x00405920:     mov    0x63c5c0,%esi
0x00405926:     mov    %ecx,(%eax,%esi,1)
0x00405929:     mov    0x63c5c0,%esi
0x0040592f:     mov    %ecx,0x4(%eax,%esi,1)
0x00405933:     mov    0x63c5c0,%esi
0x00405939:     mov    %cx,0x8(%eax,%esi,1)
0x0040593e:     mov    0x63c5c0,%esi
0x00405944:     mov    %cl,0xf(%eax,%esi,1)   <--- repeated zeroing
0x00405948:     mov    0x63c5c0,%esi
0x0040594e:     mov    %cl,0xf(%eax,%esi,1)   <--- repeated zeroing
0x00405952:     mov    0x63c5c0,%esi
0x00405958:     mov    %cl,0xa(%eax,%esi,1)
0x0040595c:     mov    0x63c5c0,%esi
0x00405962:     mov    %cl,0x11(%eax,%esi,1)
0x00405966:     mov    0x63c5c0,%esi
0x0040596c:     mov    %cl,0x10(%eax,%esi,1)
0x00405970:     mov    0x63c5b8,%esi
0x00405976:     inc    %edx
0x00405977:     add    $0x18,%eax
0x0040597a:     cmp    %esi,%edx
0x0040597c:     jl     0x405920

Code: Select all

0x004091fd:     push   %esi
0x004091fe:     call   0x40abf0
0x00409203:     mov    0xc(%ebp),%ecx
0x00409206:     add    $0x4,%esp
0x00409209:     cmp    $0x1869f,%eax          <--- compares to 99999
0x0040920e:     je     0x40923c
0x00409210:     add    %eax,%ecx
0x00409212:     mov    0x63c9a4,%eax
0x00409217:     cmp    %eax,%ecx
0x00409219:     mov    %ecx,0xc(%ebp)
0x0040921c:     jle    0x40922c
0x0040920e:     je     0x40923c
0x00409210:     add    %eax,%ecx
0x00409212:     mov    0x63c9a4,%eax
0x00409217:     cmp    %eax,%ecx
0x00409219:     mov    %ecx,0xc(%ebp)
0x0040921c:     jle    0x40922c
0x0040921e:     testb  $0x1,-0x1c(%ebp)
0x00409222:     jne    0x40922a
0x00409224:     sar    $0x2,%ecx
0x00409227:     mov    %ecx,0xc(%ebp)
0x0040922a:     cmp    %eax,%ecx
0x0040922c:     jge    0x40925b
0x0040922e:     testb  $0x2,-0x1c(%ebp)
0x00409232:     jne    0x40925b
0x00409234:     sar    $0x2,%ecx
0x00409237:     mov    %ecx,0xc(%ebp)
0x0040923a:     jmp    0x40925b

Code: Select all

0x00408fa0:     push   %ebp
0x00408fa1:     mov    %esp,%ebp
0x00408fa3:     sub    $0x44,%esp
0x00408fa6:     push   %ebx
0x00408fa7:     push   %esi
0x00408fa8:     mov    0xc(%ebp),%esi
0x00408fab:     mov    0xb0e(%esi),%cl
0x00408fb1:     xor    %ebx,%ebx
0x00408fb3:     mov    $0xd,%al            <---- compare to 13
0x00408fb5:     cmp    %al,%cl
0x00408fb7:     push   %edi
0x00408fb8:     mov    %ebx,-0x18(%ebp)
0x00408fbb:     mov    %ebx,-0xc(%ebp)
0x00408fbe:     mov    %ebx,-0x10(%ebp)
0x00408fc1:     mov    %ebx,-0x14(%ebp)
0x00408fc4:     movl   $0x3,-0x1c(%ebp)    <---- set can_win to 3
0x00408fcb:     jge    0x409022
0x00408fd5:     push   %esi
0x00408fd6:     call   0x407bd0            <---- Call EvaluateWinner()
EvaluateWinner() also looks the same (at a glance).

Code: Select all

0x00414f99:     test   %edi,%edi
0x00414f9b:     je     0x414fe7
0x00414f9d:     mov    (%edx),%eax
0x00414f9f:     lea    0x2c7(%ebp,%ebp,2),%ecx
0x00414fa6:     mov    %eax,0x1060(%esi,%ebp,4)
0x00414fad:     lea    (%esi,%ecx,4),%eax
0x00414fb0:     movl   $0x0,(%edx)
0x00414fb6:     mov    (%eax),%edx
0x00414fb8:     inc    %edx
0x00414fb9:     mov    %edx,%ecx
0x00414fbb:     cmp    $0x3,%ecx
0x00414fbe:     mov    %edx,(%eax)
0x00414fc0:     jle    0x414fd9
0x00414fc2:     mov    0x137c(%esi,%ebp,4),%edx
0x00414fc9:     movl   $0xa,0xb20(%ebx)            <--- set phase to 10
0x00414fd3:     mov    %edx,0xb18(%ebx)
0x00414fd9:     mov    0xac(%esp),%edi
0x00414fe0:     mov    $0x9,%eax                   <--- phase 9
0x00414fe5:     jmp    0x415035
This is phase 9 of NextMove().However, -99999 (0xfffe7961) is used as the sentinel in other places of this function (rather than -999999, as with Crafty 19, Rybka 1.5, and Rybka 1.6.1).

Code: Select all

0x00402ec0:     sub    $0xc,%esp                   # NextEvasion()
0x00402ec3:     push   %ebx
0x00402ec4:     push   %esi
0x00402ec5:     mov    0x18(%esp),%esi
0x00402ec9:     push   %edi
0x00402eca:     mov    0x20(%esp),%edi
0x00402ece:     lea    (%edi,%edi,2),%eax
0x00402ed1:     lea    (%esi,%eax,4),%ebx
0x00402ed4:     mov    0xb20(%ebx),%eax            <--- current phase
0x00402eda:     dec    %eax
0x00402edb:     mov    %ebx,0xc(%esp)
0x00402edf:     je     0x402ef8
0x00402ee1:     sub    $0x6,%eax                   <--- sub 6 from phase
0x00402ee4:     je     0x402f3a
0x00402ee6:     sub    $0x3,%eax                   <--- 3 more
0x00402ee9:     je     0x4030ec
0x00402eef:     pop    %edi
0x00402ef0:     pop    %esi
0x00402ef1:     xor    %eax,%eax
0x00402ef3:     pop    %ebx
0x00402ef4:     add    $0xc,%esp
0x00402ef7:     ret    

0x00402ef8:     mov    0x137c(%esi,%edi,4),%ecx    <--- same 0x137c as R16
0x00402eff:     mov    0x24(%esp),%edx
0x00402f03:     push   %ecx
0x00402f04:     push   %edx
0x00402f05:     push   %edi
0x00402f06:     push   %esi
0x00402f07:     call   0x41b0c0
0x00402f0c:     mov    %eax,0x1380(%esi,%edi,4)
0x00402f13:     mov    (%esi,%edi,4),%eax
0x00402f16:     add    $0x10,%esp
0x00402f19:     test   %eax,%eax
0x00402f1b:     je     0x402f3a
0x00402f1d:     mov    %eax,0x1060(%esi,%edi,4)
0x00402f24:     pop    %edi
0x00402f25:     pop    %esi
0x00402f26:     movl   $0x7,0xb20(%ebx)             <--- phase 7
0x00402f30:     mov    $0x1,%eax
0x00402f35:     pop    %ebx
0x00402f36:     add    $0xc,%esp
0x00402f39:     ret    

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: pre-Beta Rybkas

Post by Rebel » Fri Oct 21, 2011 10:58 am

Set some breakpoints and the code as listed on the icga-wiki is active.

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: pre-Beta Rybkas

Post by Rebel » Fri Oct 21, 2011 11:10 am

hyatt wrote: (3) 99999 is not the only thing. the -999999 is another good sentinel as this is used in NextMove.
Checked this as well, breakpoint on -999999 --> active.

Because of the strange scores, debug info (no full optimizing) inside the executable, the increasing sizes of the executables I somehow got the impression Crafty code inside but never called. That's not the case.

Post Reply