SUNFISH - a new chess engine written in Python !

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

Moderators: hgm, Rebel, chrisw

Stormb
Posts: 4
Joined: Sun Apr 20, 2014 3:24 pm

Re: Increasing the performances !

Post by Stormb »

Hi,

I was running this against LuaJester the other day and the following position came about. Not sure if this formatting shows up but the key is that black king is on g8 and a white pawn on h6 (you can figure the rest from below).

Anyway, LuaJester does g3g4 and Sunfish responds with g8g7 putting king in check. Looks like it needs a small rule to avoid king going into check for completeness, although it's probably a minor thing under the circumstances.

. . . . . . k .
. . . . . . . .
R . . . . . . P
. . . . . . . .
. . . . . K . .
. . . . . . P .
. . . . . . . .
. . . . . . . .


Your move: g3g4


My move: g8g7


. . . . . . . .
. . . . . . k .
R . . . . . . P
. . . . . . . .
. . . . . K P .
. . . . . . . .
. . . . . . . .
. . . . . . . .


Your move:
Stormb
Posts: 4
Joined: Sun Apr 20, 2014 3:24 pm

Re: Increasing the performances !

Post by Stormb »

Just noticed ZirconiumX's amended version which doesn't get caught with this position!

Looks like the number of nodes it can check has been doubled to 20,000 in the code I wonder what the new elo would be?

When I ran it against LuaJester (with the earlier version of sunfish (10,000 nodes) that limits itself to 6 ply I think, it was taking about ten seconds per move so I think it had the advantage.
User avatar
Sylwy
Posts: 4468
Joined: Fri Apr 21, 2006 4:19 pm
Location: IASI - the historical capital of MOLDOVA
Full name: SilvianR

Re: Better !

Post by Sylwy »

Stormb wrote:Just noticed ZirconiumX's amended version which doesn't get caught with this position!

Looks like the number of nodes it can check has been doubled to 20,000 in the code I wonder what the new elo would be?

When I ran it against LuaJester (with the earlier version of sunfish (10,000 nodes) that limits itself to 6 ply I think, it was taking about ten seconds per move so I think it had the advantage.
:lol:

https://github.com/ZirconiumX/sunfish

SilvianR :wink:
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: Increasing the performances !

Post by ZirconiumX »

Other way round, actually. Thomas Ahle halved the number of nodes Sunfish could search in a version after the one I forked.

I have better move ordering in this, but I think what really helps here is the fact that Sunfish actually knows what check is (previously, it avoided check by letting the king get captured, which created a score it ignored), though whether that actually means anything I do not know.

I am actually still working on this, but since my current attempts at Cython are failing, I might give up and go back to Python.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
Stormb
Posts: 4
Joined: Sun Apr 20, 2014 3:24 pm

Re: Increasing the performances !

Post by Stormb »

Oh I see, thanks for the clarification. It's amazing to me what you've achieved in such a small amount of code - fascinating.

I look forward to seeing where you take it.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: Increasing the performances !

Post by ZirconiumX »

Stormb wrote:Oh I see, thanks for the clarification. It's amazing to me what you've achieved in such a small amount of code - fascinating.

I look forward to seeing where you take it.
I doubt very far. I'd be lucky to score 2000 Elo points.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
User avatar
Sylwy
Posts: 4468
Joined: Fri Apr 21, 2006 4:19 pm
Location: IASI - the historical capital of MOLDOVA
Full name: SilvianR

Re: Sunfish X logo

Post by Sylwy »

ZirconiumX wrote:
Stormb wrote:Oh I see, thanks for the clarification. It's amazing to me what you've achieved in such a small amount of code - fascinating.

I look forward to seeing where you take it.
I doubt very far. I'd be lucky to score 2000 Elo points.

Matthew:out
Being very fast I have already the new "old" archive ! :lol:

Here's my logo for this masterpiece in Python :

Image

SilvianR :wink:
rreagan
Posts: 102
Joined: Sun Sep 09, 2007 6:32 am

Re: Increasing the performances !

Post by rreagan »

ZirconiumX wrote: I am actually still working on this, but since my current attempts at Cython are failing, I might give up and go back to Python.
What are you trying and how is it failing? I have always been interested in Cython, but it seemed like I always ended up writing C-looking code in Python, so I didn't see the point.
Roger Brown
Posts: 782
Joined: Wed Mar 08, 2006 9:22 pm

Re: Increasing the performances !

Post by Roger Brown »

ZirconiumX wrote:
I doubt very far. I'd be lucky to score 2000 Elo points.

Matthew:out

Hello Matthew,

Amazing how you make achieving that feat sound like something you are apologizing for!

Later.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: Increasing the performances !

Post by ZirconiumX »

So many posts to reply to!

Roger Brown: A doubling of speed on a program that is not optimised for speed is easy. It isn't much of a feat.

Russell Reagan: Just general optimisation. I have yet to find the magic code that doubles the speed. The main issue I'm having is how difficult it is to set up to compile.

Ruxy Sylwyka: Thanks for the logo! I actually privately named it "Moonfish".

The current incarnation of the code is attempting to be a multiprocess Monte Carlo search, but to no avail. I think I'll go back to my old code and restart my development efforts on the search I already have. I'd appreciate some CPU time if anyone is feeling willing.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.