Discuss Scratch

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

ababoin07 wrote:

ArnoHu wrote:

GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy: https://lichess.org/A3aEfB1c#102
When GoK vs stockfisch 16 XD

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.
HasiLover_Test
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

ababoin07 wrote:

ArnoHu wrote:

GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy: https://lichess.org/A3aEfB1c#102
When GoK vs stockfisch 16 XD
I could run a GoK - Stockfish 16 game, but then maybe Stockfish only has 1 or 2 seconds per move and GoK is competition mode
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

HasiLover_Test wrote:

ababoin07 wrote:

ArnoHu wrote:

GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy: https://lichess.org/A3aEfB1c#102
When GoK vs stockfisch 16 XD
I could run a GoK - Stockfish 16 game, but then maybe Stockfish only has 1 or 2 seconds per move and GoK is competition mode

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)
ababoin07
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

HasiLover_Test wrote:

ababoin07 wrote:

ArnoHu wrote:

GoK 6.530 plays a perfect game at 10 sec think time vs. White Dove (P2) - 99% vs. 92% accuracy: https://lichess.org/A3aEfB1c#102
When GoK vs stockfisch 16 XD
I could run a GoK - Stockfish 16 game, but then maybe Stockfish only has 1 or 2 seconds per move and GoK is competition mode

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)
WOW!
ababoin07
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

So now there is a functional ‘Undo’ ('U' key)
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

ababoin07 wrote:

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.
ababoin07
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

ababoin07 wrote:

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.
It is the search extension that makes it last longer, thank you anyway for this game
ababoin07
Scratcher
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!
ababoin07
Scratcher
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
birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ababoin07 wrote:

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!
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.

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
birdracerthree
Scratcher
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?

Last edited by birdracerthree (May 7, 2024 21:51:59)

birdracerthree
Scratcher
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.

Last edited by birdracerthree (May 8, 2024 02:44:18)

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

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)

ababoin07
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

oiseauracertrois wrote:

ababoin07 wrote:

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!
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.

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
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….
ababoin07
Scratcher
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’
ababoin07
Scratcher
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…
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

birdracerthree wrote:

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?
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

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 cached TT eval is bound, you can only use it (and return immediately) in case of a cutoff.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

ababoin07 wrote:

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.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

ababoin07 wrote:

oiseauracertrois wrote:

ababoin07 wrote:

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!
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.

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
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….

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).

Powered by DjangoBB