How do you fix this.

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
lauriet
Posts: 196
Joined: Sun Nov 03, 2013 8:32 am
Contact:

How do you fix this.

Post by lauriet » Sat May 16, 2020 1:05 pm

It's the end game. White is 3 pawns ahead, but black keeps threatening to take 1 of 2 pawns.. white shuffles it's king back and forth to save both pawns resulting in 3 fold rep. If white gave up one pawn he could win the game, but it's beyond the horizon.
Any way to remedy this ???

Ras
Posts: 1381
Joined: Tue Aug 30, 2016 6:19 pm
Full name: Rasmus Althoff
Contact:

Re: How do you fix this.

Post by Ras » Sat May 16, 2020 1:10 pm

You should recognise repetitions in the search tree and e.g. score them with 0.
Rasmus Althoff
https://www.ct800.net

lauriet
Posts: 196
Joined: Sun Nov 03, 2013 8:32 am
Contact:

Re: How do you fix this.

Post by lauriet » Sat May 16, 2020 10:17 pm

I do, and the program avoids it for a while but eventually fails.....
Maybe I should check the 3 fold code.
Hmm ?

Terje
Posts: 172
Joined: Tue Nov 19, 2019 3:34 am
Location: https://github.com/TerjeKir/weiss
Full name: Terje Kirstihagen

Re: How do you fix this.

Post by Terje » Sun May 17, 2020 12:02 am

Did your engine give a score of 0 when it played the drawing move? The turns leading up to it?

bob
Posts: 20896
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: How do you fix this.

Post by bob » Sun May 17, 2020 1:07 am

Should go like this:

You should be at +3.00 (3 pawns ahead) plus whatever positional score you add in.

As you make moves without pushing a pawn, eventually you will run into the 50 move rule and draw. BUT, your program should realize that 3-fold or 50 move rule is 0.00, which is < 3.00. And also less than 2.00 (if you give up a pawn).

About the only way I could see your case happening is if your 3-fold rep code is broken. Or else your search sees the 3-fold rep but scores it incorrectly...

lauriet
Posts: 196
Joined: Sun Nov 03, 2013 8:32 am
Contact:

Re: How do you fix this.

Post by lauriet » Sun May 17, 2020 3:33 am

Yep, it does return zero.....and I couldn't agree more with your reasoning ??
When I set up the position again and try to reproduce it.....guess what !! I can't yet. So there must be
a bug somewhere. Ahh well, gives me something to think about while the golf course is closed.

chrisw
Posts: 3105
Joined: Tue Apr 03, 2012 2:28 pm

Re: How do you fix this.

Post by chrisw » Sun May 17, 2020 7:04 am

lauriet wrote:
Sat May 16, 2020 10:17 pm
I do, and the program avoids it for a while but eventually fails.....
Maybe I should check the 3 fold code.
Hmm ?
Why 3-fold in the tree? 2-fold is enough

lauriet
Posts: 196
Joined: Sun Nov 03, 2013 8:32 am
Contact:

Re: How do you fix this.

Post by lauriet » Sun May 17, 2020 7:11 am

I'm listening :?:

Pio
Posts: 136
Joined: Sat Feb 25, 2012 9:42 pm
Location: Stockholm
Contact:

Re: How do you fix this.

Post by Pio » Sun May 17, 2020 7:29 am

lauriet wrote:
Sun May 17, 2020 7:11 am
I'm listening :?:
I think your problem could be that you maybe only look for 3-folds in the search path from your current position. You should look back in the history of previous moves until a pawn push, a capture or a castling has taken place since those are irreversible.

If this is the problem you might see a correct draw in the beginning but when you passes (have played) the position that Will repeat, the engine still thinks it can repeat 3 times ...

lauriet
Posts: 196
Joined: Sun Nov 03, 2013 8:32 am
Contact:

Re: How do you fix this.

Post by lauriet » Mon May 18, 2020 2:50 am

Yes, you guessed it, I found a bug.
Or should I say a dumb logic mistake.

:oops: :oops: :oops:

Post Reply