Repetition score issue when opponent things different.

Discussion of chess software programming and technical issues.

Moderator: Ras

OliverBr
Posts: 812
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Repetition score issue when opponent things different.

Post by OliverBr »

Move 28, About equal position.
Now there is a tactical situation where white likes to eat the black bishop.
This will result in an opportunity for black to force 3-fold repetition, of which white is aware (as we can see with all those 0.00)

Now white "accepts", because 0.00 is the best it can get for it.
It doesn't work, because black does not play along. Qxc5 loses the game.
I guess the break in symmetry is, that black is the one that will decide to make a 3-fold repetition and not white.

What is the best practice to avoid this dilemma?

Example Position:
[d]3r3r/pq3kp1/1n2p1p1/2b2pP1/5P2/1P3R1P/P2B1QK1/1N1R4 w - - 0 28


Output:

Code: Select all

 36	  0.00 	291.8M	1:20.33	1. Qxc5 Rxh3 2. Qc3 Rdh8 3. Rc1 Rh2 4. Kg1 Rh1 5. Kg2 R8h2 6. Kg3 Qe4 7. Rxh1 Rxh1 8. Qc7 Kg8 9. Qd8 Kf7 10. Qc7  
 35	  0.00 	167.4M	0:45.81	1. Qxc5 Rxh3 2. Qc3 Rdh8 3. Rc1 Rh2 4. Kg1 Rh1 5. Kf2 R8h2 6. Kg3 Qe4 7. Rxh1 Rxh1 8. Qc7 Kg8 9. Bc3 Rh3 10. Kxh3 Qxf3 11. Kh2 Qf2 12. Kh1 Qf1 13. Kh2 Qf2  
 34	  0.00 	124.3M	0:33.95	1. Qxc5 Rxh3 2. Qc3 Rdh8 3. Rc1 Rh2 4. Kg1 Rh1 5. Kf2 R8h2 6. Kg3 Rh3 7. Kf2 R1h2 8. Kg1 Rh1 9. Kf2  
 33	  0.00 	105.7M	0:28.95	1. Qxc5 Rxh3 2. Qc3 Rdh8 3. Rc1 Rh2 4. Kg1 Rh1 5. Kf2 R8h2 6. Kg3 Rh3 7. Kf2 R1h2 8. Kg1 Rh1 9. Kf2  
 32	  0.00 	90.7M  	0:25.03	1. Qxc5 Rxh3 2. Qc3 Rdh8 3. Rc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Rxe3 e5 5. Rc3 exf4 6. Bxf4 Rxd1 7. Rc7 Rd7 8. Rxb7 Rxb7  
 14	+0.48 	314096	0:00.09	1. Qxc5 Rxh3 2. Qe3 Nd5 3. Kxh3 Nxe3 4. Rxe3 e5 5. Rc3 exf4 6. Bxf4 Rxd1 7. Rc7 Rd7 8. Rxb7 
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
User avatar
RubiChess
Posts: 642
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: Repetition score issue when opponent things different.

Post by RubiChess »

OliverBr wrote: Mon Jul 07, 2025 8:57 pm What is the best practice to avoid this dilemma?
Improving evaluation by using a NN. It will easily help the search for black to ignore being down a bishop and go for the win.
Pio
Posts: 337
Joined: Sat Feb 25, 2012 10:42 pm
Location: Stockholm

Re: Repetition score issue when opponent things different.

Post by Pio »

OliverBr wrote: Mon Jul 07, 2025 8:57 pm Move 28, About equal position.
Now there is a tactical situation where white likes to eat the black bishop.
This will result in an opportunity for black to force 3-fold repetition, of which white is aware (as we can see with all those 0.00)

Now white "accepts", because 0.00 is the best it can get for it.
It doesn't work, because black does not play along. Qxc5 loses the game.
I guess the break in symmetry is, that black is the one that will decide to make a 3-fold repetition and not white.

What is the best practice to avoid this dilemma?

Example Position:
[d]3r3r/pq3kp1/1n2p1p1/2b2pP1/5P2/1P3R1P/P2B1QK1/1N1R4 w - - 0 28


Output:

