Introducing Gyatso – My Open-Source Chess Engine

Discussion of chess software programming and technical issues.

Moderator: Ras

Aleks Peshkov
Posts: 967
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by Aleks Peshkov »

cutechess and fastchess report each different warning set of problems. Surprisingly several respectful engines being reported problems with them.
jorose
Posts: 376
Joined: Thu Jan 22, 2015 3:21 pm
Location: Zurich, Switzerland
Full name: Jonathan Rosenthal

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by jorose »

I agree with Gflohr. The feature set you have is already quite extensive, this is not at the stage where we need to talk about tuning issues too much. Winter was like 2700 while still enjoying bongcloud like openings at some point. Fixing the endgame bugs will likely make you gain several hundred rating points.
-Jonathan
ericlangedijk
Posts: 44
Joined: Thu Aug 08, 2013 5:13 pm

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by ericlangedijk »

This is not uncommon. The faster the perft, the slower the engine.
That sounds crazy! A fast movegenerator just... generates moves fast.
Anyway chessnix only increments nodecount after making a move. Nps seems a lot slower than when we would increment nodecount at the entrypoint of each qsearch or search call.
I did not put much (if any) effort in making the search as fast as possible though. There is so much more going on than inside a movegenerator.
GyatsoYT
Posts: 34
Joined: Fri May 09, 2025 12:27 pm
Full name: Gyatso Neesham

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by GyatsoYT »

jorose wrote: Sun Dec 21, 2025 10:21 pm I agree with Gflohr. The feature set you have is already quite extensive, this is not at the stage where we need to talk about tuning issues too much. Winter was like 2700 while still enjoying bongcloud like openings at some point. Fixing the endgame bugs will likely make you gain several hundred rating points.
I do actually beleive that my engine has an endgame problem bcz it seems to find mate in middlegame with a lot of pieces on board but doesn't in endgame , I have seen it lose KQvsk endgame on time which is an easy win for any good engine it's not that it can't checkmate it in endgame it just does it very slowly like not getting the king closer to enemy king or not pushing the extra pawn it has when it has a major piece.
In next update I'll make sure to focus more on endgame eval and search.
GyatsoYT
Posts: 34
Joined: Fri May 09, 2025 12:27 pm
Full name: Gyatso Neesham

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by GyatsoYT »

Aleks Peshkov wrote: Sun Dec 21, 2025 7:47 pm cutechess and fastchess report each different warning set of problems. Surprisingly several respectful engines being reported problems with them.
Hi there could you be more specific with what you mean this information is very little for me to act or reply upon.
User avatar
Steve Maughan
Posts: 1308
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by Steve Maughan »

Do you extend checks aggressively? As a general rule, forced checkmates in the middlegame usually have lots of checks in the path. In the endgame with a lone king and few pawns, it's more about restricting the king's options. Checks are not as useful and can explode the tree if extended aggressively.
GyatsoYT wrote: Mon Dec 22, 2025 1:17 pm I do actually beleive that my engine has an endgame problem bcz it seems to find mate in middlegame with a lot of pieces on board but doesn't in endgame , I have seen it lose KQvsk endgame on time which is an easy win for any good engine it's not that it can't checkmate it in endgame it just does it very slowly like not getting the king closer to enemy king or not pushing the extra pawn it has when it has a major piece.
In next update I'll make sure to focus more on endgame eval and search.
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
gflohr
Posts: 72
Joined: Fri Jul 23, 2021 5:24 pm
Location: Elin Pelin
Full name: Guido Flohr

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by gflohr »

GyatsoYT wrote: Mon Dec 22, 2025 1:17 pm
jorose wrote: Sun Dec 21, 2025 10:21 pm I agree with Gflohr. The feature set you have is already quite extensive, this is not at the stage where we need to talk about tuning issues too much. Winter was like 2700 while still enjoying bongcloud like openings at some point. Fixing the endgame bugs will likely make you gain several hundred rating points.
I do actually beleive that my engine has an endgame problem bcz it seems to find mate in middlegame with a lot of pieces on board but doesn't in endgame , I have seen it lose KQvsk endgame on time which is an easy win for any good engine it's not that it can't checkmate it in endgame it just does it very slowly like not getting the king closer to enemy king or not pushing the extra pawn it has when it has a major piece.
In next update I'll make sure to focus more on endgame eval and search.
Look again at the game I've posted. The engine moves into a stalemate without any reason. That is not an endgame problem or some suboptimal tuning, but a bug. The first thing you should do is to feed that position into your engine and see what it wants to move. I've done that:

