SUNFISH - a new chess engine written in Python !

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
Sylwy
Posts: 3358
Joined: Fri Apr 21, 2006 2:19 pm
Location: IASI (Romania) - the historical capital of MOLDOVA

Re: THANK YOU MAESTRO RON ! !

Post by Sylwy » Sun Mar 02, 2014 10:27 am

Ron Murawski wrote:
Sylwy wrote:By far the goodest chess engine written in Python ! A superb architecture !

SilvianR :wink:

NR: ComputerChessWiki - please post this superb chess engine in EnginesList ! THANK YOU !
Hi Silvian,

Sunfish was added to the Chess Engine List on Feb 27.

Ron
SilvianR :lol:

User avatar
Graham Banks
Posts: 33541
Joined: Sun Feb 26, 2006 9:52 am
Location: Auckland, NZ

Re:A savage attacker !

Post by Graham Banks » Sun Mar 02, 2014 5:05 pm

Sylwy wrote:
Graham Banks wrote:
Sylwy wrote:By far the goodest chess engine written in Python ! A superb architecture !
How strong do you estimate Sunfish to be?
Hello Graham !

It crushed all weak chess engine it played ! And know very well how to do that !. Now plays with some better engines.

Two tricks:

1.-if you want Sunfish to play with withe - edit test.py in the second line of "def xboard()" (the fen);
2.-if you have installed on your machine only Python 2.7/3.3 interpreter ( and not pypy) edit the first line in xboard .py (replace "pypy" with "python").

SilvianR :wink:

Just a mild sample of its savage play. A J_E_W_E_L IN PYTHON! Take a look please ,also, at the architecture of this chess engine !!!!

Image
Thanks Ruxy. :)
My email addresses:
gbanksnz at gmail.com
gbanksnz at yahoo.co.nz

User avatar
Sylwy
Posts: 3358
Joined: Fri Apr 21, 2006 2:19 pm
Location: IASI (Romania) - the historical capital of MOLDOVA

Re: Now- a better support for the WB protocol !!!

Post by Sylwy » Mon Mar 03, 2014 9:52 am

Download again this masterpiece:
======================================
https://github.com/thomasahle/sunfish/a ... master.zip
======================================

Put in sunfish-master folder a Sunfish.bat file with the following structure:

=======
C:\Python33\python -u xboard.py
=======

and a logo with the name:

Sunfish.bmp

And your engine is able to play with both white/black colours, supports . bin book...........

Rests only the qsearch problem !!!

I will include (like a delicious bonus) this engine in my future Java +Python SECOND LEAGUE 2014 !!!!

MILLION THANKS, THOMAS !!!

SilvianR :wink:

Image

Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 3:38 am
Location: Schenectady, NY
Contact:

Re:?????????????????............????????????????

Post by Ron Murawski » Mon Mar 03, 2014 9:17 pm

Ajedrecista wrote:Hello Ruxy:
Sylwy wrote:
Ron Murawski wrote:
Sylwy wrote:By far the goodest chess engine written in Python ! A superb architecture !

SilvianR :wink:

NR: ComputerChessWiki - please post this superb chess engine in EnginesList ! THANK YOU !
Hi Silvian,

Sunfish was added to the Chess Engine List on Feb 27.

Ron
Hello Maestro Ron !

The 2-nd of March 2014. Still nothing. A such beautiful engine ! Why ???

SilvianR :wink:

Image
Please take a look here:

http://computer-chess.org/forum/index.p ... ad&id=2764
Update Information: February 27, 2014 wrote:Sunfish ??? (WB)
new engine by Thomas Dybdahl Ahle
engine discovered by the incomparable Mr Silvian 'Ruxy' Sylwyka
Python source, didactic engine
- source code only engine
- requires installion of a Python interpreter
- run 'test.py' for Winboard engine
- engine doesn't do minor promotion or draws of any kind
- engine has no assigned version number
http://github.com/thomasahle/sunfish/ (source code)
http://github.com/thomasahle/sunfish/archive/master.zip (direct link)
It is the CCW Update Information section of February, 27th. It lists Sunfish as a novelty without engine version. It also credits the discover to you! I guess that the info of the link you provided and the info of the link I post are not synchronised. I recommend you the following link:

http://computer-chess.org/forum/

Regards from Spain.

Ajedrecista.
The quote from the update post states that Sunfish was added to the source-code-only list
http://www.computer-chess.org/doku.php? ... _only_list

I suspect that installing a Python interpreter, editing source code, and running Python engines are beyond what most computer-chess people expect. If an engine contains a coherent package that simplifies usage, then I list it with the 'normal' engines at the top of the list.

