Bug in my engine

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Ronald
Posts: 160
Joined: Tue Jan 23, 2018 10:18 am
Location: Rotterdam
Full name: Ronald Friederich

Re: Bug in my engine

Post by Ronald »

Hi,

I expect you get a "position startpos moves e2e4..." etc. from lichess with every new position. If you replay it afterwards with a "position fen" you don't have the positions that happened before the current position. If that is the case there might be a bug in your repetition detection, which will be executed in lichess, but not with the position fen.

Ronald
User avatar
JimmyRustles
Posts: 32
Joined: Sun May 05, 2019 11:24 pm
Full name: Steven Griffin

Re: Bug in my engine

Post by JimmyRustles »

Hi Ronald,

I've thought about that, but I paste the fen from before the repetition started so the threefold repetition should still work the same. Also, when I try it in winboard, I paste the full game and still can't reproduce the problem.
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Bug in my engine

Post by Guenther »

JimmyRustles wrote: Sat Dec 21, 2019 11:54 am Hi Ronald,

I've thought about that, but I paste the fen from before the repetition started so the threefold repetition should still work the same. Also, when I try it in winboard, I paste the full game and still can't reproduce the problem.
Steven, I could reproduce a few full test games with that bug yesterday and will post a link to it in a few minutes here.
The main post will be in the BanksiaGUI thread in the general forum, because it also refers to a bug in the current Beta.
I will also add the logs for download at my RWBC site.

@Ronald, I had already yesterday attached a post, which had the full move history, not only a FEN and still I got the bug behaviour
on my machine.
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Bug in my engine

Post by Guenther »

Guenther wrote: Sat Dec 21, 2019 12:31 pm
Steven, I could reproduce a few full test games with that bug yesterday and will post a link to it in a few minutes here.
The main post will be in the BanksiaGUI thread in the general forum, because it also refers to a bug in the current Beta.
I will also add the logs for download at my RWBC site.
http://talkchess.com/forum3/viewtopic.p ... 07#p823107
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
User avatar
JimmyRustles
Posts: 32
Joined: Sun May 05, 2019 11:24 pm
Full name: Steven Griffin

Re: Bug in my engine

Post by JimmyRustles »

Thanks a lot for doing the tests with Raven, Guenther. I suspect it's a problem with the TT and mate scores. I'm going to try not using the TT when the TT score is mate and see if it fixes the bug. If it works, it shouldn't affect playing strength much, I don't think.
User avatar
Ronald
Posts: 160
Joined: Tue Jan 23, 2018 10:18 am
Location: Rotterdam
Full name: Ronald Friederich

Re: Bug in my engine

Post by Ronald »

I took a quick look at the function isThreefold() and I saw that a true is returned after numrepeats >= 3. A threefold repetition is reached after 2 repetitions of a position however. It will probably not be the cause of the bug you are trying to solve, but I think it's not correct.
User avatar
JimmyRustles
Posts: 32
Joined: Sun May 05, 2019 11:24 pm
Full name: Steven Griffin

Re: Bug in my engine

Post by JimmyRustles »

Thanks Ronald. The numrepeats variable should probably be called numoccurences. It counts the number of occurences of the position in the stack, not the number of repeats. So 3 occurences is equal to 2 repetitions which is why it's >= 3 and not 2.
User avatar
JimmyRustles
Posts: 32
Joined: Sun May 05, 2019 11:24 pm
Full name: Steven Griffin

Re: Bug in my engine

Post by JimmyRustles »

Guenther wrote: Sat Dec 21, 2019 1:18 pm
Guenther wrote: Sat Dec 21, 2019 12:31 pm
Steven, I could reproduce a few full test games with that bug yesterday and will post a link to it in a few minutes here.
The main post will be in the BanksiaGUI thread in the general forum, because it also refers to a bug in the current Beta.
I will also add the logs for download at my RWBC site.
http://talkchess.com/forum3/viewtopic.p ... 07#p823107
Hi Guenther, I'm pretty sure I've fixed the bug now. I just tried it in 40 lichess games and the bug didn't happen in any of them.

Would you be able to try it with a couple of positions where it had the bug before and see if it's working now please?

I've compiled a version of Raven with the bug fix that you can use to test it, it's here: https://github.com/sgriffin53/raven/tree/master/temp

Thanks again for all the testing you've done. Hopefully this should fix the bug.
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Bug in my engine

Post by Guenther »

JimmyRustles wrote: Sun Dec 22, 2019 4:57 am
Guenther wrote: Sat Dec 21, 2019 1:18 pm
Guenther wrote: Sat Dec 21, 2019 12:31 pm
Steven, I could reproduce a few full test games with that bug yesterday and will post a link to it in a few minutes here.
The main post will be in the BanksiaGUI thread in the general forum, because it also refers to a bug in the current Beta.
I will also add the logs for download at my RWBC site.
http://talkchess.com/forum3/viewtopic.p ... 07#p823107
Hi Guenther, I'm pretty sure I've fixed the bug now. I just tried it in 40 lichess games and the bug didn't happen in any of them.

Would you be able to try it with a couple of positions where it had the bug before and see if it's working now please?

I've compiled a version of Raven with the bug fix that you can use to test it, it's here: https://github.com/sgriffin53/raven/tree/master/temp

Thanks again for all the testing you've done. Hopefully this should fix the bug.
I checked a few positions and the buggy behaviour seems corrected.
To be sure I will play some test games too, but probably after xmas.

I see that your Lichess rating in bullet received some nice +50 already :)
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
User avatar
JimmyRustles
Posts: 32
Joined: Sun May 05, 2019 11:24 pm
Full name: Steven Griffin

Re: Bug in my engine

Post by JimmyRustles »

Guenther wrote: Sun Dec 22, 2019 10:37 am
JimmyRustles wrote: Sun Dec 22, 2019 4:57 am
Guenther wrote: Sat Dec 21, 2019 1:18 pm
Guenther wrote: Sat Dec 21, 2019 12:31 pm
Steven, I could reproduce a few full test games with that bug yesterday and will post a link to it in a few minutes here.
The main post will be in the BanksiaGUI thread in the general forum, because it also refers to a bug in the current Beta.
I will also add the logs for download at my RWBC site.
http://talkchess.com/forum3/viewtopic.p ... 07#p823107
Hi Guenther, I'm pretty sure I've fixed the bug now. I just tried it in 40 lichess games and the bug didn't happen in any of them.

Would you be able to try it with a couple of positions where it had the bug before and see if it's working now please?

I've compiled a version of Raven with the bug fix that you can use to test it, it's here: https://github.com/sgriffin53/raven/tree/master/temp

Thanks again for all the testing you've done. Hopefully this should fix the bug.
I checked a few positions and the buggy behaviour seems corrected.
To be sure I will play some test games too, but probably after xmas.

I see that your Lichess rating in bullet received some nice +50 already :)
Great. Thanks a lot. I'm so glad to have this bug finally fixed. :)