healeycodes / andoma

♟️ A chess engine with alpha-beta pruning, piece-square tables, move ordering, and command-line UI.
https://healeycodes.com/building-my-own-chess-engine/
MIT License
149 stars 26 forks source link

Andoma in CuteChess : default low depth ? #22

Open tissatussa opened 3 years ago

tissatussa commented 3 years ago

hi, since your Andoma works in my CuteChess, i played some games with it .. i know, it's just a simple UCI engine, it even gives pieces for no reason now and then .. nevermind .. i guess your python code is also meant to experiment .. so, i have some questions.

in CuteChess, Andoma plays always very fast, within a second, whatever the time setting .. is this a bug ? Or does it just have a max depth ? The CuteChess settings pane for Andoma is empty ..

in the CuteChess info window, besides the spent thinking time also the eval value could be shown ? I guess this value is somewhere in the code for deciding "best move" ?

and those files in /test : how to use / include them ?

healeycodes commented 3 years ago

Hi!

I'll do my best to answer these but a "headline update" would be that Andoma continues to only support ShailChoksi/lichess-bot and the command-line UI (ui.py). Debug information and configuration options are minimal compared to a full UCI engine. I changed the README to hopefully be more clear about this in https://github.com/healeycodes/andoma/commit/0863acb98e0ba55f3edc9e1ca80ad11c25264e47

There is work underway to support more GUIs (this is achieved by implementing more of the UCI spec) and PRs are very welcome!


in CuteChess, Andoma plays always very fast, within a second, whatever the time setting .. is this a bug ?

Andoma doesn't accept a time configuration option at the moment. In general, it supports a thin slice of the UCI interface. The default depth (configurable via command-line argument) is 3. Looking only 3 moves ahead can lead to oddities.

in the CuteChess info window, besides the spent thinking time also the eval value could be shown ? I guess this value is somewhere in the code for deciding "best move" ?

Off the top of my head, I'm not sure how to surface this information to a GUI. However, the eval value is tracked during engine execution.

and those files in /test : how to use / include them ?

I'm not sure what you're asking here. Perhaps you can rephrase or add context?

tissatussa commented 3 years ago

ME: in the CuteChess info window, besides the spent thinking time also the eval value could be shown ? I guess this value is somewhere in the code for deciding "best move" ? YOU: Off the top of my head, I'm not sure how to surface this information to a GUI. However, the eval value is tracked during engine execution.

Here is an example output of a game Andoma vs. Aice .. in the CuteChess "Engine Debug" pane we see this:

[...] Andoma(62): position fen rnbqkb1r/ppp2Npp/3p1n2/8/4P3/8/PPPP1PPP/RNBQKB1R b KQkq - 0 4 moves e8f7 f1c4 f7e7 d2d4 f6e4 b1c3 e4c3 c1g5 e7d7 d1g4 d7e8 c4f7 e8f7 g4h5 g7g6 h5f3 Andoma(62): isready Andoma(62): readyok Andoma(62): go wtime 484342 btime 640546 winc 5000 binc 5000 > Andoma(62): info {'nodes': 708, 'time': 0.15902209281921387} Andoma(62): bestmove f7e8 Aice v0.99.2(61): position fen rnbqkb1r/ppp2Npp/3p1n2/8/4P3/8/PPPP1PPP/RNBQKB1R b KQkq - 0 4 moves e8f7 f1c4 f7e7 d2d4 f6e4 b1c3 e4c3 c1g5 e7d7 d1g4 d7e8 c4f7 e8f7 g4h5 g7g6 h5f3 f7e8 Aice v0.99.2(61): isready Aice v0.99.2(61): readyok Aice v0.99.2(61): go wtime 484342 btime 645387 winc 5000 binc 5000 Aice v0.99.2(61): info depth 1 Aice v0.99.2(61): info depth 1 seldepth 2 score cp -753 time 0 nodes 4 pv b2c3 Aice v0.99.2(61): info depth 1 seldepth 3 score cp 245 time 0 nodes 13 pv g5d8 Aice v0.99.2(61): info depth 2 Aice v0.99.2(61): info depth 2 seldepth 5 score cp 245 time 1 nodes 242 pv g5d8 e8d8 Aice v0.99.2(61): info depth 3 Aice v0.99.2(61): info depth 3 seldepth 7 score cp 256 time 1 nodes 720 pv g5d8 e8d8 f3f6 d8d7 [...] Aice v0.99.2(61): info depth 10 Aice v0.99.2(61): info depth 10 seldepth 25 score cp 362 time 1257 nodes 1250608 pv g5d8 c3d5 d8g5 d5e7 e1g1 b8c6 a1e1 e8d7 f3g4 d7d8 g4f4 Aice v0.99.2(61): info currmove b2c3 currmovenumber 2 Aice v0.99.2(61): info currmove f3d5 currmovenumber 3 Aice v0.99.2(61): info currmove f3e4 currmovenumber 4 [...] Aice v0.99.2(61): info currmove a1d1 currmovenumber 44 Aice v0.99.2(61): info currmove f3f5 currmovenumber 45 Aice v0.99.2(61): bestmove g5d8 [...]

A correct info line which holds the eval value is eg. "info depth 2 seldepth 5 score cp 245 time 1 nodes 242 pv g5d8 e8d8", as shown by Aice .. other engines output the same format .. however, the Andoma info line has another format, eg. "info {'nodes': 708, 'time': 0.15902209281921387}" .. that's why CuteChess does not show this info.

ME: and those files in /test : how to use / include them ? YOU: I'm not sure what you're asking here. Perhaps you can rephrase or add context?

I'm refering to the 4 files in the /test folder : test_engine.py, test_evaluation.py, test_puzzles.py and test_ui.py .. each contains a Class, but how should i include these in some python code to test anything ?