Code: Select all

 36	  0.00 	291.8M	1:20.33	1. Qxc5 Rxh3 2. Qc3 Rdh8 3. Rc1 Rh2 4. Kg1 Rh1 5. Kg2 R8h2 6. Kg3 Qe4 7. Rxh1 Rxh1 8. Qc7 Kg8 9. Qd8 Kf7 10. Qc7  
 35	  0.00 	167.4M	0:45.81	1. Qxc5 Rxh3 2. Qc3 Rdh8 3. Rc1 Rh2 4. Kg1 Rh1 5. Kf2 R8h2 6. Kg3 Qe4 7. Rxh1 Rxh1 8. Qc7 Kg8 9. Bc3 Rh3 10. Kxh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1h2 7. Kg1  
 17	+0.07 	552146	0:00.16	1. Qxc5 Rxh3 2. Qe3 Nd5 3. Kxh3 Nxe3 4. Rxe3 e5 5. Rde1 exf4 6. Re7 Qxe7 7. Rxe7 Kxe7 8. Bxf4 Rd3 9. Kh4 a5 10. Be5 Kf7  
 16	+0.05 	510430	0:00.14	1. Qxc5 Rxh3 2. Qe3 Nd5 3. Kxh3 Nxe3 4. Rxe3 e5 5. Rde1 exf4 6. Re7 Qxe7 7. Rxe7 Kxe7 8. Bxf4 Rd3 9. Kh4 Ke6 10. Nd2  
 15	+0.48 	333523	0:00.10	1. Qxc5 Rxh3 2. Qe3 Nd5 3. Kxh3 Nxe3 4. Rxe3 e5 5. Rc3 exf4 6. Bxf4 Rxd1 7. Rc7 Rd7 8. Rxb7 Rxb7  
 14	+0.48 	314096	0:00.09	1. Qxc5 Rxh3 2. Qe3 Nd5 3. Kxh3 Nxe3 4. Rxe3 e5 5. Rc3 exf4 6. Bxf4 Rxd1 7. Rc7 Rd7 8. Rxb7 
The way I handle it, is to give the side having the option to draw, a slight advantage score wise. In that way the leading side will always favour positions where it cannot loose and the loosing side will always have to try to get out of the trouble.
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Repetition score issue when opponent things different.

Post by hgm »

I don't think the possibility to force a repetition has any significance for these kind of problems. Basically it is just that the engine finds what it thinks is the best move, and eventually that best move turns out to be losing. This doesn't even have to be an error; there always is a best move, also in positions of games that you lose. It would only be an error if a better move had been available and was not recognized as such.

If the reported score for QxB would have been +0.5 or -0.5 because there was no possibility for black to force a repetition, you could still ask the question "how come white did lose when the score was so close to equality?". It just failed to recognize the best continuation for black, counting on poor defense, and thus over-estimating its own score. It this case the poor defense happened to be going for the perpetual, but it could really have been anything else as well. It just overlooked black had better moves when he forced the perpetual.
Pio
Posts: 337
Joined: Sat Feb 25, 2012 10:42 pm
Location: Stockholm

Re: Repetition score issue when opponent things different.

Post by Pio »

hgm wrote: Sat Jul 12, 2025 10:20 am I don't think the possibility to force a repetition has any significance for these kind of problems. Basically it is just that the engine finds what it thinks is the best move, and eventually that best move turns out to be losing. This doesn't even have to be an error; there always is a best move, also in positions of games that you lose. It would only be an error if a better move had been available and was not recognized as such.

If the reported score for QxB would have been +0.5 or -0.5 because there was no possibility for black to force a repetition, you could still ask the question "how come white did lose when the score was so close to equality?". It just failed to recognize the best continuation for black, counting on poor defense, and thus over-estimating its own score. It this case the poor defense happened to be going for the perpetual, but it could really have been anything else as well. It just overlooked black had better moves when he forced the perpetual.
I agree with you that it might not help out so much in this position, but white might not have gone in to this position in first place, if it had seen black could force a draw. Maybe white would have got into a position where white could have forced the draw and who knows, maybe win the game.
OliverBr
Posts: 812
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Repetition score issue when opponent things different.

Post by OliverBr »

RubiChess wrote: Wed Jul 09, 2025 6:20 am
OliverBr wrote: Mon Jul 07, 2025 8:57 pm What is the best practice to avoid this dilemma?
Improving evaluation by using a NN. It will easily help the search for black to ignore being down a bishop and go for the win.
Of course, an NN would probably help, but:

OliThink is a minimalistic chess engine with 1294 lines of code, that doesn't use any precomputed information or external "help". It even creates its Kindergarten Bitboards itself during runtime. A kind of bootstrapping.
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
OliverBr
Posts: 812
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Repetition score issue when opponent things different.

Post by OliverBr »

Pio wrote: Wed Jul 09, 2025 1:47 pm The way I handle it, is to give the side having the option to draw, a slight advantage score wise. In that way the leading side will always favour positions where it cannot loose and the loosing side will always have to try to get out of the trouble.
Yes, I know of this, but I am fear, this breaks evaluation symmetry. I have seen it, but on only a few engines. Please correct me if I am wrong. Of course this doesn't automatically mean it could be a good way to prevent this phenomen.
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
OliverBr
Posts: 812
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Repetition score issue when opponent things different.

