GithubHelp home page GithubHelp logo

xiphos's Introduction

Xiphos

Overview

Xiphos is a classical alpha-beta chess engine with a handcrafted evaluation function. The project is inspired by Garry Kasparov's "Deep Thinking". This fantastic book has evoked my childhood passion, computer chess. I was wondering how hard it could be to develop an engine strong enough to surpass the legendary Deep Blue, so I gave it a try.

The latest release, including the binaries for various platforms, can be found here.

Performance

CCRL 40/15: 3300+ ELO (4CPU), peak ranking 5th (Dec 2019)

Acknowledgements

I would like to thank the authors and the community involved in the creation of the open source projects listed below. Their work greatly inspired me, and without them, this project wouldn't exist.

xiphos's People

Contributors

ghotrix avatar kdave avatar milostatarevic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xiphos's Issues

macOS: go movetime issue

I compiled Xiphos on my mac an ran some tests. At the 1500 STS positions Xiphos 0.5 reached a much lower solving rate than expected.

The log file shows, that after receiving go movetime 193 (msec) Xiphos finished all positions in 43..45 (msec)!

Is this an macOS issue?

Starting engine /Users/max/chess/Xiphos/xiphos-0.5 ...
>> uci
<< Xiphos 0.5 BMI2 by Milos Tatarevic
<< threads=1
<< hash=128MB
<< id name Xiphos 0.5 BMI2
<< id author Milos Tatarevic
<< option name Hash type spin default 128 min 1 max 32768
<< option name Threads type spin default 1 min 1 max 128
<< option name Ponder type check default false
<< option name SyzygyPath type string default <empty>
<< option name SyzygyProbeDepth type spin default 1 min 1 max 100
<< uciok
>> setoption name Hash value 128
>> setoption name Contempt value 0
>> setoption name Threads value 1
>> setoption name Cores value 1
>> setoption name Max CPUs value 1

Pos 1
1kr5/3n4/q3p2p/p2n2p1/PppB1P2/5BP1/1P2Q2P/3R2K1 w - - bm f5; id "STS(v1.0) Undermine.001"; c0 "f5=10, Be5+=2, Bf2=3, Bg4=2"; c7 "f5 Be5+ Bf2 Bg4"; c8 "10 2 3 2"; c9 "f4f5 d4e5 d4f2 f3g4";

2019-07-11T13:41:21.615597 >> isready
2019-07-11T13:41:21.621338 << hash=128MB
2019-07-11T13:41:21.621606 << threads=1
2019-07-11T13:41:21.621630 << readyok
2019-07-11T13:41:21.621658 >> ucinewgame
2019-07-11T13:41:21.621672 >> position fen 1kr5/3n4/q3p2p/p2n2p1/PppB1P2/5BP1/1P2Q2P/3R2K1 w - - 0 1
2019-07-11T13:41:21.621695 >> go movetime 193
2019-07-11T13:41:21.632647 << info depth 1 score cp 55 nodes 189 tbhits 0 time 1 nps 94500 pv f3g4
2019-07-11T13:41:21.632791 << info depth 2 score cp 106 nodes 302 tbhits 0 time 1 nps 151000 pv e2g2 g5f4
2019-07-11T13:41:21.632910 << info depth 3 score cp 106 nodes 362 tbhits 0 time 1 nps 181000 pv e2g2 g5f4 f3d5
2019-07-11T13:41:21.633039 << info depth 4 score cp 106 nodes 423 tbhits 0 time 1 nps 211500 pv e2g2 g5f4 f3d5 e6d5
2019-07-11T13:41:21.633635 << info depth 5 score cp 39 nodes 1008 tbhits 0 time 2 nps 336000 pv d1e1 g5f4 e2e6 a6e6 e1e6
2019-07-11T13:41:21.634122 << info depth 6 score cp 120 nodes 1376 tbhits 0 time 2 nps 458666 pv d1e1 d5c7 e1c1 g5f4 c1c4 f4g3
2019-07-11T13:41:21.635202 << info depth 7 score cp 120 nodes 1856 tbhits 0 time 3 nps 464000 pv d1e1 d5c7 e1c1 g5f4 c1c4 f4g3 h2g3
2019-07-11T13:41:21.637107 << info depth 8 score cp 80 nodes 4129 tbhits 0 time 5 nps 688166 pv d1e1 d5c7 e1c1 c7d5 f4f5 d5c7 c1c4 e6f5
2019-07-11T13:41:21.640855 << info depth 9 score cp 117 nodes 9596 tbhits 0 time 9 nps 959600 pv f4g5 h6g5 f3g4 d5c7 d1c1 c4c3 e2a6 c7a6 b2c3 b4c3
2019-07-11T13:41:21.641146 << info depth 10 score cp 117 nodes 10068 tbhits 0 time 9 nps 1006800 pv f4g5 h6g5 f3g4 d5c7 d1c1 c4c3 e2a6 c7a6 b2c3 b4c3
2019-07-11T13:41:21.655614 << info depth 11 score cp 117 nodes 32284 tbhits 0 time 24 nps 1291360 pv f4g5 h6g5 f3g4 c8e8 d1c1 b4b3 g4h3 b8a8 h3f1 a8b7 f1g2 e8f8 c1c4
2019-07-11T13:41:21.659276 << info depth 12 score cp 117 nodes 36777 tbhits 0 time 27 nps 1313464 pv f4g5 h6g5 f3g4 c8e8 d1c1 b4b3 g4h3 b8a8 h3f1 a8b7 f1g2 e8f8
2019-07-11T13:41:21.676137 << info depth 13 score cp 127 nodes 64367 tbhits 0 time 44 nps 1430377 pv f4g5 h6g5 f3d5 e6d5 d4e5 b8a8 d1d5 d7b8 e5b8 a6b6 g1g2 b6c6 e2f3 a8b8 d5a5 c6f3
2019-07-11T13:41:21.678720 << bestmove f4g5 ponder h6g5
Engine best move is not one of the solution moves??

