Crafty 25.x ...?

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

Moderators: hgm, Rebel, chrisw

Frank Quisinsky
Posts: 6808
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Crafty 25.x ...?

Post by Frank Quisinsky »

Hi Bob,

for me a bad situation that Crafty is at the moment no longer qualificated for my new FCT League 2 system. You wrote for a while that a new version is on the way, around 60 Elo stronger as the preview version.

Normaly I don't asked here, means I am using official versions for my Rating list and can wait ...

But I can give up my complete work if Crafty isn't included in my continuous tourney. I am sure you have an idea to avoid that.

Maybe a new release version ... loud thinking.
Compiled by Dann Corbit ... louder thinking.

And here in Trier all will be OK in testing engines after a new release version.

I like it so much to looking in games Crafty vs. the others since more as 20 years.

Best
Frank
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty 25.x ...?

Post by bob »

Frank Quisinsky wrote:Hi Bob,

for me a bad situation that Crafty is at the moment no longer qualificated for my new FCT League 2 system. You wrote for a while that a new version is on the way, around 60 Elo stronger as the preview version.

Normaly I don't asked here, means I am using official versions for my Rating list and can wait ...

But I can give up my complete work if Crafty isn't included in my continuous tourney. I am sure you have an idea to avoid that.

Maybe a new release version ... loud thinking.
Compiled by Dann Corbit ... louder thinking.

And here in Trier all will be OK in testing engines after a new release version.

I like it so much to looking in games Crafty vs. the others since more as 20 years.

Best
Frank
It is getting closer and closer to being ready. But there are other things to do besides just the code changes, i.e. the comments. I have gotten most of those done, but I use them to document what goes on internally and I want them to be right, not "just close".

If you want an executable we can do that easily. So far as I know it is playing solidly. It looks like the new version is maybe +60 better than the old on one core. Significantly more on larger numbers of cores...
supersharp77
Posts: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: New Crafty Coming Soon?

Post by supersharp77 »

Thx Dan........are the tactical issues straightened out with the new edition? if so should be significantly stronger indeed! AR :) :wink:
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: New Crafty Coming Soon?

Post by bob »

supersharp77 wrote:Thx Dan........are the tactical issues straightened out with the new edition? if so should be significantly stronger indeed! AR :) :wink:
Since you ask, an interesting bug. I thought the problem was in the parallel search and went over it VERY carefully. I found one almost impossible-to-occur race condition, and fixed it but the bug persisted. The problem with the bug was that it took about an hour's worth of running on 20 cores to cause a mysterious segfault. I kept adding debugging info and finally ran the issue down to "capturing a king" in the basic search. Could not figure out how this was possible. Here's the story from the beginning.

Years ago I played with an 8 byte hash entry, but was concerned with the excessive collisions. Of course the paper I wrote with Cozzie showed that they were really harmless, but still. But I had done that test prior to the paper. A couple of weeks ago I decided to visit that again. Easy enough. And it looked solid playing normal games. But when I started the extreme SMP tests it began to crash. A test run with 20 cores takes 2 hours. On average I would see one crash out of 4 test runs. VERY rare. So back to where I was above. I discovered the problem was capturing a king, which is not supposed to happen. I then step forward 2 plies and generate moves, and the move generator was not particularly happy with no king. So it produced a move that would cause the board to become corrupted.

But now I had a candidate, so how is the king getting captured. Since inside the main search loop I test for being in check after making a move to avoid searching illegal moves, so that seemed to be impossible. Debugging continued.

I finally tracked it down to what appeared to be an illegal move from the hash table. But that move is tested for legality in NextMove(). Or is it? I looked carefully, and decided "yes". So something is corrupting some other data structure that then mimics this behavior.

More debugging. I finally decided to look at one of these moves where the king was captured, so I added code to dump most everything when that happened. I found that at ply=N white checked black, and at ply=N+1, black played a move that did not address the check, leaving the king capture to ply=N+2. I am thinking "how?" But I decided to look at the move and sure enough it came from the hash table. So I figured this must be the new hash stuff, but then I thought further "OK, when I take the move from the hash table, I do a basic legality check, but this only checks for the right piece on the from/to squares. Which this bogus move met. So I believe I am on the right track. But then I remembered, "After I make the move in SearchMoves(), I then immediately check to see if the side on move is still in check after making the move. Or did I? Looking at the code, the answer was "yes".

