How do you fix this.

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

lauriet
Posts: 199
Joined: Sun Nov 03, 2013 9:32 am

How do you fix this.

Post by lauriet »

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: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: How do you fix this.

Post by Ras »

You should recognise repetitions in the search tree and e.g. score them with 0.
Rasmus Althoff
https://www.ct800.net
lauriet
Posts: 199
Joined: Sun Nov 03, 2013 9:32 am

Re: How do you fix this.

Post by lauriet »

I do, and the program avoids it for a while but eventually fails.....
Maybe I should check the 3 fold code.
Hmm ?
Terje
Posts: 347
Joined: Tue Nov 19, 2019 4:34 am
Location: https://github.com/TerjeKir/weiss
Full name: Terje Kirstihagen

Re: How do you fix this.

Post by Terje »

Did your engine give a score of 0 when it played the drawing move? The turns leading up to it?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: How do you fix this.

Post by bob »

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: 199
Joined: Sun Nov 03, 2013 9:32 am

Re: How do you fix this.

Post by lauriet »

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: 4317
Joined: Tue Apr 03, 2012 4:28 pm

Re: How do you fix this.

Post by chrisw »

lauriet wrote: Sun May 17, 2020 12:17 am 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: 199
Joined: Sun Nov 03, 2013 9:32 am

Re: How do you fix this.

Post by lauriet »

I'm listening :?:
Pio
Posts: 334
Joined: Sat Feb 25, 2012 10:42 pm
Location: Stockholm

Re: How do you fix this.

Post by Pio »

lauriet wrote: Sun May 17, 2020 9: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: 199
Joined: Sun Nov 03, 2013 9:32 am

Re: How do you fix this.

Post by lauriet »

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

:oops: :oops: :oops: