PyTuroChamp and Arena GUI - strange behaviour

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

Moderators: hgm, Rebel, chrisw

Norbert Raimund Leisner
Posts: 1643
Joined: Tue May 20, 2008 4:57 pm
Location: Augsburg - Germany

PyTuroChamp and Arena GUI - strange behaviour

Post by Norbert Raimund Leisner »

Hello,

after the moves 1.e4 e5 2.f4 d5 3.d4 Nc6 4.ed5: executed PyTuroChamp https://github.com/mdoege/PyTuroChamp immediately 4...e4, after this ply I could not make any further moves with the white pieces

Arena <F4> debug ; engine was recognized with WB-2 protocol

2017-12-18 14:27:20,676-->1:hard 2017-12-18 14:27:20,676-->1:easy 2017-12-18 14:27:25,547*1*Start calc, move no: 0 2017-12-18 14:27:25,554-->1:time 30000 2017-12-18 14:27:25,554-->1:otim 30000 2017-12-18 14:27:25,554-->1:white 2017-12-18 14:27:25,554-->1:go 2017-12-18 14:27:27,474<--1:# 7.30 ['e2e4'] 2017-12-18 14:27:27,475<--1:move e2e4 2017-12-18 14:27:27,475*1*Found move:e2-e4 2017-12-18 14:27:44,161**----------New game---2017-12-18 14:27:44,161 Mo ------------- 2017-12-18 14:27:44,161-->1:level 0 5 0 2017-12-18 14:27:44,161-->1:new 2017-12-18 14:27:44,161-->1:random 2017-12-18 14:27:44,161-->1:level 0 5 0 2017-12-18 14:27:44,424*1*Start calc, move no: 1 2017-12-18 14:27:44,483-->1:time 30000 2017-12-18 14:27:44,483-->1:otim 30000 2017-12-18 14:27:44,483-->1:f2f4 2017-12-18 14:27:44,483-->1:post 2017-12-18 14:27:44,483-->1:hard 2017-12-18 14:27:44,483-->1:easy 2017-12-18 14:27:46,313<--1:# 3.65 ['e7e6'] 2017-12-18 14:27:46,313<--1:move e7e6 2017-12-18 14:27:46,313*1*Found move:e7-e6 2017-12-18 14:27:51,205**----------New game---2017-12-18 14:27:51,205 Mo ------------- 2017-12-18 14:27:51,205-->1:level 0 5 0 2017-12-18 14:27:51,205-->1:new 2017-12-18 14:27:51,205-->1:random 2017-12-18 14:27:51,205-->1:level 0 5 0 2017-12-18 14:27:51,210-->1:post 2017-12-18 14:27:51,210-->1:hard 2017-12-18 14:27:51,210-->1:easy 2017-12-18 14:27:57,808*1*Start calc, move no: 1 2017-12-18 14:27:57,868-->1:time 30000 2017-12-18 14:27:57,868-->1:otim 30000 2017-12-18 14:27:57,868-->1:e2e4 2017-12-18 14:28:05,781<--1:# -7.30 ['e7e5'] 2017-12-18 14:28:05,781<--1:move e7e5 2017-12-18 14:28:05,781*1*Found move:e7-e5 2017-12-18 14:28:10,524*1*Start calc, move no: 3 2017-12-18 14:28:10,582-->1:time 29210 2017-12-18 14:29:07,448<--1:# -5.50 ['d7d5'] 2017-12-18 14:29:07,448<--1:move d7d5 2017-12-18 14:29:07,448*1*Found move:d7-d5 2017-12-18 14:29:14,133*1*Start calc, move no: 5 2017-12-18 14:29:14,184-->1:time 23524 2017-12-18 14:29:14,184-->1:otim 28958 2017-12-18 14:29:14,184-->1:d2d4 2017-12-18 14:34:50,780<--1:# -4.50 ['b8c6'] 2017-12-18 14:34:50,780<--1:move b8c6 2017-12-18 14:34:50,780*1*Found move:Nb8-c6 2017-12-18 14:35:18,541*1*Start calc, move no: 8 2017-12-18 14:35:18,602-->1:force 2017-12-18 14:35:18,802-->1:e4d5 2017-12-18 14:35:18,802-->1:e5e4 2017-12-18 14:35:18,802-->1:time 26258 2017-12-18 14:35:18,802-->1:otim 1 2017-12-18 14:35:18,802-->1:white 2017-12-18 14:35:18,802-->1:go 2017-12-18 14:40:24,223<--1: d.push_uci(l) 2017-12-18 14:40:24,224<--1: File "C:\Users\NRL\Downloads\arena_3.5.1\Engines\Miniconda3\lib\site-packages\chess\__init__.py", line 2620, in push_uci 2017-12-18 14:40:24,225<--1: move = self.parse_uci(uci) 2017-12-18 14:40:24,225<--1: File "C:\Users\NRL\Downloads\arena_3.5.1\Engines\Miniconda3\lib\site-packages\chess\__init__.py", line 2607, in parse_uci 2017-12-18 14:40:24,226<--1: raise ValueError("illegal uci: {0} in {1}".format(repr(uci), self.fen())) 2017-12-18 14:40:24,229<--1:ValueError: illegal uci: 'e4d5' in r1bqkbnr/ppp2ppp/2n5/3pp3/3PPP2/2N5/PPP3PP/R1BQKBNR b KQkq - 2 4

Do you know a better choice than https://github.com/niklasf/python-chess ?
Often PyChess Library creates move orders with blunders for the engine that could derive from a beginner....

Windows 7 SP1 32-bit
Miniconda 3 https://conda.io/miniconda.html


[White "NRL"]
[Black "PyTuroChamp"]
[Result "1-0"]
[ECO "D31"]
[Opening "Damengambit"]
[Variation "3.Nc3 Nc6"]
[Termination "normal"]
[PlyCount "33"]
[WhiteType "human"]
[BlackType "program"]

1. d4 e6 2. c4 d5 3. Nc3 Nc6 4. Nf3 h5 5. Bf4 Bb4 6. e3 Nf6 7. Bg5 O-O 8.
Bd3 Bd7 9. O-O a6 10. Ne5 b6 11. Qf3 Nxe5 12. dxe5 c5 13. exf6 Qc7 14. Qxh5 g6 15. Qh6 Qxh2+ 16. Kxh2 Rfd8 17. Qg7# 1-0


[White "PyTuroChamp"]
[Black "NRL"]
[Result "0-1"]
[ECO "C21"]
[Opening "Centre Game"]
[Variation "1.e4 e5 2.d4 exd4"]
[Termination "normal"]
[PlyCount "60"]
[WhiteType "program"]
[BlackType "human"]

1. e4 e5 2. d4 exd4 3. h4 Nc6 4. a4 d5 5. Nc3 dxc3 6. Qxd5 Qxd5 7. exd5 Nd4 9.Bd3 Bb4 9. b3 Bf5 10. Nf3 Nxf3+ 11. gxf3 Bxd3 12. cxd3 O-O-O 13. O-O Rxd5 14. Bg5 Rxd3 15. Rfd1 Rxd1+ 16. Rxd1 Nf6 17. Re1 Re8 18. Rxe8+ Nxe8 19. Kg2 h6 20. Be3 Nd6 21. h5 Nf5 22. Kg1 Nxe3 23. fxe3 c2 24. a5 c1=Q+ 25.Kg2 Qxe3 26. a6 b6 27. Kh1 Qf2 28. f4 Bd6 29. b4 Bxf4 30. b5 Qh2# 0-1

Best wishes

Norbert
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: PyTuroChamp and Arena GUI - strange behaviour

Post by Ras »

Maybe that's more readable:

Code: Select all