Total points for this theme so far : 0/10

Phase calculation

There are a couple of issues with phase calculation, although I'm not sure they have an impact on Elo.

First one is when you set up a position in which there is more material than in the initial position (for example, because a promotion took place very early in the game, before there was any capture). In this case, phase would go negative if it wasn't for the check at the end of set_phase(), so that phase is always 0. This seems all OK, but the problem is that when you make a move that captures the promoted piece, phase will be updated with the value of the captured piece (a queen probably). The new value of phase will not match the one that it would have if you directly set up the position after the capture, so evaluation will differ.

I admit that such positions are rare anyway.

There is also the problem of how to update phase in make_move. Currently, it is only updated when there is a piece in the destination square. This doesn't take into account en passant captures or promotions. Both of these cases should be taken care of. The first one will obviously have no effect, since piece_phase[PAWN] == 0, but it would be good practice to deal with it in case that value changes in the future. The second case may have a measurable impact on strength, although I'm not really sure.

Also, keep in mind that subtracting the promotion piece from phase may make it go negative, like if you set up the start position and in the search, you follow a line that reaches a promotion before making any capture (which is the first case I mentioned).

An alternative could be to redefine phase as 0 when there are only 2 kings (ending) and the corresponding value in the opening, which would be the result of adding all the pieces. This would be the inverse of how it is done now, and there would be no problem with negative values, as there would be none.

new version to come ?

will there ever be a new version of Xiphos ? The engine is still very high in the CCRL list, but it's only version 0.6, not 1.0 .. and it does not use a NN !? So its concept must be great !

Reports incorrect mate scores

Solves "mate in" problems nicely, but reports the incorrect solution.
Mate in 10 problems are usually reported as M09, for example even if the PV shows a mate in 10.
Here is an example...a very easy problem for all engines
7K/P1p1p1p1/2P1P1Pk/6pP/3p2P1/1P6/3P4/8 w - - 2 1

Xiphos for android

Hi.You can make the source code under Unix ?Then I could port the engine to Android(many ask).
Thanks.

Misc. UCI output should use "info"

Running the engine under python-chess produces the error:
<UciProtocol (pid=8848)>: Unexpected engine output: hash=16384MB

Output to the UCI driver that isn't a standard UCI command should be preceded by "info". For example:
_p("hash=%"PRIu64"MB\n", allocated_memory >> 20);
in uci.cpp should be:
_p("info hash=%"PRIu64"MB\n", allocated_memory >> 20);

Question

Good day. I would like to ask such a question. According to the statistics of large numbers, a sufficiently large sample can give fairly accurate results.
What is meant. Usually the standard chess program uses pst tables of 64 cells.
This allows the program to work quickly enough, replacing the table pst in the combination table 2-3 or more figures, we lose speed but increase the statistical sample, i.e. create a pseudo neural network. I would like to ask how you think this approach has a place or a slowdown of the program due to the use of the combination tables instead of pst will not have more positive effect !?

There is also the assumption that it is possible to use separate pst tables for mobility, i.e.
table 8x8 for fields attacked by a particular figure or more extended Mobility table [count attacked squares][current square] can be useful.

Thanks.

(almost) full uci support

hello Milos,

can y consider to do more uci commands. Basically im missing the following:

  • stop
  • go infinite
  • go searchmoves

an extra plus would also be:

  • go ponder
  • ponderhit

"stop" & "infinite" shouldnt be too hard (and y said already y want to implement stop), "searchmoves" i would need for "alternative move" function in picochess. Thanks for consideration!

Jürgen

Xiphos 0.3 does not stop

hi, i compiled your Xiphos 0.3 on Ubuntu 18.04 64-bit and i have some problems with it .. it runs, but does not do "go infinite" : it immediately comes up with a "best move" .. running it with "go movetime #" or "go depth #" works, but it can not be cancelled : it does not react to the stop command : it should cancel its calculations and give its best move so far ..

draw detection

In search.c in the function draw() at line 78 it returns draw if the fifty move counter is >=100 but is not always true because with fifty move counter = 100 there could also be a checkmate.

Abandoning found mate when reaching TB position

When Xiphos is set up to play with TB and reaches a won TB position, it starts just doing the shortest DTZ moves (often pawn pushes), instead of trying to do the quickest mate.

This is especially weird when e.g. Xiphos finds a mate in 4, a capture occurs, and then instead of doing the announced mate in 4 which it had already found, Xiphos will start doing pawn pushes and take 12 moves to mate.

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.