Discuss Scratch
- Discussion Forums
- » Show and Tell
- » Scratch Chess Engine - Game of Kings
#3541May 5, 2024 06:04:59
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
https://lichess.org/A3aEfB1c#102When GoK vs stockfisch 16 XD GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy:
Yes, at the same time it had a game against itself where it blundered multiple times. It just depends how a game develops and which things are inside / outside search horizon.
#3542May 5, 2024 07:14:16
- HasiLover_Test
-
100+ posts
Scratch Chess Engine - Game of Kings
I could run a GoK - Stockfish 16 game, but then maybe Stockfish only has 1 or 2 seconds per move and GoK is competition modehttps://lichess.org/A3aEfB1c#102When GoK vs stockfisch 16 XD GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy:
#3543May 5, 2024 07:18:34
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
I could run a GoK - Stockfish 16 game, but then maybe Stockfish only has 1 or 2 seconds per move and GoK is competition modehttps://lichess.org/A3aEfB1c#102When GoK vs stockfisch 16 XD GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy:
This was the most recent one I let it play back in February: https://lichess.org/5kqGaKJK (level 7 where GoK still has chances; level 8 would be interesting as well, I have not done that yet)
#3544May 5, 2024 07:21:24
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
WOW!I could run a GoK - Stockfish 16 game, but then maybe Stockfish only has 1 or 2 seconds per move and GoK is competition modehttps://lichess.org/A3aEfB1c#102When GoK vs stockfisch 16 XD GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy:
This was the most recent one I let it play back in February: https://lichess.org/5kqGaKJK (level 7 where GoK still has chances; level 8 would be interesting as well, I have not done that yet)
#3545May 5, 2024 07:23:04
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
So now there is a functional ‘Undo’ ('U' key)
#3546May 5, 2024 10:35:06
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
So now there is a functional ‘Undo’ ('U' key)
GoK Blitz 2 (black) vs. Destructor on TW, 98% vs. 90% accuracy: https://lichess.org/7h6QtO8Q#86
Destructor had good accuracy, except for the one blunder. It became quite slow during endgame. I thought it would get faster with fewer pieces.
#3547May 5, 2024 11:08:19
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
It is the search extension that makes it last longer, thank you anyway for this gameSo now there is a functional ‘Undo’ ('U' key)
GoK Blitz 2 (black) vs. Destructor on TW, 98% vs. 90% accuracy: https://lichess.org/7h6QtO8Q#86
Destructor had good accuracy, except for the one blunder. It became quite slow during endgame. I thought it would get faster with fewer pieces.
#3548May 5, 2024 17:56:20
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I will reprogram Destructor from A to Z, too many bugs, so if you have ideas for generating ultra-fast pseudo-legal movements, I am a taker!
#3549May 5, 2024 17:58:50
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
If I put my pessimism aside, I can say that the new version will be released towards the end of the Ascension Weekend, the new project will crush the old
#3550May 5, 2024 18:33:45
- birdracerthree
-
500+ posts
Scratch Chess Engine - Game of Kings
Your Transposition Table implementation is probably incorrect. I suggest removing it and adjusting the simpler things in the code. Element reached 6+8 with “only” alpha-beta pruning and solid move ordering in the search (MVV-LVA+PSTs). Make sure everything still works when you make a change. I will reprogram Destructor from A to Z, too many bugs, so if you have ideas for generating ultra-fast pseudo-legal movements, I am a taker!
Is your engine minimax or negamax? Please make sure everything works before you implement anything new. I like to run self-play games with my engine (this inspired White Dove to do the same). As you can see, Element is not foolproof. Here is the most recent self-play game - https://lichess.org/study/7hMXEJDB/gzd0h43G#59
#3551May 7, 2024 21:50:46
- birdracerthree
-
500+ posts
Scratch Chess Engine - Game of Kings
Do you think Element has something that prevents TTables from working? I found this pseudocode, but it didn't work when I tried to put it in Element. Does anyone have any ideas? Why is the line
“if α ≥ β then
return ttEntry.value”
in the code?
“if α ≥ β then
return ttEntry.value”
in the code?
Last edited by birdracerthree (May 7, 2024 21:51:59)
#3552May 7, 2024 23:13:56
- birdracerthree
-
500+ posts
Scratch Chess Engine - Game of Kings
https://lichess.org/study/FYcWqN5E/gHxC0UjC - GoK selected Bxg4 (it still thinks it is losing), WD plays Nxg4 (king tropism can't tell the difference between the two)
https://lichess.org/study/FYcWqN5E/aBHTfs6m - GoK doesn't reach the depth to see the correct move, but it sees its partial effect when it selected …fxe6 as black
https://lichess.org/study/FYcWqN5E/rjdN55I7 - No engine finds the correct move
https://lichess.org/study/FYcWqN5E/UF11KrPx - GoK sees this at the expected depth of 8. WD reaches ply 9 and does not see the solution.
https://lichess.org/study/FYcWqN5E/p7Wrp4XT - GoK plays Kh4, but its evaluation doesn't change.
https://lichess.org/study/FYcWqN5E/XV0qmrTs - GoK and Element find the solution, but WD does not. Element is faster in this position than WD (that should never happen, esp. in endgame where a TTable is extremely useful).
Bonus : 8/3k4/2p1Rp2/p1pP1P2/2P4P/2P1K3/8/r7 b - - 0 41 - GoK finds the correct move during depth 13
https://lichess.org/study/FYcWqN5E/1jj0Hz6b - White Dove sees the checkmate in roughly 5 seconds. GoK does not see it on competition mode. I guess the aggressive extensions come in handy here.
https://lichess.org/study/FYcWqN5E/aBHTfs6m - GoK doesn't reach the depth to see the correct move, but it sees its partial effect when it selected …fxe6 as black
https://lichess.org/study/FYcWqN5E/rjdN55I7 - No engine finds the correct move
https://lichess.org/study/FYcWqN5E/UF11KrPx - GoK sees this at the expected depth of 8. WD reaches ply 9 and does not see the solution.
https://lichess.org/study/FYcWqN5E/p7Wrp4XT - GoK plays Kh4, but its evaluation doesn't change.
https://lichess.org/study/FYcWqN5E/XV0qmrTs - GoK and Element find the solution, but WD does not. Element is faster in this position than WD (that should never happen, esp. in endgame where a TTable is extremely useful).
Bonus : 8/3k4/2p1Rp2/p1pP1P2/2P4P/2P1K3/8/r7 b - - 0 41 - GoK finds the correct move during depth 13
https://lichess.org/study/FYcWqN5E/1jj0Hz6b - White Dove sees the checkmate in roughly 5 seconds. GoK does not see it on competition mode. I guess the aggressive extensions come in handy here.
Last edited by birdracerthree (May 8, 2024 02:44:18)
#3553May 8, 2024 02:05:49
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
https://lichess.org/study/FYcWqN5E/gHxC0UjC - GoK selected Bxg4 (it still thinks it is losing), WD plays Nxg4 (king tropism can't tell the difference between the two)
https://lichess.org/study/FYcWqN5E/aBHTfs6m - GoK doesn't reach the depth to see the correct move, but it sees its partial effect when it selected …fxe6 as black
https://lichess.org/study/FYcWqN5E/rjdN55I7 - No engine finds the correct move
https://lichess.org/study/FYcWqN5E/UF11KrPx - GoK sees this at the expected depth of 8. WD reaches ply and does not see the solution.
https://lichess.org/study/FYcWqN5E/p7Wrp4XT - GoK plays Kh4, but its evaluation doesn't change.
https://lichess.org/study/FYcWqN5E/XV0qmrTs - GoK and Element find the solution, but WD does not. Element is faster in this position than WD (that should never happen, esp. in endgame where a TTable is extremely useful).
Bonus : 8/3k4/2p1Rp2/p1pP1P2/2P4P/2P1K3/8/r7 b - - 0 41 - GoK finds the correct move during depth 13
https://lichess.org/study/FYcWqN5E/1jj0Hz6b - White Dove sees the checkmate in roughly 5 seconds. GoK does not see it on competition mode. I guess the aggressive extensions come in handy here.
The last board is cool, great how fast White Dove finds it.
GoK did not support discovered checks within quiescence search so far, that is why it took longer. I created a quick prototype, and it finds it in less than a second.
One thing to note, GoK continues searching for quicker checkmates if checkmate is found during quiescence search, so you must check logfile for when the move is first found with checkmate evaluation.
Last edited by ArnoHu (May 8, 2024 05:46:50)
#3554May 8, 2024 05:49:16
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I am reprogramming entirely destructor; indeed, I have plenty of ideas to optimize everything and fix the bugs but they are too complicated to implement on an already existing project: so I am reprogramming the engine….Your Transposition Table implementation is probably incorrect. I suggest removing it and adjusting the simpler things in the code. Element reached 6+8 with “only” alpha-beta pruning and solid move ordering in the search (MVV-LVA+PSTs). Make sure everything still works when you make a change. I will reprogram Destructor from A to Z, too many bugs, so if you have ideas for generating ultra-fast pseudo-legal movements, I am a taker!
Is your engine minimax or negamax? Please make sure everything works before you implement anything new. I like to run self-play games with my engine (this inspired White Dove to do the same). As you can see, Element is not foolproof. Here is the most recent self-play game - https://lichess.org/study/7hMXEJDB/gzd0h43G#59
#3555May 8, 2024 08:31:39
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
2 hours lost fighting with the generation of movements, balance: I had forgotten a block ‘delete all of’
#3556May 8, 2024 12:43:12
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I tried to see to remove the TT, the engine runs slower but it no longer sacrifices without reason…
#3557May 9, 2024 05:50:19
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
https://lichess.org/study/FYcWqN5E/gHxC0UjC - GoK selected Bxg4 (it still thinks it is losing), WD plays Nxg4 (king tropism can't tell the difference between the two)
https://lichess.org/study/FYcWqN5E/aBHTfs6m - GoK doesn't reach the depth to see the correct move, but it sees its partial effect when it selected …fxe6 as black
https://lichess.org/study/FYcWqN5E/rjdN55I7 - No engine finds the correct move
https://lichess.org/study/FYcWqN5E/UF11KrPx - GoK sees this at the expected depth of 8. WD reaches ply and does not see the solution.
https://lichess.org/study/FYcWqN5E/p7Wrp4XT - GoK plays Kh4, but its evaluation doesn't change.
https://lichess.org/study/FYcWqN5E/XV0qmrTs - GoK and Element find the solution, but WD does not. Element is faster in this position than WD (that should never happen, esp. in endgame where a TTable is extremely useful).
Bonus : 8/3k4/2p1Rp2/p1pP1P2/2P4P/2P1K3/8/r7 b - - 0 41 - GoK finds the correct move during depth 13
https://lichess.org/study/FYcWqN5E/1jj0Hz6b - White Dove sees the checkmate in roughly 5 seconds. GoK does not see it on competition mode. I guess the aggressive extensions come in handy here.
The last board is cool, great how fast White Dove finds it.
GoK did not support discovered checks within quiescence search so far, that is why it took longer. I created a quick prototype, and it finds it in less than a second.
One thing to note, GoK continues searching for quicker checkmates if checkmate is found during quiescence search, so you must check logfile for when the move is first found with checkmate evaluation.
Quick update, the current GoK Dev version finds the mate-in-7 for “r2qr1k1/pp3p1p/1b3p1B/2p1p3/2B1P3/2PP1P1b/P4P1P/R2QR2K w - - 3 16” in 0.06 seconds on TurboWarp. Not bad, hm?
#3558May 9, 2024 06:16:31
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
this pseudocode, but it didn't work when I tried to put it in Element. Does anyone have any ideas? Why is the lineDo you think Element has something that prevents TTables from working? I found
“if α ≥ β then
return ttEntry.value”
in the code?
If cached TT eval is bound, you can only use it (and return immediately) in case of a cutoff.
#3559May 9, 2024 06:19:18
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
2 hours lost fighting with the generation of movements, balance: I had forgotten a block ‘delete all of’
For me the main reason to run into inexplicable problems is having used the same variable in two custom blocks, and one invokes the other, hence gets it supposedly local state overridden. Although I use a naming scheme to distinguish variable scope.
#3560May 9, 2024 06:21:09
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
I am reprogramming entirely destructor; indeed, I have plenty of ideas to optimize everything and fix the bugs but they are too complicated to implement on an already existing project: so I am reprogramming the engine….Your Transposition Table implementation is probably incorrect. I suggest removing it and adjusting the simpler things in the code. Element reached 6+8 with “only” alpha-beta pruning and solid move ordering in the search (MVV-LVA+PSTs). Make sure everything still works when you make a change. I will reprogram Destructor from A to Z, too many bugs, so if you have ideas for generating ultra-fast pseudo-legal movements, I am a taker!
Is your engine minimax or negamax? Please make sure everything works before you implement anything new. I like to run self-play games with my engine (this inspired White Dove to do the same). As you can see, Element is not foolproof. Here is the most recent self-play game - https://lichess.org/study/7hMXEJDB/gzd0h43G#59
Sometimes that's the right choice, often not. When I had to introduce the possibility of GoK playing white, it looked like a massive change. In reality it took less than an hour, by introducing a virtual board layer (tricking GoK into thinking it was still playing black).