Discuss Scratch

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

Draw between GoK (black) and White Dove, 10sec think time, both at 94% accuracy: https://lichess.org/ioJZkpXm#138

Rematch, tough fight, GoK(white) wins at 94% vs. 90% accuracy: https://lichess.org/ob5IeBCC#147

Game #3, GoK white, 97% vs. 92% accuracy

Game #4 was great, GoK black, 98% vs. 91% accuracy: https://lichess.org/qMkJuf25#100

Final game of the series on Scratch 3, 10sec think time. Another miraculous late-midgame escape by GoK (white), after trailing behind 6,0 (it will not always be so lucky, on the other hand WD did not see the mistakes at first either). 88% vs. 83% accuracy: https://lichess.org/mFVirrsW#145

GoK's latest version (white) in a low-accuracy but entertaining game against WD (10 sec). Same pattern again, GoK trailing behind during early midgame, enters endgame at roughly equal terms, then wins: https://lichess.org/X2Bkk8vk#149

The evaluation graph roughly correlated with the difference in search depth, not really surprising. During midgame GoK +1.5 in avg. search depth, later +3.

WD got its rook pinned at move 68, that was kind of strange.

OK, I spent some time investigating with Chrome Dev Tools. Most time was used in move generation close to max depth. Search / move generation depends on up-to-date attack tables (esp. during full search), but if hash moves are fund I limited attack table creation (trying to improve performance), expecting that in such a case attack tables would not be necessary (code works with and w/o those tables, but w/o them will be slower). Well I was wrong, which explains the low search depth during midgame.

This game against WD was played after the fix, and finally GoK midgame performance is back to normal (+2.5 avg. search depth compared to WD):

https://lichess.org/vmwCfsKm#97

Last edited by ArnoHu (May 19, 2024 20:54:54)

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

GoK Medium (white) against Element (6+8), reached depth 10 to 12 during midgame, 12 to 14 during endgame, 97% vs. 93% accuracy: https://lichess.org/AZIqdcOz#103
birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

Draw between GoK (black) and White Dove, 10sec think time, both at 94% accuracy: https://lichess.org/ioJZkpXm#138

Rematch, tough fight, GoK(white) wins at 94% vs. 90% accuracy: https://lichess.org/ob5IeBCC#147

Game #3, GoK white, 97% vs. 92% accuracy

Game #4 was great, GoK black, 98% vs. 91% accuracy: https://lichess.org/qMkJuf25#100

Final game of the series on Scratch 3, 10sec think time. Another miraculous late-midgame escape by GoK (white), after trailing behind 6,0 (it will not always be so lucky, on the other hand WD did not see the mistakes at first either). 88% vs. 83% accuracy: https://lichess.org/mFVirrsW#145

GoK's latest version (white) in a low-accuracy but entertaining game against WD (10 sec). Same pattern again, GoK trailing behind during early midgame, enters endgame at roughly equal terms, then wins: https://lichess.org/X2Bkk8vk#149

The evaluation graph roughly correlated with the difference in search depth, not really surprising. During midgame GoK +1.5 in avg. search depth, later +3.

WD got its rook pinned at move 68, that was kind of strange.

OK, I spent some time investigating with Chrome Dev Tools. Most time was used in move generation close to max depth. Search / move generation depends on up-to-date attack tables (esp. during full search), but if hash moves are fund I limited attack table creation (trying to improve performance), expecting that in such a case attack tables would not be necessary (code works with and w/o those tables, but w/o them will be slower). Well I was wrong, which explains the low search depth during midgame.

This game against WD was played after the fix, and finally GoK midgame performance is back to normal (+2.5 avg. search depth compared to WD):

https://lichess.org/vmwCfsKm#97
You should run more games to be sure. We can’t know for sure after one game. How is the automation project going?

Are attack tables stored separately per piece, or as one long string?
birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

GoK Medium (white) against Element (6+8), reached depth 10 to 12 during midgame, 12 to 14 during endgame, 97% vs. 93% accuracy: https://lichess.org/AZIqdcOz#103
I put in 4…d6 in the book after the previous Element game. Im glad it worked out (I’ll add some variance to this line as well).
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

Draw between GoK (black) and White Dove, 10sec think time, both at 94% accuracy: https://lichess.org/ioJZkpXm#138

Rematch, tough fight, GoK(white) wins at 94% vs. 90% accuracy: https://lichess.org/ob5IeBCC#147

Game #3, GoK white, 97% vs. 92% accuracy

Game #4 was great, GoK black, 98% vs. 91% accuracy: https://lichess.org/qMkJuf25#100

Final game of the series on Scratch 3, 10sec think time. Another miraculous late-midgame escape by GoK (white), after trailing behind 6,0 (it will not always be so lucky, on the other hand WD did not see the mistakes at first either). 88% vs. 83% accuracy: https://lichess.org/mFVirrsW#145