2017-12-18 14&#58;27&#58;20,676-->1&#58;hard
2017-12-18 14&#58;27&#58;20,676-->1&#58;easy
2017-12-18 14&#58;27&#58;25,547*1*Start calc, move no&#58; 0
2017-12-18 14&#58;27&#58;25,554-->1&#58;time 30000
2017-12-18 14&#58;27&#58;25,554-->1&#58;otim 30000
2017-12-18 14&#58;27&#58;25,554-->1&#58;white
2017-12-18 14&#58;27&#58;25,554-->1&#58;go
2017-12-18 14&#58;27&#58;27,474<--1&#58;# 7.30 &#91;'e2e4'&#93;
2017-12-18 14&#58;27&#58;27,475<--1&#58;move e2e4
2017-12-18 14&#58;27&#58;27,475*1*Found move&#58;e2-e4
2017-12-18 14&#58;27&#58;44,161**----------New game---2017-12-18 14&#58;27&#58;44,161 Mo -------------
2017-12-18 14&#58;27&#58;44,161-->1&#58;level 0 5 0
2017-12-18 14&#58;27&#58;44,161-->1&#58;new
2017-12-18 14&#58;27&#58;44,161-->1&#58;random
2017-12-18 14&#58;27&#58;44,161-->1&#58;level 0 5 0
2017-12-18 14&#58;27&#58;44,424*1*Start calc, move no&#58; 1
2017-12-18 14&#58;27&#58;44,483-->1&#58;time 30000
2017-12-18 14&#58;27&#58;44,483-->1&#58;otim 30000
2017-12-18 14&#58;27&#58;44,483-->1&#58;f2f4
2017-12-18 14&#58;27&#58;44,483-->1&#58;post
2017-12-18 14&#58;27&#58;44,483-->1&#58;hard
2017-12-18 14&#58;27&#58;44,483-->1&#58;easy
2017-12-18 14&#58;27&#58;46,313<--1&#58;# 3.65 &#91;'e7e6'&#93;
2017-12-18 14&#58;27&#58;46,313<--1&#58;move e7e6
2017-12-18 14&#58;27&#58;46,313*1*Found move&#58;e7-e6
2017-12-18 14&#58;27&#58;51,205**----------New game---2017-12-18 14&#58;27&#58;51,205 Mo -------------
2017-12-18 14&#58;27&#58;51,205-->1&#58;level 0 5 0
2017-12-18 14&#58;27&#58;51,205-->1&#58;new
2017-12-18 14&#58;27&#58;51,205-->1&#58;random
2017-12-18 14&#58;27&#58;51,205-->1&#58;level 0 5 0
2017-12-18 14&#58;27&#58;51,210-->1&#58;post
2017-12-18 14&#58;27&#58;51,210-->1&#58;hard
2017-12-18 14&#58;27&#58;51,210-->1&#58;easy
2017-12-18 14&#58;27&#58;57,808*1*Start calc, move no&#58; 1
2017-12-18 14&#58;27&#58;57,868-->1&#58;time 30000
2017-12-18 14&#58;27&#58;57,868-->1&#58;otim 30000
2017-12-18 14&#58;27&#58;57,868-->1&#58;e2e4
2017-12-18 14&#58;28&#58;05,781<--1&#58;# -7.30 &#91;'e7e5'&#93;
2017-12-18 14&#58;28&#58;05,781<--1&#58;move e7e5
2017-12-18 14&#58;28&#58;05,781*1*Found move&#58;e7-e5
2017-12-18 14&#58;28&#58;10,524*1*Start calc, move no&#58; 3
2017-12-18 14&#58;28&#58;10,582-->1&#58;time 29210
2017-12-18 14&#58;29&#58;07,448<--1&#58;# -5.50 &#91;'d7d5'&#93;
2017-12-18 14&#58;29&#58;07,448<--1&#58;move d7d5
2017-12-18 14&#58;29&#58;07,448*1*Found move&#58;d7-d5
2017-12-18 14&#58;29&#58;14,133*1*Start calc, move no&#58; 5
2017-12-18 14&#58;29&#58;14,184-->1&#58;time 23524
2017-12-18 14&#58;29&#58;14,184-->1&#58;otim 28958
2017-12-18 14&#58;29&#58;14,184-->1&#58;d2d4
2017-12-18 14&#58;34&#58;50,780<--1&#58;# -4.50 &#91;'b8c6'&#93;
2017-12-18 14&#58;34&#58;50,780<--1&#58;move b8c6
2017-12-18 14&#58;34&#58;50,780*1*Found move&#58;Nb8-c6
2017-12-18 14&#58;35&#58;18,541*1*Start calc, move no&#58; 8
2017-12-18 14&#58;35&#58;18,602-->1&#58;force
2017-12-18 14&#58;35&#58;18,802-->1&#58;e4d5
2017-12-18 14&#58;35&#58;18,802-->1&#58;e5e4
2017-12-18 14&#58;35&#58;18,802-->1&#58;time 26258
2017-12-18 14&#58;35&#58;18,802-->1&#58;otim 1
2017-12-18 14&#58;35&#58;18,802-->1&#58;white
2017-12-18 14&#58;35&#58;18,802-->1&#58;go
2017-12-18 14&#58;40&#58;24,223<--1&#58; d.push_uci&#40;l&#41;
2017-12-18 14&#58;40&#58;24,224<--1&#58; File "C&#58;\Users\NRL\Downloads\arena_3.5.1\Engines\Miniconda3\lib\site-packages\chess\__init__.py", line 2620, in push_uci
2017-12-18 14&#58;40&#58;24,225<--1&#58; move = self.parse_uci&#40;uci&#41;
2017-12-18 14&#58;40&#58;24,225<--1&#58; File "C&#58;\Users\NRL\Downloads\arena_3.5.1\Engines\Miniconda3\lib\site-packages\chess\__init__.py", line 2607, in parse_uci
2017-12-18 14&#58;40&#58;24,226<--1&#58; raise ValueError&#40;"illegal uci&#58; &#123;0&#125; in &#123;1&#125;".format&#40;repr&#40;uci&#41;, self.fen&#40;)))
2017-12-18 14&#58;40&#58;24,229<--1&#58;ValueError&#58; illegal uci&#58; 'e4d5' in r1bqkbnr/ppp2ppp/2n5/3pp3/3PPP2/2N5/PPP3PP/R1BQKBNR b KQkq - 2 4 
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: PyTuroChamp and Arena GUI - strange behaviour

Post by Ras »

Interesting sequence:

Code: Select all

14&#58;28&#58;05,781<--1&#58;# -7.30 &#91;'e7e5'&#93; 
14&#58;28&#58;05,781<--1&#58;move e7e5 
14&#58;28&#58;05,781*1*Found move&#58;e7-e5 
14&#58;28&#58;10,524*1*Start calc, move no&#58; 3 
14&#58;28&#58;10,582-->1&#58;time 29210 
14&#58;29&#58;07,448<--1&#58;# -5.50 &#91;'d7d5'&#93; 
14&#58;29&#58;07,448<--1&#58;move d7d5 
14&#58;29&#58;07,448*1*Found move&#58;d7-d5 
There is no move "f2-f4" inbetween. That move is there, at 14:27:44,483, but at 14:27:51,205 , there is a "new" command initiating a new game. Looks like the d7-d5 move didn't really make it because there was no white move after e7-e5. If d7-d5 hasn't happened, then this explains why e4xd5 is regarded as illegal.
User avatar
Guenther
Posts: 4606
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: PyTuroChamp and Arena GUI - strange behaviour

Post by Guenther »

Norbert Raimund Leisner wrote:Hello,

after the moves 1.e4 e5 2.f4 d5 3.d4 Nc6 4.ed5: executed PyTuroChamp https://github.com/mdoege/PyTuroChamp immediately 4...e4, after this ply I could not make any further moves with the white pieces
Well, I wanted to warn you, but I also wanted to wait until you figured out how to use pip yourself.
There is already since may be 2 weeks a comment in the XB/UCI chronology about PyTuroChamp in the 'waiting list'.

Code: Select all

PyTuroChamp	plays only one colour per session - plays for the wrong side often in WB against C players		https&#58;//github.com/mdoege/PyTuroChamp		2017-12
I did not even mention there that you have to change the code yourself to make it play another colour...and also other code to avoid time losses.

Guenther

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.01"]
[Round "-"]
[White "Guenther Simon"]
[Black "PyTuroChamp"]
[Result "1-0"]
[TimeControl "40/240"]

1. e4 e5 2. Nf3 d5 3. exd5 Nf6 4. Nxe5
{White wins on time} 1-0

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.01"]
[Round "-"]
[White "Guenther Simon"]
[Black "PyTuroChamp"]
[Result "1-0"]
[TimeControl "40/240"]

