GithubHelp home page GithubHelp logo

mdoege / pyturochamp Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 3.0 3.05 MB

Python implementations of early chess engines including TUROCHAMP

Home Page: https://mdoege.github.io/PyTuroChamp/

Shell 0.80% Python 99.05% Batchfile 0.15%
python chess python-chess turochamp turing chess-engines xboard chess960 chess-ai chess-engine

pyturochamp's People

Contributors

mdoege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pyturochamp's Issues

Newt error

hi, i use your engines in CuteChess and some run fine, but i have questions. I like to use Newt, while it seems to have time management, but after some moves it fails with an error .. i also ran Newt in terminal, using its default options (and turning off the opening book) .. doing go infinite in the start position gives this error :
[ the same happens when i use python3 instead of pypy3 ]

$ pypy3 ptc_xboard.py newt
uci
id name Newt
id author Martin C. Doege
option name depth type spin default 4 min 0 max 1024
option name qplies type spin default 6 min 0 max 1024
option name pstab type spin default 1 min 0 max 1024
option name maxnodes type spin default 1000000 min 0 max 1000000000
option name usebook type check default true
option name matetest type check default true
option name UCI_Chess960 type check default false
uciok
ucinewgame
setoption name usebook value false
# usebook: False
go infinite
info depth 1 score cp 5 time 405 nodes 107 pv g1f3
info depth 2 score cp 0 time 644 nodes 190 pv b1c3 g8f6
info depth 3 score cp 5 time 1304 nodes 782 pv b1c3 g8f6 g1f3
info depth 4 score cp 0 time 2652 nodes 2246 pv g1f3 g8f6 b1c3 b8c6
info depth 5 score cp 4 time 5350 nodes 16414 pv g1f3 g8f6 b1c3 b8c6 e2e4
info depth 6 score cp 0 time 10842 nodes 57226 pv g1f3 g8f6 b1c3 b8c6 e2e4 e7e5
info depth 7 score cp 4 time 86493 nodes 717438 pv g1f3 g8f6 b1c3 b8c6 e2e4 e7e5 d2d4
Traceback (most recent call last):
  File "ptc_xboard.py", line 381, in <module>
    t, r = p.getmove(d, silent = True)
  File "/home/roelof/Apps/ChessEngines/TuroChamp/PyTuroChamp/newt.py", line 262, in getmove
    t, newPV = searchmax(b.copy(), MAXPLIES, aa, ab)
  File "/home/roelof/Apps/ChessEngines/TuroChamp/PyTuroChamp/newt.py", line 108, in searchmax
    t, vv = searchmax(b, ply - 1, -beta, -alpha)
  File "/home/roelof/Apps/ChessEngines/TuroChamp/PyTuroChamp/newt.py", line 108, in searchmax
    t, vv = searchmax(b, ply - 1, -beta, -alpha)
  File "/home/roelof/Apps/ChessEngines/TuroChamp/PyTuroChamp/newt.py", line 108, in searchmax
    t, vv = searchmax(b, ply - 1, -beta, -alpha)
  [Previous line repeated 1 more time]
  File "/home/roelof/Apps/ChessEngines/TuroChamp/PyTuroChamp/newt.py", line 106, in searchmax
    b.push(x)
  File "/home/roelof/.local/lib/pypy3.8/site-packages/chess/__init__.py", line 2216, in push
    assert piece_type is not None, f"push() expects move to be pseudo-legal, but got {move} in {self.board_fen()}"
AssertionError: push() expects move to be pseudo-legal, but got d2d4 in rnbqkb1r/ppp1pppp/7n/8/3Pp3/2N2N2/PPP2PPP/R1BQKB1R

i want to experiment with your code, eg. changing the parameters, but i also enounter problems with Bare.
i'm familiar with Python and i read your doc :

Newt on the other hand counts plies normally from the root position, so maxplies and qplies should be even numbers.

At first this was something i missed .. setting different parameter values in CuteChess settings .. Note: i guess maxplies is wrong here - you mean depth ? because the Newt UCI info shows that option name ..

do you still work on the project ?
maybe some bugs can be fixed easily ?
or should go infinite not be used ?

[ i use a modern avx2 notebook on Xubuntu 22.04 ]

some unclear options

lately i examined your PyTuroChamp code (again), trying to set optimal options regarding time management : it seems your python code does not have this, so setting a MAXPLIES higher then 3 can result -in some positions- in a thinking time of more than 60 seconds per move, which often makes the engine run out of time when playing in CuteChess -- i use 15 minutes per player per game and i QPLIES = MAXPLIES + 6 (=9) .. the addition of 6 is given in your original script, so i left it that way.

i'm familiar with Python and i can read and adjust your script .. i'm thinking about developing a script part which does simple time management : create some 'dynamic' [#] MAXPLIES, depending on the time left (say for 30 moves) and the amount of ply done : i imagine when enough time is left, the script can do (1) more ply. But first i wanted to test several option settings and get a better understanding of your script. I succeeded to run the multi version, using ptc_worker.py (i'm on Linux Xubuntu 22.04).

i have a question about the value of the PSTAB option : your script uses '0.5', but the UCI options list shows a max value 1024 !? And setting '0.5' in the CuteChess settings pane is impossible, only integers are allowed there !?

last thing for now : what does PDEAD do ?
i see PDEAD = 1, with info version of dead position eval but what does that mean ? And which other values can be used ?

Original Bernstein Chess Program

Hi thanks for sharing these engines. I'm curious how you were able to implement the Bernstein program, did you have original source or a tape copy to work from?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.