GoK's latest version (white) in a low-accuracy but entertaining game against WD (10 sec). Same pattern again, GoK trailing behind during early midgame, enters endgame at roughly equal terms, then wins: https://lichess.org/X2Bkk8vk#149

The evaluation graph roughly correlated with the difference in search depth, not really surprising. During midgame GoK +1.5 in avg. search depth, later +3.

WD got its rook pinned at move 68, that was kind of strange.

OK, I spent some time investigating with Chrome Dev Tools. Most time was used in move generation close to max depth. Search / move generation depends on up-to-date attack tables (esp. during full search), but if hash moves are fund I limited attack table creation (trying to improve performance), expecting that in such a case attack tables would not be necessary (code works with and w/o those tables, but w/o them will be slower). Well I was wrong, which explains the low search depth during midgame.

This game against WD was played after the fix, and finally GoK midgame performance is back to normal (+2.5 avg. search depth compared to WD):

https://lichess.org/vmwCfsKm#97
You should run more games to be sure. We can’t know for sure after one game. How is the automation project going?

Are attack tables stored separately per piece, or as one long string?

It was one of several games. Also did per-board tests, search depth increased by 1 ply in most cases.

Game #2 against WD (white), 92% vs. 89% accuracy: https://lichess.org/Wzmq5r8f#154

Attack tables are strings of 64 digits (number of attackers per square) and 128 digits (source square index of attacker with lowest value per square).

Automation is only 30% done. I started the PlayStore GoK Android version in parallel…

Last edited by ArnoHu (May 19, 2024 22:14:29)

birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

birdracerthree wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

ArnoHu wrote:

Draw between GoK (black) and White Dove, 10sec think time, both at 94% accuracy: https://lichess.org/ioJZkpXm#138

Rematch, tough fight, GoK(white) wins at 94% vs. 90% accuracy: https://lichess.org/ob5IeBCC#147

Game #3, GoK white, 97% vs. 92% accuracy

Game #4 was great, GoK black, 98% vs. 91% accuracy: https://lichess.org/qMkJuf25#100

Final game of the series on Scratch 3, 10sec think time. Another miraculous late-midgame escape by GoK (white), after trailing behind 6,0 (it will not always be so lucky, on the other hand WD did not see the mistakes at first either). 88% vs. 83% accuracy: https://lichess.org/mFVirrsW#145

GoK's latest version (white) in a low-accuracy but entertaining game against WD (10 sec). Same pattern again, GoK trailing behind during early midgame, enters endgame at roughly equal terms, then wins: https://lichess.org/X2Bkk8vk#149

The evaluation graph roughly correlated with the difference in search depth, not really surprising. During midgame GoK +1.5 in avg. search depth, later +3.

WD got its rook pinned at move 68, that was kind of strange.
*snip*
This game against WD was played after the fix, and finally GoK midgame performance is back to normal (+2.5 avg. search depth compared to WD):

https://lichess.org/vmwCfsKm#97
You should run more games to be sure. We can’t know for sure after one game. How is the automation project going?

Are attack tables stored separately per piece, or as one long string?

It was one of several games. Also did per-board tests, search depth increased by 1 ply in most cases.

Game #2 against WD (white), 92% vs. 89% accuracy: https://lichess.org/Wzmq5r8f#154

Attack tables are strings of 64 digits (number of attackers per square) and 128 digits (source square index of attacker with lowest value per square).

Automation is only 30% done. I started the PlayStore GoK Android version in parallel…
Are there any differences between the GoK app and Turbowarp GoK? GoK doesn’t have some openings played by humans (Ponziani, Fried Liver, incorrect Morphy Defense, Catalan, etc.)
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

GoK (Medium, black) vs. WD (P2), GoK up 4.9, blunders due to material gain (bishop) weighted higher than positional loss within horizon (Zwischenzug rendering quiescence insufficient). WD up 4.8 after that, but did not notice it either (according to eval bar), and lost the advantage in the next couple of moves, and with that the game: https://lichess.org/Z54hlCnd#156

I verified whether I could prevent GoK's blunders. At least for the 2nd one that would have been possible (just at the brink of Medium search horizon), but increasing positional weight over material would have been counterproductive in general. So I left it as it was, hoping that if GoK doesn't see it, the other engines won't as well.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

ArnoHu wrote:

It was one of several games. Also did per-board tests, search depth increased by 1 ply in most cases.

Game #2 against WD (white), 92% vs. 89% accuracy: https://lichess.org/Wzmq5r8f#154

Attack tables are strings of 64 digits (number of attackers per square) and 128 digits (source square index of attacker with lowest value per square).

Automation is only 30% done. I started the PlayStore GoK Android version in parallel…
Are there any differences between the GoK app and Turbowarp GoK? GoK doesn’t have some openings played by humans (Ponziani, Fried Liver, incorrect Morphy Defense, Catalan, etc.)

Android version will be nearly the same (a snapshot of a stable GoK version), but I will go sure think time is low old mobile devices, plus some minor look&feel changes, e.g. display-dimension related. GoK is touch-ready.

@Grijfland is the owner of GoK's opening book, I am sure he is open for suggestions.

Last edited by ArnoHu (May 20, 2024 11:24:47)

MoosenMooALot
Scratcher
46 posts

Scratch Chess Engine - Game of Kings

GoK 6.555 Turbowarp Blitz 2 vs. Stockfish Level 5 (lichess):
GoK white vs. Stockfish black:
GoK wins in 45 moves: https://lichess.org/AE89p9Cb/white#0
Stockfish white vs. GoK black:
GoK wins in 50 moves: https://lichess.org/nJaFmY8z/black#1
Fantastic job by GoK on that second game! With no bad moves and 98% accuracy, GoK did much better than I would've expected from such a small think time. I might try some against Stockfish Level 6 soon as GoK Blitz 2 is clearly better than level 5.
birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

Element defeats GoK
Yesterday, I decided to run a GoK vs Element match to test the new Four Knights Scotch against GoK (I didn't know how it would play the middlegame against GoK). In this game, Element defeats GoK in 57 moves!! Incredibly, Element sored a 99% accuracy game!

However, the only reason Element was is due to a GoK opening book error in this opening. More specifically, the line 53371329634602195843072252362936463622374337041354461430 should be 53371329634602195843072252362936463622374337041354461228 (f7f5?? replaced with d7d5). The line may continue 533713296346021958430722523629364636223743370413544612286226031226191019 (1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Nxe4 6. Nxe4 Qe7 7. f3 d5 8. Bb5 Bd7 9. Bxc6 bxc6). This is still an impressive win because White Dove and Element have both blundered out of a 2 pawns vs knight lead, but Element won a clean knight due to this bug.

Does this count as the first standard chess win against GoK on Turbowarp? Technically, yes, as neither engine was modified during the game in any way. However, I think Element winning a piece due to an opening book bug doesn't make the game “clean”. Feel free to express your thoughts regarding this.

Last edited by birdracerthree (May 20, 2024 23:07:20)

birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

I am currently going through GoK's opening book to make sure this doesn't happen again.

Edit : I'm glad I checked. I found a lot of errors, and I'm halfway through the book.

Last edited by birdracerthree (May 21, 2024 00:13:05)

MoosenMooALot
Scratcher
46 posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

Element defeats GoK
Yesterday, I decided to run a GoK vs Element match to test the new Four Knights Scotch against GoK (I didn't know how it would play the middlegame against GoK). In this game, Element defeats GoK in 57 moves!! Incredibly, Element sored a 99% accuracy game!

However, the only reason Element was is due to a GoK opening book error in this opening. More specifically, the line 53371329634602195843072252362936463622374337041354461430 should be 53371329634602195843072252362936463622374337041354461228 (f7f5?? replaced with d7d5). The line may continue 533713296346021958430722523629364636223743370413544612286226031226191019 (1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Nxe4 6. Nxe4 Qe7 7. f3 d5 8. Bb5 Bd7 9. Bxc6 bxc6). This is still an impressive win because White Dove and Element have both blundered out of a 2 pawns vs knight lead, but Element won a clean knight due to this bug.

Does this count as the first standard chess win against GoK on Turbowarp? Technically, yes, as neither engine was modified during the game in any way. However, I think Element winning a piece due to an opening book bug doesn't make the game “clean”. Feel free to express your thoughts regarding this.
GoK LOST?!?!?! I NEVER THOUGHT I'D LIVE TO SEE THIS DAY!
birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

MoosenMooALot wrote:

birdracerthree wrote:

Element defeats GoK
Yesterday, I decided to run a GoK vs Element match to test the new Four Knights Scotch against GoK (I didn't know how it would play the middlegame against GoK). In this game, Element defeats GoK in 57 moves!! Incredibly, Element sored a 99% accuracy game!

However, the only reason Element was is due to a GoK opening book error in this opening. More specifically, the line 53371329634602195843072252362936463622374337041354461430 should be 53371329634602195843072252362936463622374337041354461228 (f7f5?? replaced with d7d5). The line may continue 533713296346021958430722523629364636223743370413544612286226031226191019 (1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Nxe4 6. Nxe4 Qe7 7. f3 d5 8. Bb5 Bd7 9. Bxc6 bxc6). This is still an impressive win because White Dove and Element have both blundered out of a 2 pawns vs knight lead, but Element won a clean knight due to this bug.

Does this count as the first standard chess win against GoK on Turbowarp? Technically, yes, as neither engine was modified during the game in any way. However, I think Element winning a piece due to an opening book bug doesn't make the game “clean”. Feel free to express your thoughts regarding this.
GoK LOST?!?!?! I NEVER THOUGHT I'D LIVE TO SEE THIS DAY!
The question was never “if”, it was a matter of “when”. I linked these 5 games to you almost 2 months ago : https://scratch.mit.edu/discuss/post/7665285/ https://scratch.mit.edu/discuss/post/7717811/ https://scratch.mit.edu/discuss/post/7719831/ https://scratch.mit.edu/discuss/post/7752223/ https://scratch.mit.edu/discuss/post/7769979/

There are more games since then (thanks to White Dove), but these are the closest calls yet. One of them went into a winning king and pawn endgame.

The first “true” win is still on the table in my opinion.

Last edited by birdracerthree (May 21, 2024 01:14:37)

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

MoosenMooALot wrote:

birdracerthree wrote:

Element defeats GoK
Yesterday, I decided to run a GoK vs Element match to test the new Four Knights Scotch against GoK (I didn't know how it would play the middlegame against GoK). In this game, Element defeats GoK in 57 moves!! Incredibly, Element sored a 99% accuracy game!

However, the only reason Element was is due to a GoK opening book error in this opening. More specifically, the line 53371329634602195843072252362936463622374337041354461430 should be 53371329634602195843072252362936463622374337041354461228 (f7f5?? replaced with d7d5). The line may continue 533713296346021958430722523629364636223743370413544612286226031226191019 (1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. d4 exd4 5. Nxd4 Nxe4 6. Nxe4 Qe7 7. f3 d5 8. Bb5 Bd7 9. Bxc6 bxc6). This is still an impressive win because White Dove and Element have both blundered out of a 2 pawns vs knight lead, but Element won a clean knight due to this bug.

Does this count as the first standard chess win against GoK on Turbowarp? Technically, yes, as neither engine was modified during the game in any way. However, I think Element winning a piece due to an opening book bug doesn't make the game “clean”. Feel free to express your thoughts regarding this.
GoK LOST?!?!?! I NEVER THOUGHT I'D LIVE TO SEE THIS DAY!
The question was never “if”, it was a matter of “when”. I linked these 5 games to you almost 2 months ago : https://scratch.mit.edu/discuss/post/7665285/ https://scratch.mit.edu/discuss/post/7717811/ https://scratch.mit.edu/discuss/post/7719831/ https://scratch.mit.edu/discuss/post/7752223/ https://scratch.mit.edu/discuss/post/7769979/

There are more games since then (thanks to White Dove), but these are the closest calls yet. One of them went into a winning king and pawn endgame.

The first “true” win is still on the table in my opinion.

Congrats to Element for a perfect game! This is how it would have ended without the opening book issue (draw at 96% accuracy each): https://lichess.org/KRzlWjdw#77

Worth mentioning that White Dove has won against GoK as well, both on Scratch 3 and in the 960 tournament.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

MoosenMooALot wrote:

GoK 6.555 Turbowarp Blitz 2 vs. Stockfish Level 5 (lichess):
GoK white vs. Stockfish black:
GoK wins in 45 moves: https://lichess.org/AE89p9Cb/white#0
Stockfish white vs. GoK black:
GoK wins in 50 moves: https://lichess.org/nJaFmY8z/black#1
Fantastic job by GoK on that second game! With no bad moves and 98% accuracy, GoK did much better than I would've expected from such a small think time. I might try some against Stockfish Level 6 soon as GoK Blitz 2 is clearly better than level 5.

Thanks for the results! GoK (Difficult) against Stockfish level 6 and 7 often produces interesting games as well.

Last edited by ArnoHu (May 21, 2024 04:01:01)

ababoin07
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

Could someone list me one by one all the goK improvements in its course?
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

ababoin07 wrote:

Could someone list me one by one all the goK improvements in its course?

This forum posting provides an overview:
https://scratch.mit.edu/discuss/post/2967632/

And of course here is its github history:
https://github.com/ArnoHue/scratch/commits/master/chess/Engine.scratch
birdracerthree
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

Why doesn’t GoK see the checkmate here? White Dove sees it on ply 8.
ababoin07
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

ababoin07 wrote:

Could someone list me one by one all the goK improvements in its course?

This forum posting provides an overview:
https://scratch.mit.edu/discuss/post/2967632/

And of course here is its github history:
https://github.com/ArnoHue/scratch/commits/master/chess/Engine.scratch
Thanks you,
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

Why doesn’t GoK see the checkmate here? White Dove sees it on ply 8.

It sees it at ply 1 in 4 seconds. Which level were you on? But maybe you ran into the ply 1 checkmate search timeout which I had reduced by your input ;-) However it should still find it later, latest at depth 8. Maybe TT reasons after limited ply 1 search.

Last edited by ArnoHu (May 21, 2024 09:57:40)

Powered by DjangoBB