If anyone uses this technique:
http://www.logix4u.net/component/conten ... hon-script
and can post the exe somewhere that is publicly available, then I will list it as a normal engine.

If the author cleans up the source code so it does not need editing, then I will probably list it with the normal engines. I would like to see an engine version number as well.

Jamal Bubker
Posts: 268
Joined: Mon May 24, 2010 2:32 pm

Re: SUNFISH - a new chess engine written in Python !

Post by Jamal Bubker » Wed Mar 05, 2014 7:14 pm

Thank you Thomas for releasing your engine and thank you Ruxy for reporting this release !

User avatar
Sylwy
Posts: 3358
Joined: Fri Apr 21, 2006 2:19 pm
Location: IASI (Romania) - the historical capital of MOLDOVA

Re: SUNFISH (2)-THOMAS ADDED QSEARCH & NULL-MOVE !!!!!

Post by Sylwy » Wed Mar 05, 2014 8:05 pm

Hey men !

Sunfish rules ! Thomas just added qsearch & null-move to this beautiful chess engine !

https://github.com/thomasahle/sunfish/a ... master.zip

A very short test shows me a fantastic attacking entity ! Versus Mr.James Swaffort last creation !

Image

Try it !
A jewel in Python !!!

Have a nice day & night ( and.....don't forget Ukraine ) !
SilvianR :wink:

User avatar
Sylwy
Posts: 3358
Joined: Fri Apr 21, 2006 2:19 pm
Location: IASI (Romania) - the historical capital of MOLDOVA

Re: Installing Sunfish (2) in Arena GUI (MANUAL -:)))

Post by Sylwy » Thu Mar 06, 2014 6:40 am

1.-download Thomas original archive:

https://github.com/thomasahle/sunfish/a ... master.zip

2.-unzip somewhere on your machine;

3.- add the following two files (Sunfish2.bat and Sunfish2.bmp):

http://bayfiles.net/file/18qul/GdgR8g/for_Arena_GUI.zip