Post by OliverBr »

hgm wrote: Sat Jul 12, 2025 10:20 am It just failed to recognize the best continuation for black, counting on poor defense, and thus over-estimating its own score. It this case the poor defense happened to be going for the perpetual, but it could really have been anything else as well. It just overlooked black had better moves when he forced the perpetual.
You may be have point here.
Later I saw a another example, looking even more terrible (OliThink white, Bagatur black)

[d]6k1/5pp1/7p/2Q2P2/P2p2nq/1P1PrB2/2P3KP/5R2 w - - 1 57

It looks as black could force repetition, but white is not accepting it and jumping around with the queen in the free space on the left upper side.
All engines say "Draw":

After a couple of those OliThink comes the idea to play "57. Qc7" instead of "57. Qd6" (which is preferred by all engines, including OliThink when starting from this position).
Now: "57. Qc7" is losing,

[d]6k1/2Q2pp1/7p/5P2/P2p2nq/1P1PrB2/2P3KP/5R2 b - - 2 1

because black's answer "57 ... Ne5" is winning.
Now, the winning move "57 ... Ne5" is obviously not easy to find. Black has to let go of its mate threat. Only top engines find it. And Bagatur.

This confirms your point: White doesn't see black's best move and thus loses.

But there is still a repetition issue:
Why play "57. Qc7" at all and not "56. Qd6"?
As said before: Analyzing the position alone, OliThink always plays "57. Qd6". The "57. Qc7" idea comes only when staring a couple of moves sooner, when OliThink was already 0.00 scoring the position and never left the 0.00

I have never seen this with other engines. How can this be avoided?
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
OliverBr
Posts: 812
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Repetition score issue when opponent things different.

Post by OliverBr »

The position with "bm Ne5" is quite fascinating, because either an engine finds it immediately or never.
An analyzis of this position may present the issue better:
White finds at depth==12 with "Re5" a draw score and never leaves it.
At search depth=30 it is still the same move, score and pv.

It sounds logical, because the repetition is much sooner, so is the tree cut.
But Is it?

Code: Select all

 30	  0.00 	18.7M  	0:04.73	Re5 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h3  
 18	  0.00 	692902	0:00.20	Re5 2. Bxg4 Qxg4 3. Kh1 Qh3 4. Qb8 Kh7 5. Kg1 Qg4 6. Kh1 Qh3  
 17	  0.00 	455533	0:00.13	Re5 2. Bxg4 Qxg4 3. Kh1 Qh3 4. Qb8 Kh7 5. Kg1 Qg4 6. Kh1 Qh3  
 16	  0.00 	339518	0:00.10	Re5 2. Bxg4 Qxg4 3. Kh1 Qh3 4. Qb8 Kh7 5. Kg1 Qg4 6. Kh1 Qh3  
 15	  0.00 	248154	0:00.07	Re5 2. Bxg4 Qxg4 3. Kh1 Qh3 4. Qb8 Kh7 5. Kg1 Qg4 6. Kh1 Qh3  
 14	  0.00 	199547	0:00.06	Re5 2. Bxg4 Qxg4 3. Kh1 Qh3 4. Qb8 Kh7 5. Kg1 Qg4 6. Kh1 Qh3  
 13	  0.00 	163846	0:00.05	Re5 2. Bxg4 Qxg4 3. Kh1 Qh3 4. Qb8 Kh7 5. Kg1 Qg4 6. Kh1 Qh3  
 12	  0.00 	142651	0:00.04	Re5 2. Bxg4 Qxg4 3. Kh1 Qh3 4. Qb8 Kh7 5. Kg1 Qg4 6. Kh1 Qh3  
 11	 -0.03 	42516  	0:00.01	Re7 2. Qg3 Ne3 3. Kf2 Qxg3 4. hxg3 Nxf1 5. Kxf1 Rc7 6. Bd1 Kf8 7. Kf2 Ke7 8. g4  
 10	 -0.03 	33339  	0:00.01	Re7 2. Qg3 Ne3 3. Kg1 Qxg3 4. hxg3 Nxf1 5. Kxf1 Rc7 6. Bd1 Kf8 7. g4 Ke7 8. Kf2  
  9	+0.17 	20103  	0:00.01	Re7 2. Qg3 Ne3 3. Kg1 Qxg3 4. hxg3 Nxf1 5. Kxf1 Rc7 6. Bd1 Rc6  
  8	 -1.18 	6901    	0:00.00	Rxf3 2. Rxf3 Ne3 3. Rxe3 dxe3 4. Kf3 Qf2 5. Ke4 e2 6. Qc8 Kh7  
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink