ArcticXWolf / AXWChessbot

A simple chess engine written in Golang.
https://lichess.org/@/AXWChessBot
5 stars 0 forks source link

Missed mate in 1 #1

Closed Wikunia closed 3 years ago

Wikunia commented 3 years ago

Hi,

I'm the creator of a new chess engine https://github.com/Wikunia/Ghess (yeah I'm working on a Readme :smile: ) I've played against your bot for testing and saw that it missed a mate in 1 for a couple of moves. Maybe your bot just wanted mine to live in fear for a little longer but if this is intended you might have a bug. The game with the position is here: https://lichess.org/zKJTFQkp/black#56

ArcticXWolf commented 3 years ago

Hey,

thanks for sharing that game :) I've identified the bug and pushed a commit to fix it. My mate-ordering was making the engine deprioritizing the fastest way to mate. Now it played the mate directly: https://lichess.org/sS82xPt2 New version with the bugfix is already on lichess, a new release here on github follows in a minute.

Cheers, ArcticXWolf

PS: I took a look at your engine and I'm sure to follow its development, maybe I can spot a few things to also integrate into mine. Keep up the good work 👍 May I ask you what your performance is like? So what is your CPU, what nps do you get (and how you measure nps 😆 ), how deep your engine gets in 10 sec, etc?

Wikunia commented 3 years ago

As I thought it wanted me to suffer longer 😂 I basically started around two weeks ago and most of the time I spent on implementing all those damn rules 😃 I haven't a counter for now yet but it's on my list. I'm doing an evaluation of ply 5 in roughly 5 seconds in the starting position which is probably not very good. This is with iterative deepening and a rough heuristic to order the nodes but nothing fancy.

ArcticXWolf commented 3 years ago

Yeah, thats why I used a prebuild library (dragontoothmg) for move generation. Chess sounds like a simple game on paper, but there are so many little details when it comes to movegen... But for two weeks your engine is putting up quite a fight. I just let them play again and your engine took mine to a really exciting pawn endgame. Well made 😀

I want to implement multiprocessing, but there is soo much else to do before like killer moves, better evaluation, a benchmarking system to test different versions against each other 😆

Wikunia commented 3 years ago

Yeah mine is definitely not good at endgames as the pawns always have the same value. Thinking about probably using the piece position table for that. Do you have some numbers for your speed as a rough comparison? I also think that I can improve up more on side of move generation. Especially for things like threefold repetition check. Anyway I'll also blog about the progress on https://opensourc.es an introduction post will be live tmr. I'll make sure to follow you and your engine and let them play to get some new ideas in the future.

ArcticXWolf commented 3 years ago

Endgames are difficult for engines. I still need to implement the endgame tables into my golang rewrite..

Do you have some numbers for your speed as a rough comparison?

Sure: The server it runs on has 4-Cores with 3.5 Ghz, but as multiprocessing isnt implemented, it cannot use all of them (and maybe I dont want to drain all resources from everything else, too 😆). On average the engine calculates 35k-45k nps and in 15 sec it gets to depth 5-6. However this really depends on the position, the nps can peak up to 120k and the depth is also highly dependent on the position.

Btw. my nps and depth are only the nodes in alphaBeta, not in quiescence search. The QNodes inflated my numbers by a lot so I excluded them.

Here is a position from our latest game:

2021/04/19 16:24:33 Position: [startpos moves e2e4 e7e5 g1f3 d7d5 e4d5 e5e4 d1e2 g8f6 d2d3 d8d5 b1d2 c8f5 f3h4 f5g4 f2f3 d5g5 g2g3 g4e6 f3e4 g5a5 c2c4 b8c6 f1g2 c6b4 e1g1 b4c2 a1b1 f8c5 g1h1 a5a2 e4e5 e6g4 h4f3 f6h5 e2e4 c2e3 e4b7 e8g8 f1e1 e3g2 h1g2 g4f5 e5e6 c5b6 e6e7 f8e8 b7d5 a2a5 d5a5 b6a5 e1e5 a5d2 e5f5 g7g6 f5e5 d2c1 b1c1 a8b8 e5e2 b8b3 c1a1 b3d3 a1e1 f7f5 c4c5 a7a5 c5c6 g8g7 f3g5 g7h6 g5f7 h6g7 f7d8 g7f6 d8b7 a5a4]
2021/04/19 16:24:57 SearchInfo: {NodesTraversed: 2015982, QNodesTraversed: 4406825, Depth: 6, CacheHits: 200499, CacheCutoffs: 103321, Time: 23.539922406s}
2021/04/19 16:24:57 Move: b7c5, Info: info depth 6 score cp 109 nodes 2015982 nps 85640 time 23539
2021/04/19 16:24:57 TranspositionTable: 2154169 / 22369621