And then it hit me. I only check for legality if I am NOT in check, because if I am in check I only generate legal moves and don't need the wasted test. And that showed me the error. I needed a position where I was in check, and got a real hash collision that gave me a move that looked legal (from/to squares, moving and captured pieces, etc) that was illegal. If that happens, I play the hash table move with a half-assed legality check that passes with flying colors here and promptly crash and burn.

I removed the 8-byte hash entry stuff, and moved to the Cray Blitz 12-byte hash entry (crafty was using a 16 byte entry which was overkill). There is still a small hole since the longer hash signature stored in 12 bytes greatly reduces the potential for collisions, but it does NOT reduce it to zero.

Bottom line, it was a hashing algorithm change, the parallel search has been working fine all along. But a solid week+ down the drain chasing this silly bug.
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: New Crafty Coming Soon?

Post by Dann Corbit »

I have seen that "captured a king" bug occur quite a few times.

In Windows, using epdpfga from the EPD interface, it will simply exit when it hits that condition. Pretty annoying if I want to analyze a few hundred thousand positions over a weekend and it happens in the first few hours.

Glad to hear that you tracked it down.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: New Crafty Coming Soon?

Post by bob »

Dann Corbit wrote:I have seen that "captured a king" bug occur quite a few times.

In Windows, using epdpfga from the EPD interface, it will simply exit when it hits that condition. Pretty annoying if I want to analyze a few hundred thousand positions over a weekend and it happens in the first few hours.

Glad to hear that you tracked it down.
This was not in any previous version, it came from the 8 byte hash entry having too many collisions. I remembered this problem from the last time I did this maybe 15 years ago. I thought the legality check I added would solve it. It does for 99.9% of the positions, but there is an exception. The only time I see the captured a king error is when oddball EPD records pass my basic error checking but still have some sort of oddity that makes them illegal. If you have any legal EPD that causes a problem, by all means send it to me.
Frank Quisinsky
Posts: 6808
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: AVX ...

Post by Frank Quisinsky »

Hello Bob,

thanks for all the information you gave in this thread.
Very soon Crafty can fight again vs. the others on my systems.

Good News!

PS:
Do you think "AVX" can give Crafty a little boaster?


At this time Intel Core i7 forth generation is available I read on Intel site that with AVX a very big speedup can be possible ... in different cases with more as 100% if I right understand. But for computer chess I can't see that AVX give engines such a big speedup, means if I compare with engines AVX is included.

Best
Frank

That's my "CURRENT" problem ...
21 for League 1 and 21 for League 2.

And Crafty is "MUST HAVE" in Computer chess!

Code: Select all

      Program                          Elo    +    -   Games   Score  Av.Op.  Draws
  01. Stockfish 26Apr2015 BMI2 x64     3151   17   17  1800    82.9%   2847   30.7%
  02. Komodo 9 x64                     3147   17   17  1800    82.6%   2847   29.8%
  03. Fire 4 x64                       3048   12   12  2450    74.3%   2836   35.1%
  04. GullChess 3.0 BMI2 x64           3039   11   11  2600    71.5%   2856   40.5%
  05. Equinox 3.30 x64                 2990   12   12  2400    68.0%   2842   42.1%
  06. Critter 1.6a x64                 2981   14   14  1700    67.6%   2841   44.5%
  07. Sting SF 4.8.4 x64               2933   12   12  2050    60.0%   2857   45.9%
  08. Protector 1.7.0 x64              2911   12   12  2150    55.8%   2869   45.1%
  09. Nirvanachess 2.1c POP x64        2901   13   13  1700    58.3%   2839   47.7%
  10. Hannibal 1.5 x64                 2898   12   12  2150    56.9%   2847   45.8%
  11. Texel 1.05 x64                   2895   11   11  2250    57.0%   2843   42.6%
  11. Chiron 2.0 x64                   2895    8    8  4250    59.8%   2820   39.8%
  13. Naum 4.6 x64                     2882   11   11  2500    57.5%   2826   43.3%
  14. Senpai 1.0 SSE42 x64             2831    8    8  4250    51.9%   2822   41.2%
  15. Hiarcs 14 WCSC w32               2825    8    8  4250    51.1%   2822   43.1%
  16. Andscacs 0.72 POP x64            2812   11   11  2450    48.5%   2830   42.6%
  17. Sjeng c't 2010 w32               2799   11   11  2300    47.0%   2828   41.8%
  18. Shredder 12 x64                  2795   10   10  3100    43.3%   2854   40.6%
  19. Vajolet2 2.0 POP x64             2786   12   12  1800    45.3%   2828   41.4%
  20. Junior 13.3.00 x64               2784    9    9  3300    45.6%   2824   40.0%
  21. Spike 1.4 Leiden w32             2771   10   10  2800    39.3%   2863   41.0%
  ---------------------------------------------------------------------------------
  22. Deuterium 14.3.34.130 POP x64    2759   10   10  2750    42.9%   2821   43.1%
  23. iCE 2.0 v2240 POP x64            2758    8    8  4600    47.8%   2781   43.4%
  24. Quazar 0.4 x64                   2757    9    9  3450    41.5%   2832   40.8%
  25. DiscoCheck 5.2.1 x64             2756   10   10  2900    41.2%   2831   38.2%
  26. Alfil 15.04 C# Beta 24 x64       2753   15   15  1050    54.2%   2723   36.0%
  26. Spark 1.0 x64                    2753    8    8  5200    46.3%   2789   41.5%
  26. SmarThink 1.70 SSE3 x64          2753    9    9  3850    42.6%   2817   37.8%
  29. Cheng4 0.38 x64                  2750   11   11  2200    44.6%   2798   42.3%
  30. Fizbo 1.3.1 x64                  2745   11   11  2400    43.3%   2803   41.7%
  31. Zappa Mexico II x64              2741   10   10  3050    39.2%   2835   40.3%
  32. Thinker 5.4d Inert x64           2733   11   11  2350    39.1%   2827   41.1%
  33. EXchess 7.71b x64                2723   16   16  1000    49.5%   2727   45.8%
  34. Gaviota 1.0 AVX x64              2722    7    7  5350    42.2%   2791   37.3%
  35. Atlas 3.80 x64                   2719   12   12  2100    41.0%   2795   41.7%
  36. MinkoChess 1.3 JA POP x64        2716   12   12  1800    43.1%   2768   46.0%
  37. Arasan 17.5 POP x64              2715   13   13  1800    43.4%   2767   43.6%
  38. Murka 3 x64                      2693   12   12  1800    40.0%   2769   46.8%
  38. Rodent 1.7 Build 1 POP x64       2693   13   13  1600    42.0%   2752   43.2%
  40. Nemo 1.01 Beta POP x64           2687   12   12  1800    39.5%   2765   43.1%
  41. DisasterArea 1.54 x64            2672   11   11  1950    38.9%   2754   43.3%
  42. Pedone 1.1 BMI2 x64              2666   13   13  1650    38.6%   2750   45.0%
  ---------------------------------------------------------------------------------
  43. Crafty 24.1 SSE42 x64            2650   10   10  2900    40.0%   2728   37.6%
User avatar
GONeill
Posts: 87
Joined: Sun Jun 15, 2014 6:40 am
Location: New Zealand
Full name: Graham O'Neill

Re: Crafty 25.x ...?

Post by GONeill »

Hi,

Is there anywhere to get Crafty executables (Win32 and Win64)? There used to be a page at http://www.kikrtech.com/ but that has changed completely.

Really looking forward to Crafty 25!

Many thanks,
Graham
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: AVX ...

Post by bob »

Frank Quisinsky wrote:Hello Bob,

thanks for all the information you gave in this thread.
Very soon Crafty can fight again vs. the others on my systems.

Good News!

PS:
Do you think "AVX" can give Crafty a little boaster?


I will experiment a bit with AVX. Since I have the intel C++ compiler on this 20 core box, if anyone can produce decent AVX code I would assume Intel's compiler can do so...

I have not played with intel optimization settings in several years, but something tells me there will be no huge speed gain. Heck, I'm happy with the 100M nodes per second on this 20 core box as is. :)
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty 25.x ...?

Post by bob »

GONeill wrote:Hi,

Is there anywhere to get Crafty executables (Win32 and Win64)? There used to be a page at http://www.kikrtech.com/ but that has changed completely.

Really looking forward to Crafty 25!

Many thanks,
Graham
I'll see what can be done. The problem I ran into years ago was there are so many operating system versions, so many more different Intel/AMD platforms, that providing the fastest possible executables was a job by itself. I've probably removed most of the 32 bit stuff from Crafty (i.e. 32bit LSB/MSB/PopCnt asm code). I don't think I have seen a 32 bit system in 10 years now. :)