Gull 3 (Linux port) released.

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

Moderator: Ras

syzygy
Posts: 5951
Joined: Tue Feb 28, 2012 11:56 pm

Re: Gull 3 (Linux port) released.

Post by syzygy »

basil00 wrote:
Dann Corbit wrote:The windows format specifiers for 64 bit integers are wrong for posix platforms.
Yep. Now fixed.
For portability, include inttypes / inttypes.h and use PRId64:

Code: Select all

fprintf(stdout,"info depth %d seldepth %d score %s%d upperbound nodes %"PRId64" nps %"PRId64" pv %s\n", ...
(If I did not introduce a typo.)
Dann Corbit
Posts: 12870
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Gull 3 (Linux port) released.

Post by Dann Corbit »

Using lld seems just as portable to me to specify a 64 bit signed integer, at least for C99 and above or using the C++ standard (and the code is C++).

http://www.cplusplus.com/reference/cstdio/printf/
syzygy
Posts: 5951
Joined: Tue Feb 28, 2012 11:56 pm

Re: Gull 3 (Linux port) released.

Post by syzygy »

Dann Corbit wrote:Using lld seems just as portable to me to specify a 64 bit signed integer, at least for C99 and above or using the C++ standard (and the code is C++).
Yes, and Microsoft does not support C99.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Gull 3 (Mac port soon to be released)

Post by MikeB »

basil00 wrote:
Dann Corbit wrote:The windows format specifiers for 64 bit integers are wrong for posix platforms.
Yep. Now fixed.
MikeB wrote:No dice - will need somebody who has more programming knowledge than me.
Should now be fixed. The seg. fault was caused by the format strings (at least when I tried it).

Medium term I plan to add in MacOSX support, as well as the original Windows support, as one unified code-base.
Dann Corbit wrote: The version without your patch clearly generates the wrong moves for this position.
Interesting. I wonder how much this affected Gull? The bug is only triggered on very specific conditions, i.e. pawn on h7 capture/promotes to a knight on g8.
This was very helpful - she's up and running on Mac Pro - playing 12 core vs 12 core match against Crafty with tc 3/3. From the start position, it can search 20M+ nps . Currently does not display time used - probably because I ported some of crafty time code - but did not update the display. Child processes were not being killed on exit , so I added code to fix that for the Mac. Right now I'm focused on the playability. It's looking good. Did some minor tweaks - such as making the default the number of actual cores and not virtual cores etc. Not a trained programmer by any means - this is just a hobby.

Here is its first win - first game was drawn

[pgn][Event "Computer Chess Game"]
[Site "Mac-Pro.local"]
[Date "2015.10.29"]
[Round "3"]
[White "Gull 3 x64 Mac"]
[Black "Crafty-25.0"]
[Result "1-0"]
[TimeControl "180+3"]
[FEN "1nbq1rk1/1p2ppbp/2p2np1/3p4/2P5/1P1P1NP1/1B2PPBP/rNQ2RK1 w - - 0 1"]
[SetUp "1"]

{--------------
. n b q . r k .
. p . . p p b p
. . p . . n p .
. . . p . . . .
. . P . . . . .
. P . P . N P .
. B . . P P B P
r N Q . . R K .
white to play
--------------}
1. Bxa1 {+0.23/17} e6 {+0.29/21 18} 2. Nbd2 {+0.28/17 7} Na6 {+0.20/20 16}
3. d4 {+0.19/18 13} Nb4 {+0.18/20 6} 4. Ne5 {+0.34/17 4} Nd7 {+0.15/21 6}
5. Ndf3 {+0.33/18 6} Nxe5 {+0.25/24 6} 6. Nxe5 {+0.36/20 18} f6
{+0.22/25 30} 7. Nf3 {+0.36/19 0.1} Re8 {+0.27/25 4} 8. Qd2 {+0.36/20 9}
Na6 {+0.08/22 4} 9. Rd1 {+0.30/19 11} Qb6 {+0.25/26 7} 10. Qa2
{+0.38/21 14} Bd7 {+0.12/27 4} 11. Bc3 {+0.38/19 0.2} Ra8 {+0.11/26 4} 12.
Ra1 {+0.35/20 6} Nc7 {+0.10/22 4} 13. Ba5 {+0.35/19 0.1} Qa7 {+0.23/22 4}
14. Qb1 {+0.28/21 18} g5 {+0.23/20 4} 15. h4 {+0.50/19 10} g4 {+0.02/24 4}
16. Ne1 {+0.47/20 15} Qxd4 {-0.16/26 4} 17. Ra4 {+0.75/17 1.4} Rxa5
{-0.16/26 4} 18. Rxa5 {+0.75/16 0.1} f5 {-0.16/24 4} 19. Nd3 {+0.72/17 2.0}
Na6 {-0.22/22 4} 20. e3 {+0.79/19 5} Qc3 {-0.18/22 4} 21. Ra2
{+0.87/18 0.9} Kf7 {-0.24/24 4} 22. h5 {+0.86/19 6} Nb4 {-0.44/23 6} 23.
Nxb4 {+0.85/18 1.5} Qxb4 {-0.35/23 4} 24. Bf1 {+1.01/19 5} Be5 {-0.40/21 7}
25. Ra8 {+1.03/19 3} h6 {-0.28/20 15} 26. Qa2 {+1.47/15 1.5} Qb6
{+0.00/23 24} 27. Qd2 {+1.69/17 2.6} Bg7 {+0.24/25 8} 28. b4 {+1.78/18 5}
Qc7 {+0.00/24 2.9} 29. b5 {+1.86/17 5} Qb6 {+0.65/24 10} 30. Qb4
{+2.12/18 6} c5 {+0.93/25 5} 31. Qd2 {+2.36/19 6} Qd6 {+0.99/24 2.7} 32.
cxd5 {+2.68/18 3} exd5 {+1.26/27 6} 33. Qa5 {+2.57/17 2.5} Bf6 {+1.68/25 8}
34. Qa7 {+2.66/18 1.6} d4 {+1.87/24 4} 35. Qb8 {+2.64/19 2.8} Qxb8
{+2.41/26 4} 36. Rxb8 {+2.88/20 3} Ke7 {+3.11/26 6} 37. exd4 {+3.06/19 3}
Bxd4 {+2.84/28 2.6} 38. Rxb7 {+3.49/19 6} c4 {+3.17/30 6} 39. Bxc4
{+3.77/18 2.2} f4 {+3.26/29 3} 40. gxf4 {+4.20/18 2.2} g3 {+3.67/29 3} 41.
Kf1 {+4.28/19 1.8} Bxf2 {+5.19/28 9} 42. Kg2 {+4.73/18 2.8} Kd8
{+5.75/27 5} 43. Bd5 {+5.07/20 3} Bc8 {+7.93/27 7} 44. Rh7 {+5.66/16 1.5}
Bd7 {+8.77/27 3} 45. Rxh6 {+6.14/19 4} Bxb5 {+8.32/25 2.4} 46. f5
{+6.14/18 0.1} Kd7 {+8.42/25 2.1} 47. f6 {+7.00/19 1.6} Bd3 {+9.73/26 5}
48. Rh8 {+8.18/18 2.2} Bc5 {+9.83/28 2.6} 49. f7 {+8.50/20 2.4} Be7 50.
Kxg3 {+9.18/18 1.1} Kd6 {+16.58/22 4} 51. Bf3 {+9.34/22 2.3} Kc7
{+17.02/22 4} 52. f8=Q {+99.75/23 24} Bxf8 {+327.33/27 2.2} 53. Rxf8
{+99.75/22 0.1} Kb6 {+327.37/31 2.9} 54. Kf4 {+99.77/19 3} Kc5
{+327.49/34 2.0} 55. Be4 {+99.83/21 2.4} Bxe4 {+327.51/46 2.0} 56. Kxe4
{+99.87/26 2.5} Kd6 {+327.53/23 0.1} 57. h6 {+99.89/30 5} Ke7
{+327.55/23 0.1} 58. Rf1 {+99.89/34 6} Ke6 {+327.57/23 0.2}
1-0[/pgn]
basil00
Posts: 55
Joined: Thu Oct 22, 2015 2:14 am

Re: Gull 3 (Mac port soon to be released)

Post by basil00 »

MikeB wrote:Child processes were not being killed on exit , so I added code to fix that for the Mac.
How did you fix this? This is what the prctl was used for on Linux.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Gull 3 (Mac port soon to be released)

Post by MikeB »

I'm not the computer right now - but I was able to access the code. I found the code online , but when I just searched the file - I see it's already there in another section at around 100 lines below it ~ line 6892. Just copy the same code to where the quit command ( about line 6792). SIGPIPE does about the same thing as SIGTERM without providing the TERMINATED 15 message . Should work for LINUX too
Dann Corbit
Posts: 12870
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Gull 3 (Linux port) released.

Post by Dann Corbit »

syzygy wrote:
Dann Corbit wrote:Using lld seems just as portable to me to specify a 64 bit signed integer, at least for C99 and above or using the C++ standard (and the code is C++).
Yes, and Microsoft does not support C99.
They do, however, support the %lld and %llu format specifiers.

2003 not there yet:
https://msdn.microsoft.com/en-us/librar ... 71%29.aspx

2005 (and all later versions) has it:
https://msdn.microsoft.com/en-us/librar ... 80%29.aspx
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Gull 3 (Mac port soon to be released)

Post by JoshPettus »

MikeB wrote: This was very helpful - she's up and running on Mac Pro - playing 12 core vs 12 core match against Crafty with tc 3/3.
Does it run better then the windows version under wine?
User avatar
Dariusz
Posts: 379
Joined: Sat Jun 13, 2015 10:08 am
Location: Poland
Full name: Dariusz Domagała

Re: Gull 3 (Linux port) released.

Post by Dariusz »

Medium term I plan to add in MacOSX support, as well as the original Windows support, as one unified code-base.
Good news! I waiting for it :-)
Regards, Darius
https://chessengeria.eu
syzygy
Posts: 5951
Joined: Tue Feb 28, 2012 11:56 pm

Re: Gull 3 (Linux port) released.

Post by syzygy »

Dann Corbit wrote:
syzygy wrote:
Dann Corbit wrote:Using lld seems just as portable to me to specify a 64 bit signed integer, at least for C99 and above or using the C++ standard (and the code is C++).
Yes, and Microsoft does not support C99.
They do, however, support the %lld and %llu format specifiers.

2003 not there yet:
https://msdn.microsoft.com/en-us/librar ... 71%29.aspx

2005 (and all later versions) has it:
https://msdn.microsoft.com/en-us/librar ... 80%29.aspx
At least mingw still gave a compiler error or warning a few years ago when crosscompiling for Windows.