position fen 8/p7/4p3/3kn3/8/3q4/8/4K3 b - - 0 1
go depth 3

Output:

info depth 1 score cp 1633 nodes 84 nps 0 time 0 pv d3c2
info depth 2 score cp 1665 nodes 190 nps 0 time 0 pv d3c2 e1f1
info depth 3 score cp 1667 nodes 2488 nps 2488000 time 1 pv d5e4 e1f2 d3e3
bestmove d5e4 ponder e1f2

You can increase the depth to whatever you want; the engine never goes for Ng4, which results in a stalemate. But in the game, it picked this move. And you have to find out why.

Obviously, something told the engine that Ng4 is a good move in this position, and the engine believes that without realising that it's game over, stalemate, a draw, 0 centipawn advantage. If I had to guess, I would say that the culprit is a bug related to the transposition table.
GyatsoYT
Posts: 34
Joined: Fri May 09, 2025 12:27 pm
Full name: Gyatso Neesham

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by GyatsoYT »

gflohr wrote: Mon Dec 22, 2025 7:33 pm
GyatsoYT wrote: Mon Dec 22, 2025 1:17 pm
jorose wrote: Sun Dec 21, 2025 10:21 pm I agree with Gflohr. The feature set you have is already quite extensive, this is not at the stage where we need to talk about tuning issues too much. Winter was like 2700 while still enjoying bongcloud like openings at some point. Fixing the endgame bugs will likely make you gain several hundred rating points.
I do actually beleive that my engine has an endgame problem bcz it seems to find mate in middlegame with a lot of pieces on board but doesn't in endgame , I have seen it lose KQvsk endgame on time which is an easy win for any good engine it's not that it can't checkmate it in endgame it just does it very slowly like not getting the king closer to enemy king or not pushing the extra pawn it has when it has a major piece.
In next update I'll make sure to focus more on endgame eval and search.
Look again at the game I've posted. The engine moves into a stalemate without any reason. That is not an endgame problem or some suboptimal tuning, but a bug. The first thing you should do is to feed that position into your engine and see what it wants to move. I've done that:

position fen 8/p7/4p3/3kn3/8/3q4/8/4K3 b - - 0 1
go depth 3

Output:

info depth 1 score cp 1633 nodes 84 nps 0 time 0 pv d3c2
info depth 2 score cp 1665 nodes 190 nps 0 time 0 pv d3c2 e1f1
info depth 3 score cp 1667 nodes 2488 nps 2488000 time 1 pv d5e4 e1f2 d3e3
bestmove d5e4 ponder e1f2

You can increase the depth to whatever you want; the engine never goes for Ng4, which results in a stalemate. But in the game, it picked this move. And you have to find out why.

Obviously, something told the engine that Ng4 is a good move in this position, and the engine believes that without realising that it's game over, stalemate, a draw, 0 centipawn advantage. If I had to guess, I would say that the culprit is a bug related to the transposition table.

i actually tried this through cutechess and it seems to return proper moves for mate i dont know why it didnt for you
>Gyatso v2.9.6.8 prob(1): position fen 8/p7/4p3/3kn3/8/3q4/8/4K3 b - - 0 1
>Gyatso v2.9.6.8 prob(1): isready
<Gyatso v2.9.6.8 prob(1): readyok
>Gyatso v2.9.6.8 prob(1): go wtime 300000 btime 300000 movestogo 40
<Gyatso v2.9.6.8 prob(1): info depth 1 score cp 1633 nodes 84 nps 84000 time 1 pv d3c2
<Gyatso v2.9.6.8 prob(1): info depth 2 score cp 1665 nodes 190 nps 190000 time 1 pv d3c2 e1f1
<Gyatso v2.9.6.8 prob(1): info depth 3 score cp 1667 nodes 2606 nps 521200 time 5 pv d5e4 e1f2 d3e3
<Gyatso v2.9.6.8 prob(1): info depth 4 score cp 1665 nodes 14005 nps 583541 time 24 pv d3c2 e1f1 d5d4 f1e1
<Gyatso v2.9.6.8 prob(1): info depth 5 score cp 1665 nodes 37785 nps 662894 time 57 pv d5d4 e1f2 d3e3 f2g2 e3f4
<Gyatso v2.9.6.8 prob(1): info depth 6 score cp 1667 nodes 109494 nps 835832 time 131 pv d3c2 e1f1 c2d2 f1g1 d2f4 g1g2
<Gyatso v2.9.6.8 prob(1): info depth 7 score cp 1671 nodes 242029 nps 820437 time 295 pv d5e4 e1f2 d3d1 f2g3 d1f3 g3h2 e5c4
<Gyatso v2.9.6.8 prob(1): info depth 8 score cp 0 nodes 242817 nps 817565 time 297 pv e5g4
<Gyatso v2.9.6.8 prob(1): info depth 9 score mate 6 nodes 396987 nps 827056 time 480 pv d5e4 e1f2 d3h3 f2e1 h3e3 e1d1 e3c3 d1e2 c3c2
<Gyatso v2.9.6.8 prob(1): info depth 10 score cp 1671 nodes 692199 nps 812440 time 852 pv d3h3 e1d1 h3h5 d1c1 h5e2 c1b1 d5d4 b1a1 d4e4 a1b1
<Gyatso v2.9.6.8 prob(1): info depth 11 score mate 8 nodes 713834 nps 793148 time 900 pv d3h3 e1e2 h3e3 e2e3 e5d3
<Gyatso v2.9.6.8 prob(1): info depth 12 score mate 33 nodes 727701 nps 775800 time 938 pv d3c2 e1f1 c2h2 f1e1 h2h7 e1d2 h7h2 d2c3 h2d2 c3d2 e5d3 d2d3
<Gyatso v2.9.6.8 prob(1): info depth 13 score mate 6 nodes 752686 nps 752686 time 1000 pv d3c2 e1f1 c2e2 f1e2 e5d3
<Gyatso v2.9.6.8 prob(1): info depth 14 score mate 31 nodes 810361 nps 699189 time 1159 pv d3e3 e1f1 e3f3 f1g1 f3h3 g1f2 h3a3 f2g2 d5d4 g2h2 d4d5 h2h1 a3b2 h1g1
<Gyatso v2.9.6.8 prob(1): info depth 15 score mate 4 nodes 882477 nps 679874 time 1298 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 16 score mate 4 nodes 965865 nps 670274 time 1441 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 17 score mate 4 nodes 1082885 nps 675115 time 1604 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 18 score mate 4 nodes 1259681 nps 664388 time 1896 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 19 score mate 4 nodes 1501010 nps 615168 time 2440 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 20 score mate 4 nodes 1796478 nps 598427 time 3002 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 21 score mate 4 nodes 2147952 nps 616695 time 3483 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 22 score mate 4 nodes 2518979 nps 637877 time 3949 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 23 score mate 4 nodes 2903379 nps 660459 time 4396 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 24 score mate 4 nodes 3288617 nps 673896 time 4880 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 25 score mate 4 nodes 3715350 nps 677118 time 5487 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 26 score mate 4 nodes 4210941 nps 673319 time 6254 pv e5g6 e1f2 g6f4 f2g1 d3e2 g1h1 e2g2
<Gyatso v2.9.6.8 prob(1): info depth 27 score mate 4 nodes 4843995 nps 665749 time 7276 pv e5g6 e1f2 g6f4 f2g1 d3e2
<Gyatso v2.9.6.8 prob(1): bestmove e5g6 ponder e1f2

yes it did have the d5e4 move in the pv for like the first 3 depth but not after that it clearly found the mate but i would still look into this.
Aleks Peshkov
Posts: 967
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Introducing Gyatso – My Open-Source Chess Engine

Post by Aleks Peshkov »

Seems you do not fix relative mate-distance scores when writing to TT and back.