1. e4 e5 2. Nf3 d5 3. exd5 Qxd5 4. Nc3 Qe6 5. Be2 Nc6 6. O-O h5 7. d3 Nd4
8. Be3 Bd7 9. Re1 O-O-O 10. Bxd4 exd4 11. Nxd4 Qe5 12. Nf3 Qf4 13. Qd2 Bd6
14. Ne4 Nf6 15. Nxd6+ Qxd6 16. Bf1 Kb8 17. Rad1 Qc5 18. c3 Be6 19. d4 Qa5
20. a3 h4 21. Qg5 Qa4 22. Qxg7 Qc2 23. Qxf6 h3 24. g3 Bb3 25. Bd3 Qxb2 26.
Rb1 Qxc3 27. Be4 Rhe8 28. Rec1 Rd6 29. Qf5 Qxf3 30. Qxf3 f5 31. Bxb7 Re2
32. Rxb3 Rb6 33. Rxb6 axb6 34. Qc6 Rd2 35. Qxc7+ Ka7 36. Bc8+ Ka8 37. Qb7#
{Xboard adjudication: Checkmate} 1-0

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.01"]
[Round "-"]
[White "NSVChess 0.14 (UCI2WB)"]
[Black "PyTuroChamp"]
[Result "1-0"]
[TimeControl "40/240"]
[Annotator "1. +0.25"]

1. Nc3 {+0.25/6}
{Xboard: Forfeit due to invalid move: = (a1a1 via `0, `0) res=0} 1-0

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.01"]
[Round "-"]
[White "PyTuroChamp"]
[Black "Xadreco v.5.7, by Beco"]
[Result "0-1"]
[TimeControl "40/240"]

1. Nc3 d5 2. e4 c6
{Xboard: Forfeit due to invalid move: e7e5 (e7e5 via `0, `0) res=24} 0-1

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.04"]
[Round "-"]
[White "NSVChess 0.14 (UCI2WB)"]
[Black "PyTuroChamp"]
[Result "1-0"]
[TimeControl "40/240"]
[Annotator "1. +0.25"]

1. Nc3 {+0.25/6}
{Xboard: Forfeit due to invalid move: = (a1a1 via `0, `0) res=0} 1-0

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.04"]
[Round "-"]
[White "NSVChess 0.14 (UCI2WB)"]
[Black "PyTuroChamp_20171125"]
[Result "*"]
[TimeControl "40/240"]
[Annotator "1. +0.25"]

1. Nc3 {+0.25/6}
{xboard exit (Clocks: 231, 152)} *

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.04"]
[Round "-"]
[White "NSVChess 0.14 (UCI2WB)"]
[Black "PyTuroChamp"]
[Result "1-0"]
[TimeControl "40/240"]
[Annotator "1. +0.25"]

1. Nc3 {+0.25/6}
{Xboard: Forfeit due to invalid move: = (a1a1 via `0, `0) res=0} 1-0

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.04"]
[Round "-"]
[White "NSVChess 0.14 (UCI2WB)"]
[Black "PyTuroChamp"]
[Result "1-0"]
[TimeControl "40/240"]
[Annotator "1. +0.25"]

1. Nc3 {+0.25/6} e5 2. d4 {+0.25/5 4} d5 3. dxe5 {+1.27/5 3}
{Xboard: Forfeit due to invalid move: b1c3 (b1c3 via `0, `0) res=24} 1-0

[Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2017.12.04"]
[Round "-"]
[White "NSVChess 0.14 (UCI2WB)"]
[Black "PyTuroChamp"]
[Result "1-0"]
[TimeControl "40/240"]
[Annotator "1. +0.25"]

1. Nc3 {+0.25/6} e5 2. d4 {+0.25/5 3} d5 3. dxe5 {+1.27/5 3}
{Xboard: Forfeit due to invalid move: b1c3 (b1c3 via `0, `0) res=24} 1-0
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
User avatar
Guenther
Posts: 4606
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: PyTuroChamp and Arena GUI - strange behaviour

Post by Guenther »

Code that needs to be changed, but as I said it won't help anyway,
because it still makes moves for the wrong side often...against other engines. (not vs. Human player)

Code: Select all

# computer plays as Black by default

COMPC = c.BLACK
PLAYC = c.WHITE

MAXPLIES = 3	# maximum search depth
QPLIES    = MAXPLIES + 4
PSTAB     = 5	# influence of piece-square table on moves, 0 = none
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy