Turochamp on Picochess!?

381 views
Skip to first unread message

Dirk

unread,
Jun 19, 2018, 3:36:36 PM6/19/18
to PicoChess
Sorry for double post - I have just deleted first one.


Hello everyone: because of Al’s great work on searching & testing engines for PicoChess especially lczero my DGT PI is getting more and more interesting for training and playing for me.

One engine I would love to see on my DGT PI is one of the first ever written chess algorithms maybe some of you would also welcome this incredible engine:

„Turochamp, a chess program by Alan Turing and David Champernowne developed in 1948 as chess playing algorithm, implemented as "paper machine" as there were no real machines who could execute this algorithm.“. More info, see eg. https://chessprogramming.wikispaces.com/Turochamp

With kind help of Martin, the author of a Turochamp implementation for python chess, I was able to add his engine PyTuroChamp under Windows to the chess GUI ARENA and play.
Martins project on Github: https://github.com/mdoege/PyTuroChamp

But it would be great to have it also in PicoChess but for thisI need some help because I don’t know how to add an engine which is not a binary but just a python script.

My understanding is that PicoChess is also based on python chess (same with PyTuruChamp) so it should be possible somehow.

Martin suggested to write some ki d of wrapper binary if it is not possible to include it as a script directly.

Does anybody have an idea how to add this engine to PicoChess?

Thanks and thanks for all people contributing to this great project!

Regards
Dirk



Dirk

unread,
Jun 20, 2018, 10:00:17 AM6/20/18
to PicoChess
In the meantime I have tried the following to include the Turochamp engine:

1. Cloned Github directory Pyturochamp to PicoChess home directory

2. Create Shell Script "turochamp" like

"cd /home/pi/PyTuroChamp
python3 ptc_xboard.py"

ptc_xboard.py is the UCI version of the Turochamp python implementation

3. Made shell script file "turochamp" executable

4. Copied turochamp to picochess/engines/armv7l

5. Added Turochamp to engines.ini:

[turochamp]
name = turochamp
small = turing
medium = turing
large = turing
elo = 500

6. After choosing "turing" in PicoChess engines menu I get the message „engine error“


So unfortunately it is not so easy like I thought: just calling an executable chill script which would call python3 and the python uci-file for Turochamp.

Probably the engine file has to be a native executable in picochess?

What a pity....

Dirk

Shivkumar Shivaji

unread,
Jun 20, 2018, 12:57:09 PM6/20/18
to pico...@googlegroups.com
Can u try testing that shell script, ie turochamp.sh? Also, given full path for python3 interpreter:

"cd /home/pi/PyTuroChamp; /usr/bin/python3 ptc_xboard.py"

Ideally you can just do "/usr/bin/python3 /home/pi/PyTuroChamp/ptc_xboard.py" in the shell script. Make sure the shell script is executable (chmod a+x turochamp.sh) and ensure it works standalone before picochess mode.




Dirk

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dirk

unread,
Jun 20, 2018, 2:16:48 PM6/20/18
to PicoChess
Thanks Shiv for chiming in - I appreciate any help because I have no experience with python nor linux (you see I fulfill all requirements :-)

I have changed the shell script turochamp to the one liner as you have proposed.

Now something has changed in PicoChess: When I choose the turing engine I no longer get the error message. it just seems to be in an endless loop: no change on display and I can't no buttons are recognized (had to reboot).

I checked the python commands directly:

Calling the main algorithm
Execute:
Python3 pyturochamp.py. (this is called inside UCI wrapper ptc_xboard.py)

I get the following output which I also get on my windows PC where I have the working version for ARENA chess guide and did one move:

pi@DGTPi:~/PyTuroChamp $ python3 pyturochamp.py
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
R N B Q K B N R
0.0
Your move? e2e4
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . P . . .
. . . . . . . .
P P P P . P P P
R N B Q K B N R
0.0
FEN: rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
(1/20) g8h6 -2.2 0.00
(2/20) g8f6 -3.9 0.00
(3/20) b8c6 -3.6 0.00
(4/20) b8a6 -2.0 0.00
(5/20) h7h6 -2.4 0.00
(6/20) g7g6 -2.3 0.00



But the problem seems to be the UCI wrapper ptc_board.py.

When I call this I just get the following output:

pi@DGTPi:~/PyTuroChamp $ python3 ptc_xboard.py
# Could not create log file


Then then nothing happens.

Maybe the UCI wrapper although being a python script only works for windows or it is only a authorization problem in my directory!?

I will try to learn python a little bit to understand whats happening in ptc_board.py - maybe I get a hint.

Thanks so much for your hint, Shiv!

Regards
Dirk

Shivkumar Shivaji

unread,
Jun 20, 2018, 2:39:16 PM6/20/18
to pico...@googlegroups.com
The script does not seem to be UCI, I think its xboard protocol. Picochess only supports UCI not xboard..

Shiv

Dirk



Dirk

unread,
Jun 20, 2018, 3:41:11 PM6/20/18
to PicoChess
Hmm - ok then it wouldn't work.

But then the description:

# XBoard/UCI interface to PyTuroChamp

and the variable

is_uci

are somehow misleading.

Anyway - I give up, it was a nice try.
Thanks for helping, Shiv!

Regards
Dirk

Michael Byrne

unread,
Jun 20, 2018, 4:04:51 PM6/20/18
to pico...@googlegroups.com
If somebody was to take this source and fold in UCI , it would be pretty close to Al Turing’s paper engine .


Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Shivkumar Shivaji

unread,
Jun 20, 2018, 4:09:13 PM6/20/18
to pico...@googlegroups.com
FYI,

To check that an engine is uci compatible, you can run:

1. "uci" should return all options
2. "uci newgame"
3. "go"

These sort of commands should work. If instead, you see a chessboard representation, then its xboard protocol and NOT UCI. I think UCI support needs to be added in.

Shiv


Regards
Dirk

Michael Byrne

unread,
Jun 20, 2018, 4:12:55 PM6/20/18
to pico...@googlegroups.com
There is also a winboard to uci adapter , but I’m not sure if the code is available ( to compile for Linux/Pi ). 

Sent from my iPhone
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Al

unread,
Jun 20, 2018, 4:28:40 PM6/20/18
to PicoChess
It isn’t I looked earlier but got side tracked, sorry. You can run it where a crude chess board is visible and play it via e2e4 etc, but it doesn’t accept any UCI commands.

Al.

Dirk

unread,
Jun 20, 2018, 5:24:04 PM6/20/18
to PicoChess
Thats why there is the UCI ptc_xboard.py wrapper around pyturochamp.py.
pyturochamp has the internal board presentation etc. but with ptc_xboard.py I am able to give a 'go' or 'UCI' command.
That works when I call it directly in the shell with these options.
So I think it is really a combination of UCI and Winboard interface what is achieved by the ptc_xborad.py script.

So in principle I am sure it would work somehow but as I have written it seems to be in an endless loop or crashed when choosing this engine.

But anyway - I am no expert and stop trworking on this and just user Arena with windows version.

Thank you all for helping.

Dirk


Dirk

unread,
Jun 22, 2018, 4:30:55 AM6/22/18
to PicoChess
One more comment:

Found this issue thread on Github for PyTuroChamp regarding the issue calling a "shell script engine" (with the real engine running in python like pico chess itself).

"Interfacing an UCI Python chess engine to python-chess on Linux #261"

https://github.com/niklasf/python-chess/issues/261

Seems like the shell script communication does not support the UCI interface communication but I don not really understand the problem and what could be a fix.

Dirk

Dirk

unread,
Jun 23, 2018, 5:50:00 AM6/23/18
to PicoChess
Looks like pico chess itself is not accepting shell scripts as engines to be ca lled (see last line in log file below "OSError: [Errno 8] Exec format error").

If someone could give me a hint what I would have to change to make this possible I would try it because I think it make sense to be able to call engines written in python (by this one can easily add simple engines and try out some things) not only to be able to call the "historic" Turochamp engine implemented as PyTuroChamp engine.

Thanks
Dirk


This is the log I get, when I try to call the turing engine (wrapped in executable batch file like described in previous posts):

2018-06-23 09:42:56.014 ERROR engine - __init__: OS error in starting engine
Traceback (most recent call last):
File "/opt/picochess/uci/engine.py", line 67, in __init__
self.engine = chess.uci.popen_engine(file, stderr=DEVNULL)
File "/usr/local/lib/python3.5/dist-packages/chess/uci.py", line 1134, in popen_engine
return _popen_engine(command, engine_cls, setpgrp, _popen_lock, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/chess/engine.py", line 315, in _popen_engine
PopenProcess(engine, command, **popen_args)
File "/usr/local/lib/python3.5/dist-packages/chess/engine.py", line 145, in __init__
self.process = subprocess.Popen(command, **popen_args)
File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error
2018-06-23 09:42:56.067 ERROR picochess - main: new engine failed to start, reverting to engines/armv7l/ct800

Dirk

unread,
Jun 24, 2018, 5:31:57 AM6/24/18
to PicoChess
Hello everyone good news (and some bad):


I am finally able to call the (python) PyTuroChamp engine from Picochess and could play the first moves again the world famous "paper engine" by Alan Turing (think of that: it took Turing multiple hours to calculate and execute the next move with his algorithm on paper ;-) although the python implementation of TuroChamp is also not the fastest one...

The solution is quite easy (after lots of try & errors):
Instead of using a shell script (I even tried to transfer the shell script to C and then compile this generated C code to get an executable engine for picochess!) we can directly use the python uci wrapper file after renaming and adding a soft link to this file in the picochess engines directory (here armv7l).

Then the python file can be used like a native executable chess engine for picochess (and not only the TuroChamp engine but python engines in general).

So far so good.

But...

Unfortunately I can only play two moves (starting as white - with black even only one move) before the engine stops working.
The clock suddenly stops without any information and I have to reboot.

Maybe someone can give me a hint what the real cause can be I only have a guess because I can't really read & understand the picochess log file.

My guess is that some UCI commands are just not fully implemented in the ici wrapper file ptc_xboard.py.

It must have something to do with the communication transfer of the human reply move after the initial one (first one when playing white is fine).

I assume there must be a difference how the first move is giving to the engine and all the follow up moves because with the first follow up move the engine stops working.


When playing interactively with the engine I can play a game without any problem by entering the moves one by one:


pi@DGTPi:~ $ /home/pi/PyTuroChamp/ptc_xboard.py
uci
uciok
ucinewgame
e2e4
# -5.40 ['e7e6']
bestmove e7e6
d2d4
# -2.80 ['h7h5']
bestmove h7h5
g1f3
# -2.80 ['a7a5']
bestmove a7a5

ucinewgame
go
# 23.80 ['e2e3']
bestmove e2e3
e7e5
# 2.80 ['h2h4']
bestmove h2h4
quit
pi@DGTPi:~ $


But within picochess I can play only one move, get the response move and when trying to play second move the engine stops after a while.

The picochess error in the log says something like
ValueError("illegal uci: {0} in {1}".format(repr(uci), self.fen()))
ValueError: illegal uci: 'd2d4' in rnbqkbnr/pppp1ppp/4p3/8/3PP3/8/PPP2PPP/RNBQKBNR b KQkq - 0 2


After playing e2e4 and getting the answer e7e6 and playing the next move d2d4 the log looks fine to me:

2018-06-23 15:45:33.404 DEBUG board - _read_board_message: (ser) board get [DgtMsg.DGT_MSG_BOARD_DUMP] length: 64
2018-06-23 15:45:33.451 DEBUG board - _process_board_message:
rnbqkbnr
pppp.ppp
....p...
........
...PP...
........
PPP..PPP
RNBQKBNR
2018-06-23 15:45:33.453 DEBUG board - _process_board_message: raw fen [rnbqkbnr/pppp1ppp/4p3/8/3PP3/8/PPP2PPP/RNBQKBNR]
2018-06-23 15:45:33.456 DEBUG display - run: received message from msg_queue: MSG_DGT_FEN
2018-06-23 15:45:33.464 DEBUG display - _process_fen: DGT-Fen [rnbqkbnr/pppp1ppp/4p3/8/3PP3/8/PPP2PPP/RNBQKBNR]
2018-06-23 15:45:33.469 DEBUG picochess - main: received event from evt_queue: EVT_FEN

But after a while the picochess stops (I assume when engine comes back with the answer move).


Maybe someone has an idea what could be the cause for that and why the first move could be played without any problems and from second on the problem occurs (although interactively I could play without any problem).

Thanks for helping
Dirk


Al

unread,
Jun 24, 2018, 10:20:57 AM6/24/18
to PicoChess
Hi Dirk,

Yes it runs natively:

Al@PicoChess:~/pyTuroChamp $ sudo ./ptc_xboard.py newt
uci
uciok
e2e4
# B00a King's Pawn (e4)
bestmove d7d6
d2d4
# B07d Pirc: 2.d4 (e4 d6 d4)
bestmove b8d7
go infinite
# B07d Pirc: 2.d4 Nd7 (e4 d6 d4 Nd7)
# 1 0.08 ['g1f3']
# 2 0.03 ['g1f3', 'e7e5']
# 3 0.07 ['g1f3', 'e7e5', 'b1c3']
# 4 0.03 ['g1f3', 'g8f6', 'b1c3', 'e7e5']
bestmove g1f3
stop
quit
Al@PicoChess:~/pyTuroChamp $

But I’m intrigued how you linked it into armv7l, I tried the dirty way by copying files across to no avail.

I looked up ‘python uci wrapper’ and found this issue raised earlier this year: https://github.com/niklasf/python-chess/issues/261.

What exactly have you got in armv7l that links it to the PyTuroChamp folder, then maybe I can reproduce this error and help?


Cheers,

Al.

Dirk

unread,
Jun 24, 2018, 11:10:39 AM6/24/18
to PicoChess
Hi All,

oh that would be cool if you also have a look at this because I think it would be really nice to have this historic engine.

To have a copy in the engines armv7l folder was the important trick I found out:
Just go to this directory and create a symbolic link to the original file which stays in its original home position.
Just rename it so it has no longer the ".py" ending (here I renamed it to "turing").

pi@DGTPi:/opt/picochess/engines/armv7l $ sudo ln -s /home/pi/PyTuroChamp/ptc_xboard.py turing
pi@DGTPi:/opt/picochess/engines/armv7l $ ls -all
total 51968
drwxr-xr-x 2 root root 4096 Jun 24 14:45 .
drwxr-xr-x 7 pi root 4096 Jun 24 08:26 ..
-rwxr-xr-x 1 root root 1154200 Jun 16 22:54 andscacs0921
-rwxr-xr-x 1 root root 280700 Jun 16 22:54 a-stockf
-rwxr-xr-x 1 root root 129684 Jun 16 22:54 togaII401

lrwxrwxrwx 1 root root 34 Jun 24 14:45 turing -> /home/pi/PyTuroChamp/ptc_xboard.py


After this we can add the python engine to our picochess engines.ini file like usual:

[turing]
name = turing
small = turing
medium = turing
large = turing
elo = 500

Be aware that the engines takes really long to answer (so adjust your time settings) - I have adjusted it to the original Turing machine like Martin described it on his GitHub page by modifying pyturochamp.py so that only two plyes are considered and no helping tables.



My assumption is that the first move is communicated by picochess based on initial start position (eg. uic command "position startup moves e2e4" and the follow up moves explicitly based on current position and new move with ici command "position fen rnbqkbnr/pppp1ppp/4p3/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq e3 0 1 moves a2a4" .

Do you know if that is correct?

For me it makes sense because in ptc_xboard I only find the uci command "position startup moves" and not "position fen moves".

But maybe one of the original developers can also give some hint on that.


Thanks for checking, Al!

Regards
Dirk

Dirk

unread,
Jun 24, 2018, 11:53:21 AM6/24/18
to PicoChess
Great news:

It seems I was right with my assumption (although I have no python or "inner" picochess knowledge - maybe I should join the circle of picochess developer ;-)

I have asked Martin (author of PyTuroChamp) to include the UCI command "position fen moves" - he just updated the code of ptc_xboard.py.

I have downloaded it again and tried it:

Now it works like expected.

I am so happy know to have this engine - although it is really slow (but not as the original paper engine ;-)

If you want the original Turing machine (also the same algorithm Kasparov played, see here: Alan Turing's 60-year-old chess program takes on Garry Kasparov
https://www.theverge.com/2012/6/26/3119022/alan-turing-60-year-old-chess-program-garry-kasparov) and get a faster Turochamp engine you should modify the pyturochamp.py file change at the beginning of the file:
MAXPLIES = 2 # maximum search depth
QPLIES = MAXPLIES + 4
PSTAB = 0 # influence of piece-square table on moves, 0 = none

Cheers
Dirk


Dirk

unread,
Jun 24, 2018, 2:58:35 PM6/24/18
to PicoChess
I have added the two options "maxplies" and "pstab" to the ici interface in pyturochamp.py so that Picochess can set these options via the standard ici setting menu like:

sudo nano "turing.uci"

[TuroChamp]
maxplies = 2
pstab = 0

[normal]
maxplies = 3
pstab = 5

Maybe this will be added to Github later...

Michael Byrne

unread,
Jun 24, 2018, 3:49:23 PM6/24/18
to pico...@googlegroups.com
Good stuff.  Poor Alan Turing, a brilliant mathematical mind, later underwent chemical castration to avoid prison time, assumed to have committed suicide two years later from cyanide poisoning.
I'm sure he would be pleased that his paper chess engine is alive and well.

From wiki:

Alan Mathison Turing OBE FRS (/ˈtjʊərɪŋ/; 23 June 1912 – 7 June 1954) was an English computer scientist, mathematician, logiciancryptanalyst, philosopher, and theoretical biologist.[2] Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general purpose computer.[7][8][9] Turing is widely considered to be the father of theoretical computer science and artificial intelligence.[10]

During the Second World War, Turing worked for the Government Code and Cypher School (GC&CS) at Bletchley Park, Britain's codebreaking centre that produced Ultra intelligence. For a time he led Hut 8, the section which was responsible for German naval cryptanalysis. Here he devised a number of techniques for speeding the breaking of German ciphers, including improvements to the pre-war Polish bombe method, an electromechanicalmachine that could find settings for the Enigma machine. Turing played a pivotal role in cracking intercepted coded messages that enabled the Allies to defeat the Nazis in many crucial engagements, including the Battle of the Atlantic, and in so doing helped win the war.[11][12] Counterfactual history is difficult with respect to the effect Ultra intelligence had on the length of the war,[13] but at the upper end it has been estimated that this work shortened the war in Europe by more than two years and saved over fourteen million lives.[11]

After the war, Turing worked at the National Physical Laboratory, where he designed the ACE, among the first designs for a stored-program computer. In 1948 Turing joined Max Newman's Computing Machine Laboratory at the Victoria University of Manchester, where he helped develop the Manchester computers[14] and became interested in mathematical biology. He wrote a paper on the chemical basis of morphogenesis,[3] and predicted oscillating chemical reactions such as the Belousov–Zhabotinsky reaction, first observed in the 1960s.

Turing was prosecuted in 1952 for homosexual acts, when by the Labouchere Amendment, "gross indecency" was a criminal offence in the UK. He accepted chemical castration treatment, with DES, as an alternative to prison. Turing died in 1954, 16 days before his 42nd birthday, from cyanide poisoning. An inquest determined his death as suicide, but it has been noted that the known evidence is also consistent with accidental poisoning.[15] In 2009, following an Internet campaign, British Prime Minister Gordon Brown made an official public apology on behalf of the British government for "the appalling way he was treated." Queen Elizabeth II granted him a posthumous pardon in 2013.[16][17][18] The Alan Turing law is now an informal term for a 2017 law in the United Kingdom that retroactively pardoned men cautioned or convicted under historical legislation that outlawed homosexual acts.[19]


Dirk


Al

unread,
Jun 24, 2018, 3:53:52 PM6/24/18
to PicoChess
Hi Dirk,

Nice but I can’t get it to work, do I actually need a file in /opt/picochess/engines/armv7l?

I just have the link, with updated engines.ini (no uci yet, but not needed)

drwxr-xr-x 2 root root 4096 Jun 24 20:31 .
drwxr-xr-x 20 root root 4096 Jun 23 16:57 ..
-rwxr-xr-x 1 root root 389468 Jun 17 21:45 a-stockf
-rw-r--r-- 1 root root 599 Jun 17 21:45 a-stockf.uci
-rw-r--r-- 1 root root 1573 Jun 24 20:22 engines.ini
-rwxr-xr-x 1 root root 432508 Jun 23 15:52 lc0
-rwxr-xr-x 1 root root 420480 Jun 20 14:28 lczero
-rw-r--r-- 1 root root 160 Jun 23 16:22 lczero.uci
lrwxrwxrwx 1 root root 34 Jun 24 20:31 turing -> /home/pi/PyTuroChamp/ptc_xboard.py


I updated the files from GitHub in PyTuroChamp:

Al@PicoChess:~/pyTuroChamp $ ls
bare newt ptc __pycache__ Screenshot_20171123_102423.png
bare.py Newt-log.txt ptc-bare-stockfish.pgn PyTuroChamp-log.txt xboard-host.py
chess-eco.pos.txt Newt.pgn ptc.bat PyTuroChamp.pgn
icons newt.py ptc-host.py pyturochamp.py
movetest.py pst.py ptc_xboard.py README.md

But PicoChess crashes?

It’s been a long day, am looking into gcc 8.1 and clang 6, compiling, helping others

Now brain dead and missing something obvious?

Al.

Dirk

unread,
Jun 24, 2018, 4:10:54 PM6/24/18
to PicoChess
Hi Al,

oh that's strange because that's exactly what I did.

Hmmm - I have always tested the engines directly with either calling
/opt/picochess/engines/armv7l/turing
and
/home/pi/PyTuroChamp/ptc_xboard.py

When both work fine, picochess should also be able too call it (turing)!?

Maybe I just changed write authorization for armv7l and PyTuroChamp - but that was just for the PyTuroChamp logs and shouldn't cause a crash.

Hmmm....


Al

unread,
Jun 24, 2018, 4:55:58 PM6/24/18
to PicoChess
Hi Dirk,

It works fine, it’s my fault. I had lc0 with no weights file in my engines.ini which caused the crash.

As I said earlier I’m doing too many things at once. I’ve not had time to do Engines nor run a backup, and I’ve got a headache, lol.

Your ini file doesn’t work tho, if I have time, I’ll try something tomorrow.

Nice work!

Al.

Dirk

unread,
Jun 24, 2018, 5:22:50 PM6/24/18
to PicoChess
Cool, Al - no worries. Glad you sorted it out.

Yes for the uci ini File with the option to work you need to enhance the pytyrochamp.py file because the original file does not support any options.

I have changed the fiel and added the options to ptc_xboard.py:

after lines:
elif l == 'new':
newgame()

insert:

elif 'setoption name maxplies value' in l:
p.MAXPLIES = int(l.split()[4])
print("maxplies:", p.MAXPLIES)
elif 'setoption name pstab value' in l:
p.PSTAB = int(l.split()[4])
print("pstab:", p.PSTAB)


I really suggest to set maxplies = 2 and stab = 0 in order to have good respond times and the most accurate Turochamp engine.

my turing.uci now looks like

[easy]
maxplies = 1
pstab = 0

[TuroChamp]
maxplies = 2
pstab = 0

[hard]


maxplies = 3
pstab = 5


The option TuroChamp is the original algorithm (almost).


But you can just wait because with the really kind help of Martin from PyTurochamp these options will be added to the original code so that in near future you can just copy from Github again.

Thank you so much Martin (he is really a helpful guy like our picochess group)

Dirk

Dirk

unread,
Jun 24, 2018, 5:28:05 PM6/24/18
to PicoChess
Martin is so fast - he already has updated his coding on Github for the options (and has added even more):

You can just copy the repository again.

elif l == 'uci':
is_uci = True
print("id name PyTuroChamp")
print("id author Martin C. Doege")
print("option name maxplies type spin default 3 min 0 max 1024")
print("option name qplies type spin default 7 min 0 max 1024")
print("option name pstab type spin default 5 min 0 max 1024")

Thanks, Martin!

Michael Byrne

unread,
Jun 24, 2018, 6:00:20 PM6/24/18
to pico...@googlegroups.com
Maxplies should never be 1024. 128 is reasonable. Not sure what pstab is.
qplies should be higher than maxplies I believe , but not sure what a good number would be.

Sent from my iPhone

Dirk

unread,
Jun 25, 2018, 1:35:29 AM6/25/18
to PicoChess
Hi Michael,

these were just lines from original coding: they define the technical possible values for these parameters.

If you don't set them explicitly via the new uci parameters the default values are
MAXPLIES 3
QPLIES = MAXPLIES + 4 = 7 (to avoid horizon effect -> unbelievable that turing already thought about this in his paper engine)
PSTAB = 5 (influences use of additional piece square tables)

From Martin's Github page:
"PyTuroChamp is closest to the chess engine in Turing's paper, but adds piece-square tables that can be tuned with the PSTAB parameter. A higher parameter means more aggressive forward movement. With PSTAB = 0, e3 is favored like Turing's algorithm would."

*************************
Keep in mind that these parameters should not be set like in a modern chess engine because of the Turing heuristic itself and how it is implemented in the python language.
MAXPLIES over 4 will last very long for one single move, original Turing paper engine was executed with MAXPLIES 2 (according to some sources).

As QPLIES is now also supported I will integrate it into my turing.uci setting file (eg lower QPLIES for "easy" mode etc.)

Dirk

Al

unread,
Jun 25, 2018, 4:05:50 AM6/25/18
to PicoChess
Hi Dirk,

A new day and a fresh mind!

Do me a favour and type top on a terminal logged onto PicoChess then tell me what Engine name you see when ‘turing’ is thinking.

Let’s just say I had my suspicions when I was getting beat up again.


Al.

Dirk

unread,
Jun 25, 2018, 5:05:59 AM6/25/18
to PicoChess
Good Morning Al,

oh the "top" command is new to me - nice to know ;-)

When choosing turing as I engine, I see already one python3 process.

During "think"time of the engine I see a second python3 process.

So you think that is strange!?

Dirk

Al

unread,
Jun 25, 2018, 5:17:39 AM6/25/18
to PicoChess
Hi, thanks Dirk.

I use the top command especially to check if I’m using 1, 2, 3, or 4 cores as it shows 100%, 200% etc.

Ok, my dilemma. My says a-stock, last night it showed lc0.

So this morning, I deleted all entries from engines.ini except turing. I started PicoChess, he engine showed turin, the levels still fail saying ‘Eng Err’ yesterday top shows I’m playing Stockfish, no wonder I get crushed.

I pulled the latest change, I assum I no longer need your extra code lines?

So I’m not really playing Turin, and am baffled....

My folders:

Al@PicoChess:/opt/picochess/engines/armv7l $ ls -al
total 23072
drwxr-xr-x 2 root root 4096 Jun 24 23:04 .
drwxr-xr-x 20 root root 4096 Jun 23 16:57 ..
-rwxr-xr-x 1 root root 389468 Jun 17 21:45 a-stockf
-rw-r--r-- 1 root root 599 Jun 17 21:45 a-stockf.uci
-rw-r--r-- 1 root root 81 Jun 24 23:04 engines.ini
-rw-r--r-- 1 root root 1492 Jun 24 21:26 engines.ini.al
-rw-r--r-- 1 root root 1573 Jun 24 22:59 engines.ini.plusturing
-rwxr-xr-x 1 root root 432508 Jun 23 15:52 lc0
-rwxr-xr-x 1 root root 420480 Jun 20 14:28 lczero
-rw-r--r-- 1 root root 160 Jun 23 16:22 lczero.uci
lrwxrwxrwx 1 root root 34 Jun 24 21:39 turing -> /home/pi/PyTuroChamp/ptc_xboard.py
-rw-r--r-- 1 root root 204 Jun 24 22:53 turing.uci
-rw-r--r-- 1 root root 22343350 Jun 24 22:07 weights.txt
Al@PicoChess:/opt/picochess/engines/armv7l $

Al@PicoChess:~/pyTuroChamp $ ls -al
total 1144
drwxr-xr-x 5 root root 4096 Jun 24 22:49 .
drwxr-xr-x 84 Al Al 4096 Jun 25 09:45 ..
-rwxr-xr-x 1 root root 78 Jun 24 14:17 bare
-rwxr-xr-x 1 root root 4204 Jun 24 14:17 bare.py
-rw-r--r-- 1 root root 978087 Jun 24 14:17 chess-eco.pos.txt
drwxr-xr-x 8 root root 4096 Jun 24 22:49 .git
drwxr-xr-x 2 root root 4096 Jun 24 14:17 icons
-rwxr-xr-x 1 root root 898 Jun 24 14:17 movetest.py
-rwxr-xr-x 1 root root 78 Jun 24 14:17 newt
-rw-r--r-- 1 root root 66 Jun 24 15:04 Newt-log.txt
-rw-r--r-- 1 root root 129 Jun 24 15:04 Newt.pgn
-rwxr-xr-x 1 root root 6628 Jun 24 14:17 newt.py
-rwxr-xr-x 1 root root 3182 Jun 24 14:17 pst.py
-rwxr-xr-x 1 root root 74 Jun 24 14:17 ptc
-rw-r--r-- 1 root root 891 Jun 24 14:17 ptc-bare-stockfish.pgn
-rw-r--r-- 1 root root 131 Jun 24 14:17 ptc.bat
-rwxr-xr-x 1 root root 711 Jun 24 14:17 ptc-host.py
-rwxr-xr-x 1 root root 3475 Jun 24 22:49 ptc_xboard.py
drwxr-xr-x 2 root root 4096 Jun 24 14:59 __pycache__
-rw-r--r-- 1 root root 20 Jun 24 14:54 PyTuroChamp-log.txt
-rw-r--r-- 1 root root 116 Jun 24 14:54 PyTuroChamp.pgn
-rwxr-xr-x 1 root root 7410 Jun 24 14:17 pyturochamp.py
-rw-r--r-- 1 root root 6255 Jun 24 14:17 README.md
-rw-r--r-- 1 root root 79027 Jun 24 14:17 Screenshot_20171123_102423.png
-rwxr-xr-x 1 root root 1955 Jun 24 14:17 xboard-host.py
Al@PicoChess:~/pyTuroChamp $


Cheers,

Al.


Dirk

unread,
Jun 25, 2018, 5:25:58 AM6/25/18
to PicoChess
correct:
when you copied the new files from the Github repository there is no more need for my previous code changed in ptc_xborad.py.

My turing.uci Looks now like this and it works:

[easy]
maxplies = 1
qplies = 4
pstab = 0

[TuroChamp]
maxplies = 2
qplies = 6
pstab = 0

[strong]
maxplies = 3
qplies = 7
pstab = 5

Al

unread,
Jun 25, 2018, 5:37:21 AM6/25/18
to PicoChess
Dirk,

Yeah, I tried similar.

The point is, mine is not picking up the right engine?

Can you check my folders against yours and post your armv7l and PyTuruChamp folders here?


Thanks,

Al.

Dirk

unread,
Jun 25, 2018, 5:41:20 AM6/25/18
to PicoChess
You wouldn't really get crushed when you are playing against TuroChamp ;-) although when you set MAXPLIES to higher values it gets a good strength (at least for me :-)

Hmm - unfortunately can't help why the engine processes gets mixed up on your system - really strange.

thats my running processes during wait time of turing (I think this is the picochess python process)

Unknown command - try 'h' for help
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
879 pi 20 0 8216 3280 2732 R 100.0 0.3 0:14.98 top
333 root 20 0 229776 37204 9472 S 25.0 3.9 1:26.37 python3
1 root 20 0 26992 6008 4892 S 0.0 0.6 0:01.83 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.04 ksoftirqd/0
4 root 20 0 0 0 0 S 0.0 0.0 0:00.24 kworker/0:0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
6 root 20 0 0 0 0 S 0.0 0.0 0:00.41 kworker/u8:0
7 root 20 0 0 0 0 S 0.0 0.0 0:00.30 rcu_sched
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0

and when Turing is thinking I get the python process of TuroChamp:

tasks: 126 total, 2 running, 123 sleeping, 0 stopped, 1 zombie
%Cpu(s): 25.3 us, 0.3 sy, 0.0 ni, 74.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 949572 total, 784320 free, 62420 used, 102832 buff/cache
KiB Swap: 102396 total, 102396 free, 0 used. 831628 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
683 root 20 0 13516 9680 5172 R 99.0 1.0 1:14.60 python3
333 root 20 0 229776 37208 9472 S 4.0 3.9 2:23.12 python3
3216 pi 20 0 8208 3360 2820 R 0.7 0.4 0:00.08 top
1 root 20 0 26992 6008 4892 S 0.0 0.6 0:01.84 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20

Dirk

unread,
Jun 25, 2018, 5:47:23 AM6/25/18
to PicoChess
I just have added a new engine from PyTuroChamp directory: "alphabeta" which is calling the ptc_xboard.py bar
option:
"**Bare** removes the Turing heuristics and quiescence search and only contains the bare minimum a chess engine needs to play: alpha-beta search and a piece-square table."
Also fun to play.


pi@DGTPi:/opt/picochess/engines/armv7l $ ls -all

total 51976
drwxr-xr-x 2 root root 4096 Jun 25 09:38 .


drwxr-xr-x 7 pi root 4096 Jun 24 08:26 ..

lrwxrwxrwx 1 root root 32 Jun 25 08:05 alphabeta -> /home/pi/PyTuroChamp/ptc_bare.py
-rw-r--r-- 1 root root 100 Jun 25 08:36 alphabeta.uci


-rwxr-xr-x 1 root root 1154200 Jun 16 22:54 andscacs0921

-rwxr-xr-x 1 root root 280700 Jun 16 22:54 a-stockf
-rw-r--r-- 1 root root 716 Jun 16 22:54 a-stockf.uci
-rwxr-xr-x 1 root root 278752 Jun 16 22:54 brainfish230518
-rw-r--r-- 1 root root 599 Jun 16 22:54 brainfish230518.uci
-rwxr-xr-x 1 root root 925836 Jun 16 22:54 b-texel
-rw-r--r-- 1 root root 294 Jun 16 22:54 b-texel.uci
-rwxr-xr-x 1 root root 694624 Jun 16 22:54 c-arasan
-rw-r--r-- 1 root root 1093 Jun 16 22:54 c-arasan.uci
-rwxr-xr-x 1 root root 289220 Jun 16 22:54 cct800_V1.30_x32
-rwxr-xr-x 1 root root 1050604 Jun 16 22:54 cheese192
-rw-r--r-- 1 root root 1093 Jun 21 22:53 cheese192.uci
-rwxr-xr-x 1 root root 289056 Jun 16 22:54 corchessextended
-rw-r--r-- 1 root root 1692 Jun 16 22:54 corchessextended.uci
-rwxr-xr-x 1 root root 289220 Jun 21 22:25 ct800
-rw-r--r-- 1 root root 106 Jun 22 14:57 ct800.uci
-rwxr-xr-x 1 root root 210900 Jun 16 22:54 defenchess12
-rwxr-xr-x 1 root root 247516 Jun 16 22:54 delocto06
-rwxr-xr-x 1 root root 657172 Jun 16 22:54 d-rodent
-rwxr-xr-x 1 root root 174636 Jun 16 22:54 d-rodent2
-rw-r--r-- 1 root root 39580 Jun 16 22:54 d-rodent2.uci
-rwxr-xr-x 1 root root 661272 Jun 16 22:54 d-rodent3
-rw-r--r-- 1 root root 94369 Jun 16 22:54 d-rodent3.uci
-rw-r--r-- 1 root root 89042 Jun 16 22:54 d-rodent.uci
-rwxr-xr-x 1 root root 440208 Jun 16 22:54 embla
-rw-r--r-- 1 root root 28550 Jun 25 08:22 engines.ini
-rw-r--r-- 1 root root 28130 Jun 16 22:54 engines.ini.al
-rw-r--r-- 1 root root 23486 Jun 16 22:54 engines.ini.old
-rw-r--r-- 1 root root 28454 Jun 23 09:39 engines.ini.turing
-rw-r--r-- 1 root root 790 Jun 16 22:54 engines.uci
-rwxr-xr-x 1 root root 2730231 Jun 16 22:54 e-zurich
-rw-r--r-- 1 root root 661 Jun 16 22:54 e-zurich.uci
-rw-r--r-- 1 root root 2268 Jun 21 22:53 fruit.log
-rwxr-xr-x 1 root root 809872 Jun 16 22:54 fruit-reloaded171208
-rw-r--r-- 1 root root 1093 Jun 16 22:54 fruit-reloaded171208.uci
-rwxr-xr-x 1 root root 138448 Jun 16 22:54 f-wyld
-rw-r--r-- 1 root root 1066 Jun 16 22:54 f-wyld.uci
-rw-r--r-- 1 root root 0 Jun 21 22:53 games.pgn
-rwxr-xr-x 1 root root 428068 Jun 16 22:54 g-galjoe
-rw-r--r-- 1 root root 573 Jun 16 22:54 g-galjoe.uci
-rwxr-xr-x 1 root root 292608 Jun 16 22:54 glaurung
-rwxr-xr-x 1 root root 4938464 Jun 16 22:54 h-sayuri
-rwxr-xr-x 1 root root 102860 Jun 16 22:54 i-floyd
-rwxr-xr-x 1 root root 218856 Jun 16 22:54 j-marvin
-rwxr-xr-x 1 root root 153396 Jun 16 22:54 k2v091
-rwxr-xr-x 1 root root 420480 Jun 16 23:08 lc0
-rwxr-xr-x 1 root root 420480 Jun 16 23:08 lczero
-rwxr-xr-x 1 root root 132756 Jun 16 22:54 l-ethereal
-rwxr-xr-x 1 root root 202724 Jun 16 22:54 l-laser
-rwxr-xr-x 1 root root 264376 Jun 16 22:54 matefinder9
-rw-r--r-- 1 root root 633 Jun 16 22:54 matefinder9.uci
-rwxr-xr-x 1 root root 278744 Jun 16 22:54 McBrain-92
-rw-r--r-- 1 root root 1229 Jun 16 22:54 McBrain-92.LS.uci
-rw-r--r-- 1 root root 2746 Jun 16 22:54 McBrain-92-MB.uci
-rw-r--r-- 1 root root 2891 Jun 16 22:54 McBrain-92.MB.uci
-rw-r--r-- 1 root root 1229 Jun 16 22:54 McBrain-92.normal.uci
-rw-r--r-- 1 root root 736 Jun 16 22:54 McBrain-92.SL.uci
-rw-r--r-- 1 root root 2439 Jun 16 22:54 McBrain-92.uci
-rwxr-xr-x 1 root root 878340 Jun 16 22:54 m-cinnam
-rwxr-xr-x 1 root root 945332 Jun 16 22:54 n-danasah
-rwxr-xr-x 1 root root 872240 Jun 16 22:54 nemorino416
-rwxr-xr-x 1 root root 951636 Jun 16 22:54 o-amoeba
-rwxr-xr-x 1 root root 1322204 Jun 16 22:54 o-dragon
-rwxr-xr-x 1 root root 102892 Jun 16 22:54 old-floyd.x7da0e241
-rwxr-xr-x 1 root root 432456 Jun 16 22:54 opental10
-rwxr-xr-x 1 root root 436552 Jun 16 22:54 opental11
-rwxr-xr-x 1 root root 706052 Jun 16 22:54 pedone17
-rw-r--r-- 1 root root 312 Jun 16 22:54 pedone17.uci
-rw-r--r-- 1 root root 42643 Jun 16 22:54 personality_all
-rwxr-xr-x 1 root root 677248 Jun 16 22:54 q-demolito
-rw-r--r-- 1 root root 10172160 Jun 16 22:54 rodent.bin
-rwxr-xr-x 1 root root 108152 Jun 16 22:54 r-roboci
-rwxr-xr-x 1 root root 104284 Jun 16 22:54 rubiChess-Board88
-rwxr-xr-x 1 root root 141044 Jun 16 22:54 r-zevra
-rwxr-xr-x 1 root root 177264 Jun 16 22:54 sctr
-rwxr-xr-x 1 root root 104360 Jun 16 22:54 senpai20
-rwxr-xr-x 1 root root 92144 Jun 16 22:54 shallowblue110
-rwxr-xr-x 1 root root 190444 Jun 16 22:54 snowy022
-rwxr-xr-x 1 root root 308497 Jun 16 22:54 stf-Human
-rw-r--r-- 1 root root 716 Jun 16 22:54 stf-Human.uci
-rwxr-xr-x 1 root root 271792 Jun 16 22:54 stingSF999
-rw-r--r-- 1 root root 599 Jun 16 22:54 stingSF999.uci
-rwxr-xr-x 1 root root 259528 Jun 16 22:54 stockfish191
-rwxr-xr-x 1 root root 243892 Jun 16 22:54 stockfish231
-rw-r--r-- 1 root root 599 Jun 16 22:54 stockfish231.uci
-rwxr-xr-x 1 root root 268468 Jun 16 22:54 stockfish3
-rw-r--r-- 1 root root 599 Jun 16 22:54 stockfish3.uci
-rwxr-xr-x 1 root root 280768 Jun 16 22:54 stockfish4
-rw-r--r-- 1 root root 599 Jun 16 22:54 stockfish4.uci
-rwxr-xr-x 1 root root 276776 Jun 16 22:54 stockfish5
-rw-r--r-- 1 root root 599 Jun 16 22:54 stockfish5.uci
-rwxr-xr-x 1 root root 243988 Jun 16 22:54 stockfish6
-rw-r--r-- 1 root root 599 Jun 16 22:54 stockfish6.uci
-rwxr-xr-x 1 root root 227752 Jun 16 22:54 stockfish7
-rw-r--r-- 1 root root 598 Jun 16 22:54 stockfish7.uci
-rwxr-xr-x 1 root root 239780 Jun 16 22:54 stockfish8
-rw-r--r-- 1 root root 1449 Jun 16 22:54 stockfish8.uci
-rwxr-xr-x 1 root root 264376 Jun 16 22:54 stockfish9al
-rw-r--r-- 1 root root 739 Jun 16 22:54 stockfish9al.uci
-rwxr-xr-x 1 root root 280820 Jun 16 22:54 stockfishdd
-rw-r--r-- 1 root root 599 Jun 16 22:54 stockfishdd.uci
-rwxr-xr-x 1 root root 297248 Jun 16 22:54 sugaR
-rw-r--r-- 1 root root 599 Jun 16 22:54 sugaR.uci
-rwxr-xr-x 1 root root 178516 Jun 16 22:54 teki2
-rwxr-xr-x 1 root root 104620 Jun 16 22:54 t-fruit


-rwxr-xr-x 1 root root 129684 Jun 16 22:54 togaII401

-rw-r--r-- 1 root root 5010 Jun 21 22:53 trace.log
lrwxrwxrwx 1 root root 34 Jun 24 14:45 turing -> /home/pi/PyTuroChamp/ptc_xboard.py
-rw-r--r-- 1 root root 135 Jun 25 05:54 turing.uci
-rwxr-xr-x 1 root root 4938464 Jun 16 22:54 u-sayuri
-rwxr-xr-x 1 root root 373976 Jun 16 22:54 v-vajole
-rwxr-xr-x 1 root root 1718052 Jun 16 22:54 zurichess-jura
-rw-r--r-- 1 root root 599 Jun 16 22:54 zurichess-jura.uci
-rwxr-xr-x 1 root root 1718148 Jun 16 22:54 zuri-luzern
-rw-r--r-- 1 root root 661 Jun 16 22:54 zuri-luzern.uci
-rwxr-xr-x 1 root root 1784548 Jun 16 22:54 zuri-Neuchatel
-rw-r--r-- 1 root root 662 Jun 16 22:54 zuri-Neuchatel.uci
-rwxr-xr-x 1 root root 1669492 Jun 16 22:54 zuriNidwalden
-rw-r--r-- 1 root root 662 Jun 16 22:54 zuriNidwalden.uci

pi@DGTPi:~/PyTuroChamp $ ls -all
total 1132
drwxr-xr-x 5 root root 4096 Jun 25 08:02 .
drwxr-xr-x 7 pi pi 4096 Jun 24 21:35 ..
-rwxr-xr-x 1 root root 78 Jun 24 21:35 bare
-rwxr-xr-x 1 root root 4204 Jun 24 21:35 bare.py
-rw-r--r-- 1 root root 978087 Jun 24 21:35 chess-eco.pos.txt
drwxr-xr-x 8 root root 4096 Jun 24 21:35 .git
drwxr-xr-x 2 root root 4096 Jun 24 21:35 icons
-rwxr-xr-x 1 root root 898 Jun 24 21:35 movetest.py
-rwxr-xr-x 1 root root 78 Jun 24 21:35 newt
-rwxr-xr-x 1 root root 6628 Jun 24 21:35 newt.py
-rwxr-xr-x 1 root root 3182 Jun 24 21:35 pst.py
-rwxr-xr-x 1 root root 74 Jun 24 21:35 ptc
-rwxr-xr-x 1 root root 3225 Jun 25 08:02 ptc_bare.py
-rw-r--r-- 1 root root 891 Jun 24 21:35 ptc-bare-stockfish.pgn
-rw-r--r-- 1 root root 131 Jun 24 21:35 ptc.bat
-rwxr-xr-x 1 root root 711 Jun 24 21:35 ptc-host.py
-rwxr-xr-x 1 root root 3475 Jun 24 21:35 ptc_xboard.py
drwxr-xr-x 2 root root 4096 Jun 25 08:20 __pycache__
-rwxr-xr-x 1 root root 7410 Jun 24 21:35 pyturochamp.py
-rw-r--r-- 1 root root 6255 Jun 24 21:35 README.md
-rw-r--r-- 1 root root 79027 Jun 24 21:35 Screenshot_20171123_102423.png
-rwxr-xr-x 1 root root 1955 Jun 24 21:35 xboard-host.py

Dirk

unread,
Jun 25, 2018, 5:52:12 AM6/25/18
to PicoChess
By the way: you won't have ptc_bare.py in your PyturoChamp directory (thats created by me for calling the bare option).

Al

unread,
Jun 25, 2018, 6:53:09 AM6/25/18
to PicoChess
Dirk,

I recognise all those engines 😄

When you are against Turin, what does your Webserver show, like top, mine both show I’m playing Stockfish.
Very strange when Stockfish is not in my picochess.ini, nor in my engines.ini, only Turin is there.

One thing at a time, if I get Turin running I may ask for the other engine.

The settings look the same. I boot PicoChess, when I go to select engines Turin is already showing, but it plays as Stockfish ?

Al.

Al

unread,
Jun 25, 2018, 7:06:38 AM6/25/18
to PicoChess
I got it, I told you it would be something simple.

I have a system in my home directory where all engine sources start with lower case and all utilities start with higher case. I had rename PyTuroChess as pyTuroChess but the link had a capital P. So PicoChess is clever enough to ignore a bad link and play the first Engine in the folder, even though it wasn’t an engine in engines.ini.

I just started a game against ‘easy’ and it is. ‘top’ shows python 3 and the Webserver shows correctly:

Scally (1650) vs PyTuroChamp (Easy) (500)
PicoChess game, Rotherhithe, United Kingdom GB 2018.06.25

Yeehar,

Thanks,

Al.

Ok, give me you other engine please. I assume your ini file is the same?

Topschach Benny

unread,
Jun 25, 2018, 7:38:24 AM6/25/18
to PicoChess
Hey Dirk,

I recommend the command "htop". Its better and should be installed by default. If not, then just "sudo apt-get install htop".

Benny

Dirk

unread,
Jun 25, 2018, 12:36:49 PM6/25/18
to PicoChess
Hi Al,

glad you figured it out again - as usual ;-)

By the way I think there is a big bug in Version 0.9N when choosing an engine which will lead to an error - so no "engine ok" confirmation.

In this case (at least when I have experimented with the PyTuroChamp engines) it still shows the faulty engine as selected in the menu but in reality it is running the previous engine which was not faulty (you can double check in log that this is the fallback and by checking with this this great top command the running processes ;-)

So that would have been my guess for your problem (although yours was different cause)- so we just should keep that in mind when something strange is happening in our neighborhood ;-)

Dirk

Dirk

unread,
Jun 25, 2018, 1:19:07 PM6/25/18
to PicoChess
Martin, dev. of PyTuroChamp, pointed out to me that he has referenced to the original document by Alan Turing .
The document describes Turings paper engine algorithm which might also interesting for determining the most accurate original settings for MAXPLIES etc.

This is the PDF link to Turings original paper - a very interesting read!

https://docs.google.com/file/d/0B0xb4crOvCgTNmEtRXFBQUIxQWs/edit

Enjoy!

Dirk

Al

unread,
Jun 25, 2018, 1:56:52 PM6/25/18
to PicoChess
Hi Dirk,

Yes I knew that thanks. It’s not 0.9n that’s at fault, but the actual Engine when closing. If you see my main README file, it mentions that I had problems with Ethereal & Cheese, although they work on PicoChess, the next Engine you select crashes. So I removed them from the engines.ini file.

Cheers,

Al.

Al

unread,
Jun 25, 2018, 1:58:54 PM6/25/18
to PicoChess
Nice, I’m going to add this Engine to my list with instructions, thanks to you. I will also add the link to the History of the Engine.

Cheers,

Al.

Dirk

unread,
Jun 26, 2018, 3:28:37 PM6/26/18
to PicoChess
Hello,

the new turing engine is (because it's implemented in python) relativly slow especially when the game for stronger players should also be fun.


Try a game against turing with the following setting
MAXPLIES = 4
QPLIES = 8
PSTAB = 5
and you will be surprised (at least I was)!

Martin suggested to install "pypy" in addition to python3 which would gain some big performance improvement compared to python 3.5/3.6.

But then I think we would get again problems by starting python scripts with the pypy command from within picochess unless the new pypy command would be assigned by default to process python *.py scripts.

Is there a reason why even picochess is running under python 3 instead of pypy with better performance?


Ok - another solution would be a multi core version of pyturochmp.py.

Guess what????

Martin just has implemented it and I test it during the soccer game - it looks like it is 3-4 times faster than the single core version on my DGT PI (it looks like DGT Pi supports at least 5 core processes?).

At he moment it does not support the options to change MAXPLIES, QPLIES and PSTAB but maybe this will also added in near future (up to then you would have to change parameters directly in source coding (MAXPLIES = 4 QPLIES = 8 PSTAB = 5 are default)

I will add turing_multi (have to create new python ici wrapper script to be able of being called by picochess) later and inform Al.

Dirk

top - 18:50:25 up 15 min, 1 user, load average: 4.79, 4.23, 2.49
Tasks: 131 total, 5 running, 125 sleeping, 0 stopped, 1 zombie
%Cpu(s): 99.6 us, 0.4 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 949572 total, 777176 free, 73628 used, 98768 buff/cache
KiB Swap: 102396 total, 102396 free, 0 used. 820420 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

633 root 20 0 26592 10196 4464 R 100.0 1.1 8:23.52 python3
626 root 20 0 26592 12644 6944 R 99.3 1.3 8:46.80 python3
631 root 20 0 26592 10196 4464 R 99.3 1.1 8:33.19 python3
634 root 20 0 26592 10180 4456 R 95.5 1.1 8:43.91 python3
361 root 20 0 229792 37412 9564 S 5.8 3.9 1:04.47 python3
1429 pi 20 0 8236 3296 2732 R 0.4 0.3 0:04.37 top
87 root -51 0 0 0 0 S

Al

unread,
Jun 26, 2018, 4:09:39 PM6/26/18
to PicoChess
Hi Dirk,

I’m listening 😄

Weirdly I had already tried more than 1 core, I had Threads = 1 in Easy, Threads = 2 in TuroChamp and Threads = 4 in Strong (within th uci) but it didn’t work. It’s nice to know they are being added.

I’m sure there’s only 4 cores on the Raspberry Pi though.


Cheers,

Al.

Al

unread,
Jun 28, 2018, 6:44:32 AM6/28/18
to PicoChess
Hi Dirk,

I tried your new uci settings, I called it [Dirk] 😳

It took 3 minutes 30 seconds to reply e6 to my d4 ...

I see Martin has added ‘pyturochamp_multi.py‘ how are you getting on with your script?


Cheers,

Al.

Dirk

unread,
Jun 30, 2018, 6:52:53 AM6/30/18
to PicoChess
Yes, PyTuroChamp is indeed a very slow engine from MAXPLIES 4 on (cause it's all in python).

Also Martin and I have found out that some default setting (like PSTAB = 5 are not optimal).

The multi Turing engine will use max. possible cores and is at least 2 times faster.

Will post settings upon my return from my vacation trip.

Dirk

Dirk

unread,
Jul 1, 2018, 1:16:31 PM7/1/18
to PicoChess
Good news:

Martin was so kind and has updated his PyTuroChamp engine to default mode using multi-cores!

So there is no need for any code adjustments for picochess in order to use this version which is a must because os low performance.

Here are my settings so we don't have to wait too long (option TuroChamp is still the "almost" original Turing heuristic with PSTAB = 0 (so pawns like h7h5 or a7a5 are played very often and soon by the engine ;-)

Easy, normal harder do use PSTAB = 2 (higher values would lead too early to material loss in our experience)


Enjoy!
Dirk


[turing]
name = Turing
small = Turing
medium = Turing
large = Turing
elo = 500

—————————————————————————

turing.uci

[TuroChamp]
maxplies = 2
qplies = 4
pstab = 0

[1 - easy]
maxplies = 2
qplies = 4
pstab = 2

[2 - normal]
maxplies = 3
qplies = 5
pstab = 2

[3 - harder]
maxplies = 4
qplies = 6
pstab = 2

Al

unread,
Jul 1, 2018, 6:34:10 PM7/1/18
to PicoChess
Thanks Dirk,

I’ve updated my copy.

Cheers,

Al.

Al

unread,
Jul 5, 2018, 12:24:29 PM7/5/18
to PicoChess
Hi Dirk,

According to Martin’s latest documentation, maxplies & qplies for PTC-Host & Bare should be a odd number, so we need to re-think the uci files for Alphabeta and Turing.

It also mentions Newt?

See: https://github.com/mdoege/PyTuroChamp/commit/cf0dc639f46e07f197bc1ce95c0b6ad37b015609


Cheers,

Al.

Dirk

unread,
Jul 5, 2018, 2:23:23 PM7/5/18
to PicoChess
Hi Al,

indeed Martin just suggested to change the default settings so that the engines will not so "easy" overlook direct material losses etc.

For this we would have to use odd numbers for the plies parameter.

As with MAXPLIES = 3 PyTuroChamp already needs long thinking times we would have to use MAXPLIES = 1 and QPLIES = 3.

Because of less plies Martin changes behavior so that more moves will be "considerable" according to Turing's original description.

So we now have the almost original Turochamp with

MAXPLIES = 1
QPLIES = 3
PSTAB = 0

and I changed my personal other level settings to:

1- easy
MAXPLIES = 1
QPLIES = 3
PSTAB = 2

1- normal
MAXPLIES = 3
QPLIES = 5
PSTAB = 2

1- harder
MAXPLIES = 3
QPLIES = 7
PSTAB = 2

Regards
Dirk

Dirk

unread,
Jul 5, 2018, 2:56:07 PM7/5/18
to PicoChess
newt is a call option (like bar) of ptc_xboard.py.

If you want this "newt" version you would have to copy ptc_xboard.py and rename it to eg. newt.py and uncomment all other options except for the newt option. Then newt will be executed within ptc_xboard. This is necessary because I don't  know how to call a python engine with different call options 

 I did exactly this procedure with the bare option and rebased it to alphabeta.
  

Regards
Dirk

Dirk

unread,
Jul 5, 2018, 2:58:34 PM7/5/18
to PicoChess
Newt also ditches the old turing heuristics and adds newer techniques like PV-based iterative deepening and an opening book. It is comparatively strong and fast. 

Al

unread,
Jul 5, 2018, 4:05:37 PM7/5/18
to PicoChess
Thanks Dirk,

Should we not Change alphabeta.uci maxplies to 1, 3 & 5 (from 2, 3 & 4) in Easy, Normal & Stronger respectively?

Al.

Dirk

unread,
Jul 6, 2018, 11:16:57 AM7/6/18
to PicoChess
Hi Al,

yep because alphabeta is based on the same principle - and you already did it I assume ;-)

Dirk

Reply all
Reply to author
Forward
0 new messages