4.-download & install (if you haven't it yet) Python 3.3 interpreter (let the default installation path C:\Python33, or change the path in Sunfish2.bat file) from here:

http://www.python.org/ftp/python/3.3.4/python-3.3.4.msi

5.-on Arena GUI - install Sunfish2.bat like Wb engine.

Have fun !
SilvianR :wink:

User avatar
Sylwy
Posts: 3358
Joined: Fri Apr 21, 2006 2:19 pm
Location: IASI (Romania) - the historical capital of MOLDOVA

Re: Nice games of Sunfish (2)

Post by Sylwy » Thu Mar 06, 2014 7:57 am

Hi folks !

Just finished a short test :

Sunfish 2 - Pyotr Amateur 0.6 (Java): +4=2-0

Below is a superb miniature of Sunfish 2:

[pgn]
[Event "Sunfish2 Test"]
[Site "Iasi"]
[Date "2014.03.06"]
[Round "1"]
[White "Sunfish 2"]
[Black "Pyotr Amateur 0.6"]
[Result "1-0"]
[BlackElo "2200"]
[ECO "E04"]
[Opening "Catalan"]
[Time "09:27:44"]
[Variation "Open, 5.Nf3 c5 6.O-O"]
[WhiteElo "2200"]
[TimeControl "40/300:40/300:40/300"]
[Termination "normal"]
[PlyCount "35"]
[WhiteType "program"]
[BlackType "program"]

1. c4 e6 2. d4 d5 3. Nf3 Nf6 4. g3 Bb4+ 5. Bd2 Bxd2+ 6. Nbxd2 O-O 7. Bg2
dxc4 8. Nxc4 Qd5 9. Rc1 b5 10. Nh4 Qg5 11. f4 Qg4 12. Ne3 Qh5 13. Bxa8 Rd8
14. O-O c5 15. Bf3 Rxd4 16. Qxd4 cxd4 17. Rxc8+ Ne8 18. Rxe8# 1-0
[/pgn]

And a capture with the 6-th game:

Image

Regards,
:lol: SilvianR :wink:

User avatar
Sylwy
Posts: 3358
Joined: Fri Apr 21, 2006 2:19 pm
Location: IASI (Romania) - the historical capital of MOLDOVA

Re: Increasing the performances !

Post by Sylwy » Thu Mar 06, 2014 1:22 pm

Using pypy interpreter you can increase the speed /performances of this wonderful Python engine.
Download pypy 3.2.1 from here:

https://bitbucket.org/pypy/pypy/downloa ... -win32.zip

The Sunfish2.bat (using pypy) file (for Martin's Arena GUI) has -now - the structure:

@@@@@@@@@@@@@@@@@@@@@@@@@

C:\pypy3-2.1-beta1-win32\pypy.exe xboard.py

%%%%%%%%%%%%%%%%%%%%%%%

:lol: A good boost of Herr Sunfish ! :lol:

SilvianR :wink:

ZirconiumX
Posts: 1327
Joined: Sun Jul 17, 2011 9:14 am

Re: Increasing the performances !

Post by ZirconiumX » Thu Mar 06, 2014 6:15 pm

I have to agree with you Ruxy, the engine can be very aggressive. Mind you, so can others.

Poor Sunfish was helpless against Fairy-Max...

[pgn]
[Event "Computer Chess Game"]
[Site "THUNDERBIRD"]
[Date "2014.03.06"]
[Round "-"]
[White "Sunfish"]
[Black "Fairy-Max 4.8S"]
[Result "0-1"]
[TimeControl "40/300"]
[Annotator "1. +0.02 1... +0.25"]

1. Nc3 {+0.02/6} d6 {+0.25/9 8} 2. Nf3 {+0.54/6 4} Nf6 {+0.23/9 13} 3. e4
{+0.83/6 6} c6 {+0.10/9 11} 4. Be2 {+1.34/5 2.7} Nbd7 {-0.14/9 6} 5. O-O
{+1.33/5 2.9} g6 {-0.04/10 6} 6. Nd4 {+1.24/5 3} Bg7 {+0.09/10 12} 7. d3
{+0.25/5 4} O-O {+0.18/9 4} 8. Bg5 {-0.11/5 6} Qb6 {+0.12/9 6} 9. Nb3
{-0.14/5 2.9} Ne5 {+0.02/9 6} 10. d4 {+0.48/5 1.9} Ned7 {-0.14/10 8} 11.
Bxf6 {+0.27/5 6} Nxf6 {+0.45/10 5} 12. f4 {+0.10/5 6} h5 {+0.50/10 16} 13.
Rc1 {+0.12/4 2.5} Be6 {+0.51/9 5} 14. Na4 {+0.24/5 5} Qb4 {+0.62/10 6} 15.
Nc3 {+0.16/5 5} Bxb3 {+0.59/10 4} 16. cxb3 {-0.44/5 2.6} Ng4 {+0.68/11 15}
17. Bc4 {-0.81/5 4} Qb6 {+1.99/10 5} 18. Na4 {-1.33/5 4} Qxd4+ {+3.22/12 4}
19. Qxd4 {-3.00/7 4} Bxd4+ {+3.27/12 7} 20. Kh1 {-3.50/7 6} b5 {+2.98/12 5}
21. Rcd1 {-3.78/6 4} Nf2+ {+4.38/13 4} 22. Rxf2 {-3.95/7 4} Bxf2
{+4.43/13 5} 23. Rd2 {-5.05/6 2.4} Be3 {+5.18/13 4} 24. Re2 {-5.58/6 2.3}
Bxf4 {+5.19/13 5} 25. Rf2 {-5.89/6 2.4} Be5 {+5.27/13 7} 26. Rxf7
{-6.73/6 5} bxc4 {+6.87/15 5} 27. Rf3 {-6.73/7 3} cxb3 {+7.09/15 12} 28.
axb3 {-7.55/7 3} Rxf3 {+7.75/16 4} 29. gxf3 {-7.94/9 4} Rb8 {+7.48/16 5}
30. Kg2 {-8.17/9 5} Rxb3 {+8.15/15 3} 31. Kf2 {-8.18/9 8} Bxh2 {+8.43/16 6}
32. Kg2 {-8.38/8 4} Be5 {+9.10/16 4} 33. Kf2 {-8.57/8 4} Rb4 {+10.82/17 15}
34. b3 {-10.51/8 9} Rxb3 {+11.63/17 5} 35. f4 {-10.92/8 4} Bxf4
{+12.92/16 4} 36. Kg2 {-11.34/8 14} h4 {+19.32/17 5} 37. Nc3 {-17.42/8 2.7}
Rxc3 {+79.93/18 3} 38. Kg1 {-21.80/10 10} Rc2 {+79.95/12 3} 39. e5
{-21.79/10 2.1} h3 {+79.96/27 3}
{White resigns} 0-1
[/pgn]

Note: this is a version where I have added a few patches to help it along, like LMR (questionably sound at the moment) and making the TT move before any others. You can see my patches at https://github.com/ZirconiumX/sunfish (shameless plug).

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.

Post Reply