skycloudd / eccat

An experimental UCI chess engine written in Rust
MIT License
2 stars 1 forks source link

successor of Kittycat ? #1

Open tissatussa opened 5 months ago

tissatussa commented 5 months ago

is Eccat the successor of your Kittycat engine ? i was able to compile both and they run fine in CuteChess !

[ i'm on Xubuntu 22.04 ]

skycloudd commented 5 months ago

it is the successor! I've just decided to rewrite some of the logic, and kept most of the uci things :) did you make them play against eachother? which one's better? :D very cool!

tissatussa commented 5 months ago

yes, i also let them play eachother .. i use CuteChess GUI for that, timecontrol 900+3, fairly slow games .. Eccat plays weird, esp. with Black : it likes to play f7-f6 early, not putting a Knight on that square !? And developing Bishops on a6 and h6 .. Kittycat plays much more natural and seems stronger ?! I attached 7 games in a ZIPped pgn : cats-play.zip -- i hope you have enough chess skills to judge. Btw. some games were setup with a starting FEN (both engines can do that, which is very nice). Here's the starting position, it's the so-called "Cow" opening, a new and obscure way to play :

cow-opening

Black to play. The 4th game in ZIP shows Eccat even starts with Ng8 here : putting the Knight BACK ?!

skycloudd commented 5 months ago

oh wow! nice comparison with piglet as well :) im surprised kittycat played so much stronger. from some quick little tests i've done to compare the search speeds i found that eccat is much, much faster (at least 5 times as fast, just from looking at how fast it reaches certain depths in different positions). which must mean its evaluations of positions isn't as strong. i'll compare their code to see what's different and if i can maybe make any improvements 😝

i loved looking through these games! i have some beginner/intermediate level chess knowledge, but i did struggle with understanding the intention behind some engine moves 😝. very fun to see eccat play against its older sibling though :D and also really nice that somebody other than me is interested in something i've created, really makes me happy :)

skycloudd commented 5 months ago

ha :p i think there is a bug in eccat's evaluation function. i have the following:

eval += piece_square(piece, piece_colour, square, is_endgame);

which i think is incorrect, as i should also be multiplying it by -1 if it's for a black piece), as kittycat does correctly: https://github.com/skycloudd/kittycat/blob/918d1cb837b06d1412499b15f99f545119278c97/src/evaluate.rs#L21-L26

this may also explain the weird "moving the knight back" move at the start in the 4th game :p i'll fix this and see how it plays after. thank you so much for getting me to look at this again :p i dont want to imagine how long this bug wouldve stayed there


just changed it, and yes! that definitely seems right. i changed it and immediately the pv line in the starting position makes a lot more sense for black. before it had moves like b7b6 and g7g6 for black on move 1 and 2 respectively. now it gives e7e5 and b8c6... seems a lot more intuitive to me :p

again, thanks so much!!

tissatussa commented 5 months ago

i have some more games and info : i used the same position in 6 games, see cats-fixpos1.zip .. i let both cats play eachother and White won both 2 games ! So it seemed your cats understand the Cow opening setup and how to explore this unusual piece & pawn configuration .. but then i let both cats play White against MagiC Engine v2, and Black won those games .. this engine has no rating .. also 2 games against Piglet are included, with different results : Kitty won, Eccat lost ..

in CuteChess GUI (only on Linux) both cats run fine, but other such apps (ChessX, Jerry, ..) have problems running it and/or give no output .. a chess GUI called Nibbler, meant for Leela Chess Zero & NNUE, can also run most HCE engines, but not your cats .. fortunately it outputs some useful error info :

eccat-crash-in-nibbler

it would be nice to solve this and run your cats in Nibbler - can you run that app ? It has an uncommon interface tech but you'll manage .. i gathered a lot of open source engines and many run fine in Nibbler, but not all : they lack a proper UCI protocol, i mean these "info string.." lines and good handshaking by isready and readyok, according the UCI rules .. then maybe your cats will also play in other chess GUIs, esp. SCID, which is best for me, but crashes many (simple) engines without any error messages - afaik ..

