Skip to content

Commit

Permalink
v2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gekomad committed May 23, 2021
1 parent 03711f7 commit 87c8734
Show file tree
Hide file tree
Showing 116 changed files with 23,711 additions and 5,469 deletions.
59 changes: 34 additions & 25 deletions README.md
Expand Up @@ -2,39 +2,38 @@ Cinnamon
==========
### UCI Chess Engine

- [Play on line](https://gekomad.github.io/Cinnamon/)

Cinnamon is a chess program for Windows, Linux, Mac OS, Android and Raspberry Pi, is a console-based chess engine for use with [xboard][4], [Arena][5], [Tarrasch][6], [Droidfish][7] or any UCI-compatible GUI. Cinnamon is also a javascript library to play with [chessboardjs][8] or any js GUI.

- [Play on line](https://gekomad.github.io/Cinnamon/)

Version
----------
2.3.4
2.4

News
----------
- Chess 960
- Killer heuristics
- Improved move ordering
- Improved Gaviota Tablebase search
- Syzygy Tablebases
- BMI2 Instructions
- Bug fix in enpassant
- Bug fix parallel perft
- Reverse Futility Pruning
- Stalemate improvement
- Trasposition Table improvement
- Bug fix in castle
- Bug fix in en passant
- Speeded up Perft
- Compilable with MS Visual Studio

Useful links
----------
- [Bitboard Calculator](https://gekomad.github.io/Cinnamon/BitboardCalculator/)
- [C++ thread pool](https://github.com/gekomad/BlockingThreadPool)
- [Auriga Distributed Perft](https://github.com/gekomad/Auriga)
- [Web Eval debugger](https://github.com/gekomad/chess-engine-eval-debugger)
- [Android App](https://play.google.com/store/apps/details?id=com.github.gekomad.cinnamonengine)
- [Cinnamon on Android](https://play.google.com/store/apps/details?id=com.github.gekomad.cinnamonengine)
- [Cinnamon on DGT Pi](https://www.digitalgametechnology.com/index.php/products/revelation-ii/533-dgt-pi-chess-computer-for-dgt-e-boards)
- [Clion IDE](https://www.jetbrains.com/?from=CINNAMON_CHESS_ENGINE)


Features
----------

- [Elo ratings][3]
- Available for both Unix, Windows, Mac, Android, ARM and Javascript
- UCI protocol
- GPL 3 License
Expand All @@ -44,6 +43,7 @@ Features
- Rotated bitboards
- Null moves
- Futility pruning
- Reverse Futility Pruning
- Delta pruning
- Razoring
- Interruptible multithread Perft test [standard][9] and [chess960][10]
Expand All @@ -53,14 +53,12 @@ Features
- Killer heuristics
- Lazy evaluation
- MVV/LVA
- Two-tier Transposition Table
- Transposition Table
- Aspiration Windows
- Late Move Reduction
- Ponder
- Open Book (Polyglot)
- Gaviota Tablebases
- Syzygy Tablebases
- [Elo ratings][3]

Binaries
----------
Expand All @@ -71,35 +69,45 @@ All files are compiled statically, no further libraries are necessary.
Command line tools
----------
#### Perft
`cinnamon -perft [-d depth] [-c nCpu] [-h hash size (mb) [-F dump file]] [-Chess960] [-f "fen position"] `
`cinnamon.exe -perft [-d depth] [-c nCpu] [-h hash size (mb) [-F dump file]] [-Chess960] [-f "fen position"] `

Setting `-F` and `-h` you can stop (Ctrl-c) and restart the perft process.


#### Gaviota DTM (distance to mate)

`cinnamon -dtm-gtb -f "fen position" -p path`
`cinnamon.exe -dtm-gtb -f "fen position" -p path`

#### Gaviota WDL (win/draw/loss)

`cinnamon -wdl-gtb -f "fen position" -p path`
`cinnamon.exe -wdl-gtb -f "fen position" -p path`

#### SYZYFY DTZ (distance to zero)

`cinnamon -dtz-syzygy -f "fen position" -p path`
`cinnamon.exe -dtz-syzygy -f "fen position" -p path`

#### SYZYFY WDL (win/draw/loss)

`cinnamon -wdl-syzygy -f "fen position" -p path`
`cinnamon.exe -wdl-syzygy -f "fen position" -p path`

#### EPD generator
`cinnamon -puzzle_epd -t K?K?`
example: `cinnamon -puzzle_epd -t KRKP`
`cinnamon.exe -puzzle_epd -t K?K?`

example: `cinnamon.exe -puzzle_epd -t KRRKPN`

Compiling
---------

Cinnamon requires C++11 or greater, use unique Makefile to compile for many architectures:
Cinnamon requires C++11 or greater

- use MS Visual Studio (cinnamon.vcxproj)

- use cmake (CMakeLists.txt)

- use make - unique Makefile to compile for many architectures:


```
$ make
Expand All @@ -126,6 +134,7 @@ Cinnamon requires C++11 or greater, use unique Makefile to compile for many arch
g++ is the default compiler, add COMP=yourcompiler to use another compiler
example: make cinnamon64-modern-INTEL COMP=clang++
```

License
-------
Expand All @@ -146,4 +155,4 @@ Cinnamon was written by Giuseppe Cannella at gmail dot com.
[8]: https://chessboardjs.com
[9]: https://gekomad.github.io/Cinnamon/perft.html
[10]: https://www.chessprogramming.org/Chess960_Perft_Results
[11]: https://gekomad.github.io/Cinnamon/

61 changes: 47 additions & 14 deletions src/CMakeLists.txt
@@ -1,38 +1,70 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
project(cinnamon_debug)

# debug
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -Wno-braced-scalar-init -mbmi2 -DUSE_BMI2 -DBENCH_MODE -fno-omit-frame-pointer -g -pthread -pedantic -std=c++11 -DDLOG_LEVEL=_TRACE -DDEBUG_MODE -fsigned-char -fno-exceptions -fno-rtti -funroll-loops -msse4.2 -DHAS_POPCNT -mpopcnt -msse3 -DHAS_BSF -DHAS_64BIT -m64 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-braced-scalar-init -fsanitize=address -mbmi2 -DUSE_BMI2 -g -DDEBUG_MODE -pthread -Wall -Wpedantic -W -std=c++11 -DDLOG_LEVEL=_TRACE -funroll-loops -msse4.2 -DHAS_POPCNT -mpopcnt -msse3 -DHAS_BSF -m64 ")

# bench
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-braced-scalar-init -mbmi2 -DUSE_BMI2 -pthread -pedantic -DBENCH_MODE -std=c++11 -DDLOG_LEVEL=_FATAL -Wall -Ofast -DNDEBUG -fsigned-char -fno-exceptions -fno-rtti -funroll-loops -msse4.2 -DHAS_POPCNT -mpopcnt -msse3 -DHAS_BSF -DHAS_64BIT -m64 ")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-braced-scalar-init -mbmi2 -DUSE_BMI2 -pthread -Wpedantic -W -DBENCH_MODE -std=c++11 -DDLOG_LEVEL=_FATAL -Wall -O3 -DNDEBUG -funroll-loops -msse4.2 -DHAS_POPCNT -mpopcnt -msse3 -DHAS_BSF -m64 ")

# unit test
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-braced-scalar-init -fsanitize=address -fno-omit-frame-pointer -g -pthread -pedantic -std=c++11 -DDLOG_LEVEL=_TRACE -DFULL_TEST -DDEBUG_MODE -fsigned-char -fno-exceptions -fno-rtti -funroll-loops -msse4.2 -DHAS_POPCNT -mpopcnt -msse3 -DHAS_BSF -DHAS_64BIT -m64 ")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-braced-scalar-init -fsanitize=address -g -pthread -Wall -Wpedantic -W -std=c++11 -DDLOG_LEVEL=_TRACE -DFULL_TEST -DDEBUG_MODE -funroll-loops -msse4.2 -DHAS_POPCNT -mpopcnt -msse3 -DHAS_BSF -m64 ")

set(SOURCE_FILES
# tuning
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-braced-scalar-init -mbmi2 -DUSE_BMI2 -O3 -pthread -Wall -Wpedantic -W -std=c++11 -DTUNING -DNDEBUG -DDLOG_LEVEL=_FATAL -funroll-loops -msse4.2 -DHAS_POPCNT -mpopcnt -msse3 -DHAS_BSF -m64 ")

lib/gtb-probe.h
include_directories(db/gtb)
include_directories(db/gtb/compression)
include_directories(db/gtb/compression/lzma)
include_directories(db/gtb/sysport)

set(SOURCE_FILES
namespaces/constants.h
namespaces/debug.h
namespaces/bits.h
namespaces/random.h
namespaces/see.h
namespaces/board.h
namespaces/board.cpp
perft/_TPerftRes.h
perft/Perft.cpp
perft/Perft.h
db/OpenBook.cpp
db/OpenBook.h
db/syzygy/SYZYGY.h
db/syzygy/SYZYGY.cpp
db/syzygy/tbprobe.c
db/gaviota/GTB.h
db/gaviota/GTB.cpp
db/gaviota/gtb/compression/lzma/Alloc.c
db/gaviota/gtb/compression/lzma/Alloc.h
db/gaviota/gtb/compression/lzma/Bra.h
db/gaviota/gtb/compression/lzma/Bra86.c
db/gaviota/gtb/compression/lzma/LzFind.c
db/gaviota/gtb/compression/lzma/LzFind.h
db/gaviota/gtb/compression/lzma/LzFindMt.h
db/gaviota/gtb/compression/lzma/LzHash.h
db/gaviota/gtb/compression/lzma/Lzma86Dec.c
db/gaviota/gtb/compression/lzma/Lzma86Dec.h
db/gaviota/gtb/compression/lzma/Lzma86Enc.c
db/gaviota/gtb/compression/lzma/Lzma86Enc.h
db/gaviota/gtb/compression/lzma/LzmaDec.c
db/gaviota/gtb/compression/lzma/LzmaDec.h
db/gaviota/gtb/compression/lzma/LzmaEnc.c
db/gaviota/gtb/compression/lzma/LzmaEnc.h
db/gaviota/gtb/compression/lzma/Types.h
db/gaviota/gtb/compression/wrap.c
db/gaviota/gtb/compression/wrap.h
db/gaviota/gtb/sysport/sysport.c
db/gaviota/gtb/sysport/sysport.h
db/gaviota/gtb/gtb-att.c
db/gaviota/gtb/gtb-att.h
db/gaviota/gtb/gtb-dec.c
db/gaviota/gtb/gtb-dec.h
db/gaviota/gtb/gtb-probe.c
db/gaviota/gtb/gtb-probe.h
db/gaviota/gtb/gtb-types.h
db/gaviota/gtb/version.h
perft/PerftThread.cpp
perft/PerftThread.h
test/test.cpp
threadPool/Mutex.h
threadPool/ObserverThread.h
threadPool/Spinlock.h
threadPool/Thread.h
Expand All @@ -45,11 +77,10 @@ set(SOURCE_FILES
util/IniFile.h
util/logger.h
util/Singleton.h
util/String.cpp
util/String.h
util/bench/Time.h
util/Timer.cpp
util/Timer.h
util/getopt.h
ChessBoard.cpp
ChessBoard.h
Eval.cpp
Expand All @@ -66,9 +97,11 @@ set(SOURCE_FILES
SearchManager.cpp
SearchManager.h
Uci.cpp
Uci.h)
Uci.h
unistd.h
)

set(CMAKE_CXX_COMPILER "clang++")
add_executable(cinnamon_debug ${SOURCE_FILES})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
target_link_libraries(cinnamon_debug ${CMAKE_SOURCE_DIR}/lib/Linux/64/libgtb.a /usr/lib/libgtest.a)
target_link_libraries(cinnamon_debug /usr/lib/libgtest.a)

0 comments on commit 87c8734

Please sign in to comment.