feeks

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

Moderators: hgm, Rebel, chrisw

Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: feeks

Post by Sven »

flok wrote:
Sven wrote:Also the engine is *really* slow. I have not found out yet whether that is caused by the python chess library or by your search code.
Well node count is low so I think it must be in move-gen.
Not sure. I added perft (see below) and it gets the correct numbers for 1-5 pretty fast, perft 4 in 1 second so movegen seems to be fast enough ... Ok, much faster with C++ though :-)

Code: Select all

def perft(board, depth):
    moves = board.legal_moves
    if depth == 1:
        return moves.count()
    leaves = 0
    for m in moves:
        board.push(m)
        leaves += perft(board, depth - 1)
        board.pop()
    return leaves
...
    elif parts[0] == 'perft':
        depth = int(parts[1])
        board = chess.Board()
        leaves = perft(board, depth)
        print 'number of leaves: %d' % leaves
        sys.stdout.flush()
flok

Re: feeks

Post by flok »

Ah cool, I just added it as well :-)

perft 5 gives me:

Code: Select all

Total time (ms) : 17660
Nodes searched  : 4865609
Nodes/second    : 275521
275k nodes is not that bad.

Under "pypy":

Code: Select all

Total time (ms) : 4979
Nodes searched  : 4865609
Nodes/second    : 977324
Even 1M/s!

Comparing that to Embla:

Code: Select all

perft 5
# perft depth: 5
# 4865609 cap: 84329, ep: 258, castl: 0, prom: 0, chks: 27832, cm: 0, sm: 0, imd: 0
# took 5.00s (973706nps)
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: feeks

Post by Sven »

flok wrote:perft 5 gives me:

Code: Select all

Total time (ms) : 17660
Nodes searched  : 4865609
Nodes/second    : 275521
275k nodes is not that bad.

Under "pypy":

Code: Select all

Total time (ms) : 4979
Nodes searched  : 4865609
Nodes/second    : 977324
But note that this is with bulk counting, i.e. last ply only calls movegen and returns number of legal moves. That means the real number of visited nodes per second is much lower, around 10k only.

So the search speed might actually be related to the move generator of the python chess library (as you expected), and/or to python in general, I don't know.
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: feeks

Post by Guenther »

flok wrote:The problem may be that it reaches only depth 5 in 3.7 seconds.
If you look at the game you'll see that it makes blunders, which normally not even require a search depth >3 and the pgn shows sd >=8.
I haven't looked at the code, but it seems it has a completely bogus move ordering and even with plain mobility and material it should never
make such incredible bad moves, often making one of the worst possible moves at all...
IMO LMR is a complete waste, while the program is in this state.
Also the returned eval seems more or less random, e.g. it suddenly returns a high positive score two times when it already 'knew' it is nearly lost moves before.

E.g. of all legal moves 3. Nxe5?? ranks as 4th worst possible, only Ng5/Nh4/Nd4 are (slightly) worse, all other moves (18!) are better
and it gives +0.60 for a full N blunder vs. pawn??

[Event "Computer Chess Game"]
[Site "lenovo"]
[Date "2017.12.29"]
[Round "-"]
[White "Feeks"]
[Black "GNU Chess"]
[Result "0-1"]
[TimeControl "300+12"]
[Annotator "1. +0.02 1... +0.12"]

1. Na3? {+0.02/8} Nc6 {+0.12/14 26} 2. Nf3 {+0.01/9 19} e5 {+0.25/14 0.1} 3.
Nxe5??? {+0.60/8 19} Nxe5 {+1.89/12 6} 4. Rb1?? {-1.03/8 10} Nf6 {+2.58/13 16}
5. Rg1?? {-0.28/9 15} d5 {+3.11/12 26} 6. Nb5? {-0.32/8 12} a6 {+3.83/13 26}
7. Ra1??? {-0.32/9 19} axb5 {+6.49/12 14} 8. f4?? {-3.29/7 18} Nc4 {+7.12/13 28}
9. e4??? {+2.82/7 18} Nxe4 {+9.28/13 21} 10. Qe2? {-3.99/7 12} Bc5
{+10.63/13 38} 11. Qxe4+??? {+5.43/8 18} dxe4 {+18.26/10 23}
https://rwbc-chess.de

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

