2024.9.7: silkfish is now a Lichess Bot 🤖 on lichess.org! View its profile.
TODOs
- Null move pruning.
- Transposition table.
silkfish engine is written in c++, so you do need a g++
compiler to compile it.
To compile, run the following command at the current directory,
make
This should give you an executable silkfish
at the current directory, being the engine itself ✌
You can interact with silkfish engine with a commandline GUI written in Python3. However, you do need to install some libraries first, run the following command at the current directory if you use pip3 to install Python3 libraries,
pip3 install -r gui_requirements.txt
If you haven't compiled the engine, you need to compile it following the "Compile the Engine" section!!
Now, with the compiled engine (silkfish
executable) and the installed Python3 libraries, you can run the following command at the current directory to enjoy interacting with the engine! 🍺
python3 gui.py
This is how the command line GUI looks like:
After compilation, you can use the engine without a GUI, you should execute the engine in the following format.
./silkfish <flag1> <option1> <flag2> <option2> ... <-fen> {fen_string}
There're three main ways of using the engine.
- You pass in a
-demo
flag to make the engine play a full game with itself. - You don't pass the
-demo
flag, so the engine will expect you to pass a-fen
flag followed by afen_string
at the very end of your command, and the engine will output the evaluation for this FEN position, as well as the best move. - You pass No argument at all, this will give you an UCI engine!
Following are some examples of using the engine, with explanations,
./silkfish -demo # This will start a full game played by engine with itself, using all default parameters.
./silkfish -md 5 -demo 43 -m # This will start a full game played by engine with itself, using minimax_depth=5, with output muted for each move.
./silkfish -qd 3 -md 5 -fen 4k3/8/6K1/8/3Q4/8/8/8 w - - 0 1 # This will make the engine evaluate the position, output a evaluation and a best move.
./silkfish -md 5 -qd 3 -fen 4k3/8/6K1/8/3Q4/8/8/8 w - - 0 1 # This will make the engine evaluate the position, output a evaluation and a best move.
./silkfish # This will run the engine in UCI mode
Flags are passed with options following them (if there should be an option). The order of the flags doesn't matter, expect that -fen
flag and the fen_string
needs to be put at the very end of the command.
-m
: mute the output of engine (expect the final results).-md
: followed by an intdepth
, being the depth of the minimax search.-qd
: followed by an intdepth
, being the depth of the quiescence search.-demo
: demo mode, the engine will play a full game with itself.-fen
: followed by a string of FEN, it should by placed at the very end! used when-demo
flag is NOT set.
This is a test containing 111 positions, each position is expected to be solved in 15 seconds. Run it with
python3 test_eret.py
Below is a result table of silkfish
on the ERET test.
Commit Hash | Position Passed (out of 111) | Pass Rate | Date |
---|---|---|---|
93f488c | 13 (without time limit) | 11.71% | 2024.9.6 |
aa7f91f | 11 | 9.91% | 2024.9.7 |
0c1a8a5 | 15 (without time limit) | 13.51% | 2024.9.15 |