Is Piko Szachy the smallest P.C. program available?

Discussion of computer chess matches and engine tournaments.

Moderator: Ras

pichy
Posts: 2564
Joined: Thu Mar 09, 2006 3:04 am

Is Piko Szachy the smallest P.C. program available?

Post by pichy »

Is Piko Szachy the smallest and strongest P.C. program available at the moment :?:

http://www.kalisz.mm.pl/~pic/nanochess/
Zlaire

Re: Is Piko Szachy the smallest P.C. program available?

Post by Zlaire »

Depends on how you determine strength vs. size I guess. Elo per character is one way to do it and Micro-max should be ahead there (http://home.hccnet.nl/h.g.muller/max-src2.html).
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Is Piko Szachy the smallest P.C. program available?

Post by Michael Sherwin »

pichy wrote:Is Piko Szachy the smallest and strongest P.C. program available at the moment :?:

http://www.kalisz.mm.pl/~pic/nanochess/
This is a question that is virtually impossible to answear. An author could write what would be the smallest non compressed exe possible that does not have any dynamic run time memory allocation, but if the program was compiled with MSVC 6 it would still be 64KB on the hard drive.

So, lets say that we wanted to have a contest to see who could write the smallest non compressed exe that does not use dynamic run time memory allocation, we would first have to find out, which compilers can produce the smallest exe. Do we just allow 32 bit compilers or do we also allow 16 bit compilers? The later can produce very small exe's. And do we also allow assemblers of either or both bit sizes. Assemblers, most likely will produce the smallest exe's.

The Tokiwa 16 bit Basic compiler for DOS can produce an exe just a few hundred bytes in size, but that probably could not satisfy a winboard requirement.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
User avatar
hgm
Posts: 28356
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Is Piko Szachy the smallest P.C. program available?

Post by hgm »

Smallest and strongest is a meaningless concept: there is no order deined between two-dimensional quantities.

There are programs that are stronger than pikoSzachy, (e.g. Rybka), but they are all larger.

There are programs that are smaller than pikoSzachy, (e.g. micro-Max), but they are all weaker.

But the same statements would hold if you substitute micro-Max for pikoSzachy, and vice versa.

Furthermore, small can mean various things. Pyotr uses size of the executable as guidance, I that of the source code. I further do not minimize size per se, but size per ELO.

PikoSzachy is not open source, so there is no comparison there. Its executable is 9KB (but I do not know if this includes the symbol table, or if it is stripped; it is apparently made with a different compiler than I use). If I compile the stand-alone version of micro-Max 4.8 with 'gcc -Os' for minimum code size, and strip the executable (=remove the symbol table, which is only there for debugging purposes and not needed to run it), it is 7KB. But then it is not Winboard compatible.

So tou could say that pikoSzachy is the Winboard-compatible engine with the smallest executable.

I am still thinking of changing the I/O of the stand-alone uMax to make it Winboard compatible in a rudimentary sort of way (printing the move in stead of the board, and ignore all other winboard commands, just enough to make it play a single game under Winboard at a predefined time control). That would probably not drive up the size (source or executable) much, if at all. Micro-Max 1.6 is still much smaller as uMax 4.8, but also far weaker.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Is Piko Szachy the smallest P.C. program available?

Post by Tord Romstad »

PikoSzachy is indeed amazingly small, but its strength should not be underestimated! Here's a recent game from the Polish computer chess league:

Code: Select all

[Event "LPPS edycja 3 - grupa 2 - turniej testowy"]
[Site "Intel(R) XEON(TM) CPU 2.40 GHz , 1.0 GB RAM"]
[Date "2007.06.28"]
[Round "5.8"]
[Number "104"]
[White "Glaurung 2 Epsilon 5"]
[Black "pikoSzachy 2.2"]
[Result "0-1"]
[TimeControl "300"]
[Annotator "12. +0.33   9... -0.32"]
[ECO "C42"]
[Opening "Petrov: classical attack, Marshall variation"]

1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. d4 d5 6. Bd3 Bd6 7. O-O O-O
8. c4 c6 9. Nc3 Nxc3 {-0.32/8} 10. bxc3 dxc4 {-0.10/8} 11. Bxc4
Bf5 {-0.19/8} 12. Bd3 {+0.33/11} Qa5 {-0.06/9} 13. c4 {+0.47/12}
Bxd3 {-0.05/7} 14. Qxd3 {+0.58/13} Nd7 {-0.37/7} 15. c5 {+0.45/12}
Bc7 {-0.45/7} 16. Rb1 {+0.54/11} b6 {-0.23/7} 17. a3 {+1.09/11}
bxc5 {-0.35/7} 18. Bd2 {+0.70/11} Qa4 19. Rb7 {+0.13/10} Rfc8 {-0.47/7} 20.
Re1 {+0.11/11} Rab8 {-0.43/6} 21. Qf5 {+0.52/11} Rxb7 {-0.14/7} 22.
Ng5 {+0.41/12} Nf8 {-0.31/7} 23. Qxc8 {+0.00/12} Qxd4 24. Qxb7 {+0.00/12}
Qxd2 25. Nf3 {+0.21/13} Qd7 {-0.26/8} 26. g3 {+0.78/13} a5 {-0.14/8} 27.
Qa7 {+0.78/12} Qd6 {-0.20/8} 28. Ne5 {+0.74/12} Qd2 {-0.24/8} 29.
Kf1 {+0.37/13} Bxe5 {-0.69/8} 30. Rxe5 {+0.37/12} Qd3+ {-0.76/8} 31.
Kg1 {+0.27/13} c4 {-0.77/8} 32. Qxa5 {+1.17/12} c3 {-1.32/9} 33.
Rc5 {+1.47/12} Qb1+ {-1.07/8} 34. Kg2 {+1.01/13} Qe4+ {-1.06/8} 35.
Kh3 {+0.96/12} Qe6+ {-0.74/8} 36. g4 {+0.74/12} h5 {-0.97/8} 37.
Qa4 {+1.39/11} hxg4+ {-0.76/7} 38. Kg2 {+1.45/12} Nd7 {-0.37/8} 39.
Rxc6 {+0.98/12} Qd5+ {-1.29/7} 40. Kg1 {+0.00/12} Kh7 {-1.17/8} 41.
Rxc3 {+2.00/12} Ne5 42. Qc2+ {+1.84/11} g6 43. Qb3 {+1.84/11} Qe4 {-0.89/8}
44. Re3 {+1.78/11} Qf4 {-0.69/7} 45. Qb4 {+1.72/11} Nf3+ {-0.29/8} 46.
Kf1 {+1.25/12} Qf5 {-0.14/8} 47. Qb7 {+1.09/11} Qf6 {-0.21/7} 48.
Ke2 {+1.23/10} Nd4+ {-0.10/7} 49. Kd2 {+1.25/10} Qxf2+ {-0.18/7} 50.
Kd3 {+1.45/8} Nc2 {-0.26/7} 51. Re7 {+1.39/9} Ne1+ {-0.42/7} 52.
Rxe1 {+0.84/11} Qxe1 {-0.01/9} 53. Qxf7+ {+0.80/10} Kh6 {-0.01/9} 54.
Qf4+ {+0.64/10} Kh5 {+0.58/8} 55. Qg3 {+0.64/10} Qe6 {+0.58/8} 56.
Kd4 {+0.35/10} g5 {+0.59/8} 57. Qe5 {+0.33/10} Qf7 {+0.57/8} 58.
Qd6 {+0.37/10} Qf4+ {+0.67/8} 59. Qxf4 {-2.23/16} gxf4 {+1.73/15} 60.
Ke4 {-10.50/18} f3 {+5.41/14} 61. Ke3 {-11.21/19} Kh4 62. a4 {-11.07/15}
{White resigns} 0-1
Well done, Piotr! I look forward to meeting you face to face for the first time tomorrow. :D

Tord
Tony Thomas

Re: Is Piko Szachy the smallest P.C. program available?

Post by Tony Thomas »

Any program that can defeat Glaurung is a formidable opponent.
Piotr Cichy
Posts: 75
Joined: Sun Jul 30, 2006 11:13 pm
Location: Kalisz, Poland

Re: Is Piko Szachy the smallest P.C. program available?

Post by Piotr Cichy »

hgm wrote:Smallest and strongest is a meaningless concept: there is no order deined between two-dimensional quantities.

There are programs that are stronger than pikoSzachy, (e.g. Rybka), but they are all larger.

There are programs that are smaller than pikoSzachy, (e.g. micro-Max), but they are all weaker.

But the same statements would hold if you substitute micro-Max for pikoSzachy, and vice versa.

Furthermore, small can mean various things. Pyotr uses size of the executable as guidance, I that of the source code. I further do not minimize size per se, but size per ELO.

PikoSzachy is not open source, so there is no comparison there. Its executable is 9KB (but I do not know if this includes the symbol table, or if it is stripped; it is apparently made with a different compiler than I use). If I compile the stand-alone version of micro-Max 4.8 with 'gcc -Os' for minimum code size, and strip the executable (=remove the symbol table, which is only there for debugging purposes and not needed to run it), it is 7KB. But then it is not Winboard compatible.

So tou could say that pikoSzachy is the Winboard-compatible engine with the smallest executable.

I am still thinking of changing the I/O of the stand-alone uMax to make it Winboard compatible in a rudimentary sort of way (printing the move in stead of the board, and ignore all other winboard commands, just enough to make it play a single game under Winboard at a predefined time control). That would probably not drive up the size (source or executable) much, if at all. Micro-Max 1.6 is still much smaller as uMax 4.8, but also far weaker.
It is hard to say that pikoSzachy is the smallest PC program available and it is hard to compare it with microMax. The goal of microMax is good defined: to have the best ELO per byte. This is made on the level of source code, not the executable file. I focus on getting the smallest possible executable code, not the source, but I am not interested mainly in the size, but also in the strength of the program. However, I don't want to make the best ELO per byte of executable, but rather to get as strong program as possible with 10KB of size.

This is quite different way of making the program. I don't need to make any tricks in the source to make it small. I use many one letter names of variables, but have also longer names, because it makes the source more readable and has no influence on the exe size.

Piko is stronger than MicroMax, but it's source code is much bigger: the latest version (2.2) has the size 25809 bytes. The program is much more complicated than MicroMax, mainly in the evaluation part.
Piotr Cichy
Posts: 75
Joined: Sun Jul 30, 2006 11:13 pm
Location: Kalisz, Poland

Re: Is Piko Szachy the smallest P.C. program available?

Post by Piotr Cichy »

Tord Romstad wrote:PikoSzachy is indeed amazingly small, but its strength should not be underestimated! Here's a recent game from the Polish computer chess league:
This is only a single game, in which piko had just a bit luck :D
Of course it is nice to see the win with Glaurung, but that game was played at blitz time control. At longer TC it is not so easy to win.

I noticed also, that both nano and piko are relatively better in blitz, probably because they have very simple evaluation, which becomes more important at longer games.
User avatar
Graham Banks
Posts: 44239
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Is Piko Szachy the smallest P.C. program available?

Post by Graham Banks »

Hello Piotr.

Am I right in thinking that NanoSzachy is stronger than PikoSzachy?

I also wonder if the members here are aware that you've just released NanoSzachy 2.9. :D

Keep up your efforts. They are appreciated.

Regards, Graham.
Piotr Cichy
Posts: 75
Joined: Sun Jul 30, 2006 11:13 pm
Location: Kalisz, Poland

Re: Is Piko Szachy the smallest P.C. program available?

Post by Piotr Cichy »

Graham Banks wrote:Hello Piotr.

Am I right in thinking that NanoSzachy is stronger than PikoSzachy?

I also wonder if the members here are aware that you've just released NanoSzachy 2.9. :D

Keep up your efforts. They are appreciated.

Regards, Graham.
Yes, you are right.

Look for example here: http://loirechecs.chez-alice.fr/chesswa ... stable.htm