tissatussa commented 5 months ago

btw. i would certainly focus on proper implementation of the UCI engine communication protocol : your engine should work in all chess GUIs, as i mentioned .. you can always improve the strength of the engine, there's no end .. but the engine should work on an OS without crashing ..

tissatussa commented 5 months ago

another thing for me is MultiPV : the engine displays alternative moves, like a top-[#] list .. this way the evaluation process will be slower, reaching higher depth, but we can see which moves are considered and how they can climb the top-list .. for me this can give insight - chess wise, not tech wise .. also for a programmer MPV can give insight of the inner workings of their engine : how many nodes are searched, how many captures are possible, etc. ..

af995efea0bccadbee70c287e8d19b19

tissatussa commented 5 months ago

in this position both kittycat and eccat do not find best move Nd4 or even Bd2+ .. the cats played Bc5+ and made only a draw by allowing the Queen giving repetion checks !? it takes too much time for them to reach higher depth and see Nd4 is clearly best .. do they prefer to evaluate checks first ? In the position Black must keep harmony of its pieces, while attacking the King .. after Nd4 it seems White must sacrifice the Queen to manage the complications but then Black wins easily with 2 pieces ..

Nd4-best

Kittycat output in CuteChess : Nd4-best-kittycat

Eccat output in CuteChess : Nd4-best-eccat

skycloudd commented 5 months ago

hello! apologies for not replying for a while, but ive fixed a few of those issues :)

and a few things i still want to add:

as well, you should use cargo build --profile full --features=pext to compile the engine which builds the program with "full performance" settings which speeds it up by a significant amount (it does take longer to compile though). you can omit --features=pext if your cpu doesn't support it.

and even more news: i'm now running it on lichess! https://lichess.org/@/kybot

tissatussa commented 5 months ago

wow !! that's progress .. glad you did !

eccat v0.1.2 plays really well now, natural development of the pieces, going forward, offering pawns when neede .. i like its style !

i guess its rating is around 2200 .. today i ran 20+ games with it, 7m+3s, mostly with engines of similar strength .. here are the stats, also mentioning the LiChess link for replay and study .. i did the online LiChess SF analysis, output .i-.m-.b-..% (Inaccuracies Mistakes Blunders) so you can judge the Result. These are just some my gathered chess engines - all Linux :)

PGNs : eccat-games-420s+3s-part1.zip

eccat-20-list

tissatussa commented 5 months ago

https://github.com/skycloudd/eccat/assets/1109281/a041d93a-1c25-4975-bec6-328146a113fb

tissatussa commented 5 months ago

i see you're from Holland .. dus je bent een Nederlander, ik zit in Hengelo.

tissatussa commented 5 months ago

writing 'robust' code is key for me : i don't mean secure but universal .. make it "fail gracefully" and mind "simple is not always best but best is always simple".

you should create all the basic UCI commands according to the protocol .. then no basic errors should occur.

using PeSTO code / ideas is a good pick !

indeed it reaches higher depth more quickly, depth 12/13 in common middlegame positions.

custom UCI commands are awesome !

designing / implementing mpv can be tricky .. i guess many solutions exist to build it .. when using SCID i see different ways the mpv list is updated during analysis .. this is what i want to see : SF acts best upon this, it perfectly updates the top-best-move list order, sorted correctly. Think about it, for me this functionality is delicate .. even special positions may hide a hidden bestmove, which normally (mpv=1) would never be found but with high (25+!) mpv : that move suddenly gets more cp value before becoming [1] .. such high mpv isn't recommanded for play (although CuteChess allows setting it) only for analysis / insight .. do you test / develop using well-composed positions ? Can their results be of any use ? I wonder, but i did many such sessions, trying to get something out of it - chess wise ..

tissatussa commented 4 months ago

more 7m+3s chess games (78) of eccat v0.1.2 against engines, most of them have same strength : eccat-78-games-420s+3s-part2.zip