Re: feeks

Post by Guenther »

BTW I remember now that the code needs to be changed a tiny bit too for running in Python 3 onwards, because print is a function since then.
I noticed this when I tried to compile it the way Lucas mentioned.
[therefor all print => print()]
https://rwbc-chess.de

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

Re: feeks

Post by Guenther »

Tried to start it now and noticed that also all instances of 'xrange' must be replaced by 'range' for python3.
Actually it was not suggested to start replacing an obvious python2 codebase, but it seems I was lucky
and just replacing all 'print' by 'print()' and 'xrange' by 'range' worked in this case.

BTW either I have broken sth or it does not support mps time control?
Increment time control works tough.

Guenther

[pgn][Event "RWBC"]
[Site "CAPPUCCINO"]
[Date "2018.01.01"]
[Round "-"]
[White "Feeks"]
[Black "Youk V1.05"]
[Result "0-1"]
[TimeControl "180+2"]
[Annotator "1. +0.62"]

1. e4 {+0.62/5} e5 2. Qh5 {+0.68/5 10} Qf6 3. Bb5 {+0.47/5 10} c6 4. Bc4
{+0.13/4 11} d5 5. exd5 {+0.03/4 7} Bc5 6. d3 {+1.11/3 6} Qxf2+ 7. Kd1
{-4.65/4 7} Qf1+ 8. Kd2 {-4.65/3 9} Qxg2+ 9. Ke1 {-4.75/3 5} Bf2+ 10. Kd2
{-7.71/3 5} Bxg1+ 11. Ke1 {-7.92/3 5} Bf2+ 12. Kd2 {-11.23/3 5} Bd4+ 13.
Qe2 {-9.10/5 7} Qxh1 14. c3 {-8.92/5 5} Kf8 15. cxd4 {-8.10/4 5} exd4 16.
dxc6 {-7.51/4 6} bxc6 17. Na3 {-6.83/4 4} Qg1 18. Qe5 {-7.11/4 4} Qf2+ 19.
Qe2 {-7.60/5 5} Qg1 20. Kc2 {-6.93/3 5} Bg4 21. Kd2 {+0.00/5 2.8} Bxe2 22.
Nb5 {-16.57/4 4} Qd1#
{Xboard adjudication: Checkmate} 0-1[/pgn]
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
flok

Re: feeks

Post by flok »

Hi,

That winc/binc issue should be fixed in the next version.

Which version did you try in the last post? Mon Jan 1 19:52:40 2018 +0100?
Did you see any blunders? There were tons of issues in the version from which I posted a game. null move broken, psq broken, aspiration window broken, time management broken.

[pgn][Event "Computer Chess Game"]
[Site "lenovo"]
[Date "2018.01.02"]
[Round "-"]
[White "Feeks"]
[Black "GNU Chess"]
[Result "0-1"]
[TimeControl "40/300"]
[Annotator "1. +0.40 1... -0.15"]

1. e4 {+0.40/7} e5 {-0.15/13 16} 2. Qh5 {+0.32/8 18} Nc6 {+0.47/13 9} 3.
Bc4 {+0.88/7 11} g6 {+0.31/13 2.3} 4. Qf3 {-0.12/8 14} Nf6 {+0.45/12 8} 5.
Ne2 {+1.01/7 16} Na5 {+0.36/12 0.1} 6. Qd3 {+0.90/7 11} c6 {+1.12/12 8} 7.
Nf4 {+0.31/6 14} exf4 {+3.56/12 11} 8. Qd4 {-3.37/6 13} Nxc4 {+4.03/12 7}
9. Qxc4 {-4.10/7 10} d5 {+4.05/13 0.1} 10. exd5 {-3.92/7 9} Qxd5
{+3.99/12 3} 11. Qxf4 {-3.65/7 8} Qxg2 {+7.07/11 9} 12. Rf1 {-4.49/7 9} Bh3
{+9.27/12 14} 13. Qe3+ {-6.49/8 5} Kd7 {+14.95/11 6} 14. Qd4+ {-5.89/7 7}
Nd5 {+18.79/12 9} 15. d3 {-11.08/7 6} Qxf1+ {+99.87/7 2.7} 16. Kd2
{-20.68/7 6} Bh6+ {+99.89/10 0.1} 17. f4 {-25.30/7 3} Bxf4+ {+99.91/24 0.1}
18. Qxf4 {-26.07/8 5} Qxf4+ {+99.93/47 0.1} 19. Ke1 {-26.84/8 2.5} Qf1+
{+99.95/43 0.5} 20. Kd2 {-100.00/8 4} Qf2+ {+99.97/44 0.1} 21. Kd1
{-100.00/8 4} Bg4# {+99.99/46 3}
{Xboard adjudication: Checkmate} 0-1[/pgn]
Norbert Raimund Leisner
Posts: 1643
Joined: Tue May 20, 2008 4:57 pm
Location: Augsburg - Germany

Re: feeks

Post by Norbert Raimund Leisner »

2018-01-02 12:39:43,620 Arena 3.5.1
2018-01-02 12:39:43,620Font Arena Chess Figurine MISSING

2018-01-02 12:39:43,839**----------Neue Partie---2018-01-02 12:39:43,839 Di -------------
2018-01-02 12:39:43,901**screen: 1280x1024
2018-01-02 12:39:43,901**Monitors: 1
2018-01-02 12:39:43,901**Monitor0: 1280x1024
2018-01-02 12:39:43,901**FormMonitor: 0
2018-01-02 12:39:43,901**DesktopRect: 0/0 .. 1280/1024
2018-01-02 12:39:43,964**Lade 1
2018-01-02 12:40:16,770*1*----------------------------Starte Motor 1 Main-----------------------------
2018-01-02 12:40:16,770*1*Configured Engine 1 Type: Auto
2018-01-02 12:40:16,770*1*Engine 1 dir: C:\Users\NRL\Downloads\Python27
2018-01-02 12:40:16,770*1*Engine 1 commandline: C:\Users\NRL\Downloads\Python27\main.bat
2018-01-02 12:40:16,895*1*Child Process Prio Adj: PID 3396 python.exe
2018-01-02 12:40:16,895*1*Engine 1 ProcessID: 1936
2018-01-02 12:40:16,895*1*Engine 1 Prio:32 ThreadPrio:0
2018-01-02 12:40:16,895-->1:xboard
2018-01-02 12:40:16,926<--1:C:\Users\NRL\Downloads\Python27>python -u main.py
2018-01-02 12:40:16,926-->1:uci
2018-01-02 12:40:16,926<--1: Set TT size to 8388608 entries
2018-01-02 12:40:17,270<--1:id name Feeks
2018-01-02 12:40:17,270<--1:id author Folkert van Heusden <mail@vanheusden.com>
2018-01-02 12:40:17,270<--1:uciok
2018-01-02 12:40:17,270*1*Child Process Prio Adj: PID 3396 python.exe
2018-01-02 12:40:17,270-->1:isready
2018-01-02 12:40:17,316<--1:readyok
2018-01-02 12:40:27,987*1*Start calc, move no: 1
2018-01-02 12:40:27,987-->1:ucinewgame
2018-01-02 12:40:27,987-->1:isready
2018-01-02 12:40:27,987<--1:readyok
2018-01-02 12:40:28,002-->1:position startpos moves g1f3
2018-01-02 12:40:28,002-->1:go wtime 300000 btime 300000 winc 0 binc 0
2018-01-02 12:40:28,018<--1:info depth 1 score cp 110 time 16 nodes 22 pv e7e6
2018-01-02 12:40:28,143<--1:info depth 2 score cp 53 time 141 nodes 69 pv d7d5 b1c3
2018-01-02 12:40:28,486<--1:info depth 3 score cp 130 time 484 nodes 338 pv d7d5 f3e5
2018-01-02 12:40:28,923<--1:info depth 4 score cp 80 time 922 nodes 677 pv d7d5 f3e5
2018-01-02 12:40:32,542<--1:info depth 5 score cp 74 time 4540 nodes 3403 pv c7c6 d2d4
2018-01-02 12:40:38,922<--1:info depth 6 score cp 49 time 10920 nodes 8151 pv c7c6 f3d4
2018-01-02 12:40:57,486<--1:info depth 7 score cp 59 time 29484 nodes 22008 pv c7c6 d2d4
2018-01-02 12:41:48,920<--1:info depth 8 score cp 47 time 80918 nodes 59079 pv c7c6 b1c3 e7e6
2018-01-02 12:45:12,921<--1:info depth 9 score cp 34 time 284919 nodes 208062 pv c7c6 d2d4
2018-01-02 12:45:29,317-->1:stop
2018-01-02 12:53:07,312<--1:info depth 10 score cp 35 time 759310 nodes 539474 pv c7c6 b1c3 d8a5
2018-01-02 13:17:55,432<--1:info depth 11 score cp 35 time 2247430 nodes 1583165 pv e7e5


2018-01-02 12:39:43,620 Arena 3.5.1
2018-01-02 12:39:43,620Font Arena Chess Figurine MISSING

2018-01-02 12:39:43,839**----------Neue Partie---2018-01-02 12:39:43,839 Di -------------
2018-01-02 12:39:43,901**screen: 1280x1024
2018-01-02 12:39:43,901**Monitors: 1
2018-01-02 12:39:43,901**Monitor0: 1280x1024
2018-01-02 12:39:43,901**FormMonitor: 0
2018-01-02 12:39:43,901**DesktopRect: 0/0 .. 1280/1024
2018-01-02 12:39:43,964**Lade 1
2018-01-02 12:40:16,770*1*----------------------------Starte Motor 1 Main-----------------------------
2018-01-02 12:40:16,770*1*Configured Engine 1 Type: Auto
2018-01-02 12:40:16,770*1*Engine 1 dir: C:\Users\NRL\Downloads\Python27
2018-01-02 12:40:16,770*1*Engine 1 commandline: C:\Users\NRL\Downloads\Python27\main.bat
2018-01-02 12:40:16,895*1*Child Process Prio Adj: PID 3396 python.exe
2018-01-02 12:40:16,895*1*Engine 1 ProcessID: 1936
2018-01-02 12:40:16,895*1*Engine 1 Prio:32 ThreadPrio:0
2018-01-02 12:40:16,895-->1:xboard
2018-01-02 12:40:16,926<--1:C:\Users\NRL\Downloads\Python27>python -u main.py
2018-01-02 12:40:16,926-->1:uci
2018-01-02 12:40:16,926<--1: Set TT size to 8388608 entries
2018-01-02 12:40:17,270<--1:id name Feeks
2018-01-02 12:40:17,270<--1:id author Folkert van Heusden <mail@vanheusden.com>
2018-01-02 12:40:17,270<--1:uciok
2018-01-02 12:40:17,270*1*Child Process Prio Adj: PID 3396 python.exe
2018-01-02 12:40:17,270-->1:isready
2018-01-02 12:40:17,316<--1:readyok
2018-01-02 12:40:27,987*1*Start calc, move no: 1
2018-01-02 12:40:27,987-->1:ucinewgame
2018-01-02 12:40:27,987-->1:isready
2018-01-02 12:40:27,987<--1:readyok
2018-01-02 12:40:28,002-->1:position startpos moves g1f3
2018-01-02 12:40:28,002-->1:go wtime 300000 btime 300000 winc 0 binc 0
2018-01-02 12:40:28,018<--1:info depth 1 score cp 110 time 16 nodes 22 pv e7e6
2018-01-02 12:40:28,143<--1:info depth 2 score cp 53 time 141 nodes 69 pv d7d5 b1c3
2018-01-02 12:40:28,486<--1:info depth 3 score cp 130 time 484 nodes 338 pv d7d5 f3e5
2018-01-02 12:40:28,923<--1:info depth 4 score cp 80 time 922 nodes 677 pv d7d5 f3e5
2018-01-02 12:40:32,542<--1:info depth 5 score cp 74 time 4540 nodes 3403 pv c7c6 d2d4
2018-01-02 12:40:38,922<--1:info depth 6 score cp 49 time 10920 nodes 8151 pv c7c6 f3d4
2018-01-02 12:40:57,486<--1:info depth 7 score cp 59 time 29484 nodes 22008 pv c7c6 d2d4
2018-01-02 12:41:48,920<--1:info depth 8 score cp 47 time 80918 nodes 59079 pv c7c6 b1c3 e7e6
2018-01-02 12:45:12,921<--1:info depth 9 score cp 34 time 284919 nodes 208062 pv c7c6 d2d4
2018-01-02 12:45:29,317-->1:stop
2018-01-02 12:53:07,312<--1:info depth 10 score cp 35 time 759310 nodes 539474 pv c7c6 b1c3 d8a5
2018-01-02 13:17:55,432<--1:info depth 11 score cp 35 time 2247430 nodes 1583165 pv e7e5
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: feeks

Post by Guenther »

flok wrote:Hi,

That winc/binc issue should be fixed in the next version.

Which version did you try in the last post? Mon Jan 1 19:52:40 2018 +0100?
I downloaded the github master (zip) last night and the files all had
the timestamp

Code: Select all

&#8206;1. &#8206;Januar &#8206;2018, &#8207;&#8206;11&#58;12&#58;42
Right now I verified that a current download still gives the same timestamp for all files in the master.
flok wrote: Did you see any blunders?
May be a few less but still very significant ones as in your newest example.
7. Nf4?? there again blunders a N for nothing with a positive score of 0.60.

[Event "Computer Chess Game"]
[Site "lenovo"]
[Date "2018.01.02"]
[Round "-"]
[White "Feeks"]
[Black "GNU Chess"]
[Result "*"]
[TimeControl "40/300"]
[Annotator "1. +0.40 1... -0.15"]

1. e4 {+0.40/7} e5 {-0.15/13 16} 2. Qh5 {+0.32/8 18} Nc6 {+0.47/13 9} 3.
Bc4 {+0.88/7 11} g6 {+0.31/13 2.3} 4. Qf3 {-0.12/8 14} Nf6 {+0.45/12 8} 5.
Ne2 {+1.01/7 16} Na5 {+0.36/12 0.1} 6. Qd3 {+0.90/7 11} c6 {+1.12/12 8} 7.
Nf4??? {+0.31/6 14}
exf4 {+3.56/12 11} *

flok wrote:
There were tons of issues in the version from which I posted a game. null move broken, psq broken, aspiration window broken, time management broken.
In the game vs. Youk I showed it ignored a double attack on f2 with check
and played 6. d3?? (depth 3 though) and after 6... Qxf2+ the game was over.
Feeks creates a nice debug dat file: (the blunder part)

Code: Select all

Mon Jan  1 22&#58;45&#58;22 2018 position startpos moves e2e4 e7e5 d1h5 d8f6 f1b5 c7c6 b5c4 d7d5 e4d5 f8c5
Mon Jan  1 22&#58;45&#58;22 2018 go wtime 145510 btime 128680 winc 2000 binc 2000
Mon Jan  1 22&#58;45&#58;22 2018 mtg 34, ms 145.510000, ti 2.000000
Mon Jan  1 22&#58;45&#58;22 2018 search for 9.700667 seconds
Mon Jan  1 22&#58;45&#58;22 2018 rnb1k1nr/pp3ppp/2p2q2/2bPp2Q/2B5/8/PPPP1PPP/RNB1K1NR w KQkq - 1 6
Mon Jan  1 22&#58;45&#58;23 2018 depth 1 score cp 117 time 287 nodes 111 pv b1c3
Mon Jan  1 22&#58;45&#58;24 2018 depth 2 score cp 67 time 1160 nodes 461 pv a2a4
Mon Jan  1 22&#58;45&#58;28 2018 depth 3 score cp 111 time 6023 nodes 2416 pv d2d3
Mon Jan  1 22&#58;45&#58;28 2018 <LegalMoveGenerator at 0x2b15ac8 &#40;Qxh7, Qxf7+, Qh6, Qg6, Qg5, Qf5, Qxe5+, Qh4, Qg4, Qh3, Qf3, Qe2, Qd1, Ba6, Bb5, Bd3, Bb3, Be2, Bf1, Nh3, Nf3, Ne2, Ke2, Kf1, Kd1, Nc3, Na3, dxc6, d6, h3, g3, f3, d3, c3, b3, a3, h4, g4, f4, d4, b4, a4&#41;>
Mon Jan  1 22&#58;45&#58;28 2018 &#91;111.25, Move.from_uci&#40;'d2d3'), 3, 6.022000074386597&#93;
Mon Jan  1 22&#58;45&#58;28 2018 nps&#58; 400.862787, nodes&#58; 2416, tt_hits&#58; 3.370787%
Mon Jan  1 22&#58;45&#58;33 2018 position startpos moves e2e4 e7e5 d1h5 d8f6 f1b5 c7c6 b5c4 d7d5 e4d5 f8c5 d2d3 f6f2
Mon Jan  1 22&#58;45&#58;33 2018 go wtime 141480 btime 126280 winc 2000 binc 2000
Mon Jan  1 22&#58;45&#58;33 2018 mtg 33, ms 141.480000, ti 2.000000
Mon Jan  1 22&#58;45&#58;33 2018 search for 9.432000 seconds
Mon Jan  1 22&#58;45&#58;33 2018 rnb1k1nr/pp3ppp/2p5/2bPp2Q/2B5/3P4/PPP2qPP/RNB1K1NR w KQkq - 0 7
Mon Jan  1 22&#58;45&#58;33 2018 depth 1 score cp -92 time 40 nodes 18 pv e1d1
Mon Jan  1 22&#58;45&#58;33 2018 depth 2 score cp -220 time 427 nodes 182 pv e1d1 f2f1
Mon Jan  1 22&#58;45&#58;37 2018 depth 3 score cp -465 time 4415 nodes 2012 pv e1d1 f2f1 d1d2
Mon Jan  1 22&#58;45&#58;40 2018 depth 4 score cp -465 time 6905 nodes 3219 pv e1d1 f2f1 d1d2
Mon Jan  1 22&#58;45&#58;40 2018 <LegalMoveGenerator at 0x2b17128 &#40;Kd1&#41;>
Mon Jan  1 22&#58;45&#58;40 2018 &#91;-465.0, Move.from_uci&#40;'e1d1'), 4, 6.9040000438690186&#93;
Mon Jan  1 22&#58;45&#58;40 2018 nps&#58; 465.981455, nodes&#58; 3219, tt_hits&#58; 14.754098%
https://rwbc-chess.de

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

Re: feeks

Post by Guenther »

Congrats you killed that thread with tons of white space ;-)
BTW you should use the code tags too... (and preview)

This thread cannot be followed anymore in 'flat' mode, you should consider
deleting the message and reformat it.
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy