Your best bug ?

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.
G.B. Harms
Posts: 42
Joined: Sat Aug 08, 2009 12:18 pm
Location: Almere

Re: Your best bug ?

Post by G.B. Harms » Wed Aug 08, 2012 7:13 pm

Rebel wrote:The best bugs are those who produce ELO.

Today my thoughts went back to a fun moment during the WCCC 1993 in Munich and the game I played against Chrilly, Rebel vs Nimzo. After xx moves the game went into an unclear but equal ending and here Chrilly started to comment about every move Nimzo played saying Nimzo had a bug and that's why it played that move. And in the end Nimzo won the game, Chrilly having big fun telling everybody he won because of a bug.

Now those who know Chrilly and his sense of humor will realize you never can be sure if he is not pulling your leg but if true that's the kind of bug you want to keep.

I have one of my own, I am aware of it since the 90's, eventually after a long debugging process found the bug, but in order to fix it would lose so much speed that Rebel would lose 30-40 elo points and thus I left it and it's still present until this day. Consider the diagram and its analysis.
[d]k7/8/8/4b3/8/5K2/7p/8 w - -

00:00:00 1.00 -12.93 5.Ke4
00:00:00 1.07 -0.03 5.Kg2

It's clear the chess knowledge is OK, Kg2 moves into the quadrant so a draw. But then search is going to spoil it all:

Code: Select all

 00:00:00   2.00  -0.03  5.Kg2 Kb7 
 00:00:00   3.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 Kc6 8.Kf3 h1 9.Ke2 
                         Qg2 10.Kd1 Qh1 11.Kd2 Qg2 12.Kd1 Qh1 13.Kd2 
                         Qg2 
 00:00:00   4.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 h1 8.Kxh1 
 00:00:00   5.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 h1 8.Kxh1 
 00:00:00   6.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc6 7.Kg2 Kd6 8.Kh1 Kd5 9.Kg2 
                         Kc4 10.Kf3 h1 11.Ke3 Qh3 12.Ke4 Qe6 
 00:00:00   7.00  -0.03  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kc6 8.Kh1 Kd5 9.Kg2 
                         h1 10.Kxh1 
 00:00:00   8.00  -12.99  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kc6 8.Kf3 h1 9.Ke2 
                          Qg2 10.Kd1 Qh1 11.Ke2 Qg2 12.Kd1 Qh1 
 00:00:00   8.01  -12.75  5.Ke4 Bd6 6.Kf3 h1=Q 
 00:00:00   9.00  -13.57  5.Ke4 Bc3 6.Kd3 Bf6 7.Ke4 h1=Q 
 00:00:00   9.01  -13.57  5.Kg2 
 00:00:00   9.01  -13.57  5.Kg2 
 00:00:00   9.04  -13.16  5.Kg4 h1=Q 
 00:00:00  10.00  -13.16  5.Kg4 h1=Q 
 00:00:00  10.02  -13.16  5.Kg2 
 00:00:00  10.02  -13.16  5.Kg2 
 00:00:00  11.00  -13.52  5.Kg4 h1=Q 
 00:00:00  11.01  -13.52  5.Kg2 
 00:00:00  11.01  -13.52  5.Kg2 
 00:00:00  11.01  -0.03  5.Kg2 Ka7 6.Kh1 Kb8 7.Kg2 Kc7 8.Kh1 Kd6 9.Kg2 
                         Kc5 10.Kh1 Kd4 11.Kg2 Kc4 12.Kh1 Kd3 13.Kg2 
                         Ke4 14.Kh1 Kd3 15.Kg2 Ke4 16.Kh1 
 00:00:00  12.00  -14.02  5.Kg2 Ka7 6.Kh1 Kb8 7.Kg2 Kc7 8.Kh1 Kd6 9.Kg2 
                          Kc5 10.Kf3 h1 11.Ke2 Qg2 12.Kd1 Qf3 13.Kc1 
                          Qf1 14.Kc2 Qe2 15.Kc1 Qe3 16.Kd1 Qd4 
 00:00:00  12.01  -13.52  5.Kg4 h1=Q 
 00:00:00  13.00  -13.47  5.Kg4 h1=Q 
 00:00:00  14.00  -13.55  5.Kg4 Bc3 6.Kf5 h1=Q 
 00:00:00  14.01  -13.55  5.Kg2 
 00:00:00  14.01  -13.55  5.Kg2 
 00:00:01  15.00  -M11  5.Kg4 Bc3 6.Kf5 h1=Q 
 00:00:01  15.01  -M11  5.Kg2 
 00:00:01  15.01  -M11  5.Kg2 
 00:00:01  15.01  -0.03  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bd6 8.Kh1 Kc6 9.Kg2 
                         Kc5 10.Kh1 Bf4 11.Kg2 Kd5 12.Kh1 Bd6 13.Kg2 
                         Be5 14.Kh1 Bf4 15.Kg2 Be5 16.Kh1 
 00:00:02  16.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bd6 8.Kh1 Kc6 9.Kg2 
                          Kd5 10.Kh1 Be5 11.Kg2 Bf4 12.Kf3 h1 13.Kxf4 
                          Qe4 14.Kg5 Qd4 15.Kf5 Qd3 16.Kf4 Qe4 
 00:00:02  17.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bf4 8.Kh1 Be5 9.Kg2 
                          Bf4 10.Kh1 
 00:00:02  18.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kb6 8.Kh1 Kc5 9.Kg2 
                          Kc6 10.Kh1 Kd5 11.Kg2 Bd6 12.Kh1 Be5 13.Kg2 
                          Bd6 14.Kh1 
 00:00:02  19.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bf4 8.Kh1 Kc6 9.Kg2 
                          Bd6 10.Kh1 Kc5 11.Kg2 Kd5 12.Kh1 Be5 13.Kg2 
                          Bd6 14.Kh1 Be5 15.Kg2 
 00:00:03  20.00  -0.04  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kb7 8.Kh1 Kc6 9.Kg2 
                         Kd5 10.Kh1 Bf4 11.Kg2 Bd6 12.Kh1 Bf4 13.Kg2 
                         Bd6 14.Kh1 
 00:00:15  21.00  -0.04  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kc5 8.Kh1 Kd5 9.Kg2 
                         Bf4 10.Kh1 Bd6 11.Kg2 Ke4 12.Kh1 Be5 13.Kg2 
                         Bf4 14.Kh1 Bd6 15.Kg2 Kd3 16.Kh1 Bf4 
 00:00:16  22.00  -13.01  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kc5 8.Kh1 Kd5 9.Kg2 
                          Bf4 10.Kh1 Bd6 11.Kg2 Bf4 12.Kh1 Bd6 13.Kg2 
 00:00:19  23.00  -7.15  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kb5 8.Kh1 Bf4 9.Kg2 
                         Kb4 10.Kh1 Kc5 11.Kg2 Kd5 12.Kh1 Kd4 13.Kg2 
                         Kc3 14.Kh1 Kd3 15.Kg2 Kd2 16.Kh1 Ke3 
What's your best bug ?
Something like:

next_depth = max(depth++, 32)


Because 'max' is a macro and not a function and I did not know that.

G.B. Harms
Posts: 42
Joined: Sat Aug 08, 2009 12:18 pm
Location: Almere

Re: Your best bug ?

Post by G.B. Harms » Wed Aug 08, 2012 7:29 pm

G.B. Harms wrote:
Rebel wrote:The best bugs are those who produce ELO.

Today my thoughts went back to a fun moment during the WCCC 1993 in Munich and the game I played against Chrilly, Rebel vs Nimzo. After xx moves the game went into an unclear but equal ending and here Chrilly started to comment about every move Nimzo played saying Nimzo had a bug and that's why it played that move. And in the end Nimzo won the game, Chrilly having big fun telling everybody he won because of a bug.

Now those who know Chrilly and his sense of humor will realize you never can be sure if he is not pulling your leg but if true that's the kind of bug you want to keep.

I have one of my own, I am aware of it since the 90's, eventually after a long debugging process found the bug, but in order to fix it would lose so much speed that Rebel would lose 30-40 elo points and thus I left it and it's still present until this day. Consider the diagram and its analysis.
[d]k7/8/8/4b3/8/5K2/7p/8 w - -

00:00:00 1.00 -12.93 5.Ke4
00:00:00 1.07 -0.03 5.Kg2

It's clear the chess knowledge is OK, Kg2 moves into the quadrant so a draw. But then search is going to spoil it all:

Code: Select all

 00:00:00   2.00  -0.03  5.Kg2 Kb7 
 00:00:00   3.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 Kc6 8.Kf3 h1 9.Ke2 
                         Qg2 10.Kd1 Qh1 11.Kd2 Qg2 12.Kd1 Qh1 13.Kd2 
                         Qg2 
 00:00:00   4.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 h1 8.Kxh1 
 00:00:00   5.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 h1 8.Kxh1 
 00:00:00   6.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc6 7.Kg2 Kd6 8.Kh1 Kd5 9.Kg2 
                         Kc4 10.Kf3 h1 11.Ke3 Qh3 12.Ke4 Qe6 
 00:00:00   7.00  -0.03  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kc6 8.Kh1 Kd5 9.Kg2 
                         h1 10.Kxh1 
 00:00:00   8.00  -12.99  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kc6 8.Kf3 h1 9.Ke2 
                          Qg2 10.Kd1 Qh1 11.Ke2 Qg2 12.Kd1 Qh1 
 00:00:00   8.01  -12.75  5.Ke4 Bd6 6.Kf3 h1=Q 
 00:00:00   9.00  -13.57  5.Ke4 Bc3 6.Kd3 Bf6 7.Ke4 h1=Q 
 00:00:00   9.01  -13.57  5.Kg2 
 00:00:00   9.01  -13.57  5.Kg2 
 00:00:00   9.04  -13.16  5.Kg4 h1=Q 
 00:00:00  10.00  -13.16  5.Kg4 h1=Q 
 00:00:00  10.02  -13.16  5.Kg2 
 00:00:00  10.02  -13.16  5.Kg2 
 00:00:00  11.00  -13.52  5.Kg4 h1=Q 
 00:00:00  11.01  -13.52  5.Kg2 
 00:00:00  11.01  -13.52  5.Kg2 
 00:00:00  11.01  -0.03  5.Kg2 Ka7 6.Kh1 Kb8 7.Kg2 Kc7 8.Kh1 Kd6 9.Kg2 
                         Kc5 10.Kh1 Kd4 11.Kg2 Kc4 12.Kh1 Kd3 13.Kg2 
                         Ke4 14.Kh1 Kd3 15.Kg2 Ke4 16.Kh1 
 00:00:00  12.00  -14.02  5.Kg2 Ka7 6.Kh1 Kb8 7.Kg2 Kc7 8.Kh1 Kd6 9.Kg2 
                          Kc5 10.Kf3 h1 11.Ke2 Qg2 12.Kd1 Qf3 13.Kc1 
                          Qf1 14.Kc2 Qe2 15.Kc1 Qe3 16.Kd1 Qd4 
 00:00:00  12.01  -13.52  5.Kg4 h1=Q 
 00:00:00  13.00  -13.47  5.Kg4 h1=Q 
 00:00:00  14.00  -13.55  5.Kg4 Bc3 6.Kf5 h1=Q 
 00:00:00  14.01  -13.55  5.Kg2 
 00:00:00  14.01  -13.55  5.Kg2 
 00:00:01  15.00  -M11  5.Kg4 Bc3 6.Kf5 h1=Q 
 00:00:01  15.01  -M11  5.Kg2 
 00:00:01  15.01  -M11  5.Kg2 
 00:00:01  15.01  -0.03  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bd6 8.Kh1 Kc6 9.Kg2 
                         Kc5 10.Kh1 Bf4 11.Kg2 Kd5 12.Kh1 Bd6 13.Kg2 
                         Be5 14.Kh1 Bf4 15.Kg2 Be5 16.Kh1 
 00:00:02  16.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bd6 8.Kh1 Kc6 9.Kg2 
                          Kd5 10.Kh1 Be5 11.Kg2 Bf4 12.Kf3 h1 13.Kxf4 
                          Qe4 14.Kg5 Qd4 15.Kf5 Qd3 16.Kf4 Qe4 
 00:00:02  17.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bf4 8.Kh1 Be5 9.Kg2 
                          Bf4 10.Kh1 
 00:00:02  18.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kb6 8.Kh1 Kc5 9.Kg2 
                          Kc6 10.Kh1 Kd5 11.Kg2 Bd6 12.Kh1 Be5 13.Kg2 
                          Bd6 14.Kh1 
 00:00:02  19.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bf4 8.Kh1 Kc6 9.Kg2 
                          Bd6 10.Kh1 Kc5 11.Kg2 Kd5 12.Kh1 Be5 13.Kg2 
                          Bd6 14.Kh1 Be5 15.Kg2 
 00:00:03  20.00  -0.04  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kb7 8.Kh1 Kc6 9.Kg2 
                         Kd5 10.Kh1 Bf4 11.Kg2 Bd6 12.Kh1 Bf4 13.Kg2 
                         Bd6 14.Kh1 
 00:00:15  21.00  -0.04  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kc5 8.Kh1 Kd5 9.Kg2 
                         Bf4 10.Kh1 Bd6 11.Kg2 Ke4 12.Kh1 Be5 13.Kg2 
                         Bf4 14.Kh1 Bd6 15.Kg2 Kd3 16.Kh1 Bf4 
 00:00:16  22.00  -13.01  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kc5 8.Kh1 Kd5 9.Kg2 
                          Bf4 10.Kh1 Bd6 11.Kg2 Bf4 12.Kh1 Bd6 13.Kg2 
 00:00:19  23.00  -7.15  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kb5 8.Kh1 Bf4 9.Kg2 
                         Kb4 10.Kh1 Kc5 11.Kg2 Kd5 12.Kh1 Kd4 13.Kg2 
                         Kc3 14.Kh1 Kd3 15.Kg2 Kd2 16.Kh1 Ke3 
What's your best bug ?
Something like:

next_depth = max(depth++, 32)


Because 'max' is a macro and not a function and I did not know that.
O I might have misread your question.. it did not help ELO :(

But I remember a blog from the Mediocre author where he discovered he used his _eg and _mg pcsq tables in the wrong order and after the "fix" his program played way worse.. hahaha :) ,, well if you have a bug for a longer time you tune the rest around it I suppose ?

User avatar
lucasart
Posts: 3041
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Your best bug ?

Post by lucasart » Thu Aug 09, 2012 4:30 am

Rebel wrote:The best bugs are those who produce ELO.

Today my thoughts went back to a fun moment during the WCCC 1993 in Munich and the game I played against Chrilly, Rebel vs Nimzo. After xx moves the game went into an unclear but equal ending and here Chrilly started to comment about every move Nimzo played saying Nimzo had a bug and that's why it played that move. And in the end Nimzo won the game, Chrilly having big fun telling everybody he won because of a bug.

Now those who know Chrilly and his sense of humor will realize you never can be sure if he is not pulling your leg but if true that's the kind of bug you want to keep.

I have one of my own, I am aware of it since the 90's, eventually after a long debugging process found the bug, but in order to fix it would lose so much speed that Rebel would lose 30-40 elo points and thus I left it and it's still present until this day. Consider the diagram and its analysis.
[d]k7/8/8/4b3/8/5K2/7p/8 w - -

00:00:00 1.00 -12.93 5.Ke4
00:00:00 1.07 -0.03 5.Kg2

It's clear the chess knowledge is OK, Kg2 moves into the quadrant so a draw. But then search is going to spoil it all:

Code: Select all

 00:00:00   2.00  -0.03  5.Kg2 Kb7 
 00:00:00   3.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 Kc6 8.Kf3 h1 9.Ke2 
                         Qg2 10.Kd1 Qh1 11.Kd2 Qg2 12.Kd1 Qh1 13.Kd2 
                         Qg2 
 00:00:00   4.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 h1 8.Kxh1 
 00:00:00   5.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc7 7.Kg2 h1 8.Kxh1 
 00:00:00   6.00  -0.03  5.Kg2 Kb7 6.Kh1 Kc6 7.Kg2 Kd6 8.Kh1 Kd5 9.Kg2 
                         Kc4 10.Kf3 h1 11.Ke3 Qh3 12.Ke4 Qe6 
 00:00:00   7.00  -0.03  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kc6 8.Kh1 Kd5 9.Kg2 
                         h1 10.Kxh1 
 00:00:00   8.00  -12.99  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kc6 8.Kf3 h1 9.Ke2 
                          Qg2 10.Kd1 Qh1 11.Ke2 Qg2 12.Kd1 Qh1 
 00:00:00   8.01  -12.75  5.Ke4 Bd6 6.Kf3 h1=Q 
 00:00:00   9.00  -13.57  5.Ke4 Bc3 6.Kd3 Bf6 7.Ke4 h1=Q 
 00:00:00   9.01  -13.57  5.Kg2 
 00:00:00   9.01  -13.57  5.Kg2 
 00:00:00   9.04  -13.16  5.Kg4 h1=Q 
 00:00:00  10.00  -13.16  5.Kg4 h1=Q 
 00:00:00  10.02  -13.16  5.Kg2 
 00:00:00  10.02  -13.16  5.Kg2 
 00:00:00  11.00  -13.52  5.Kg4 h1=Q 
 00:00:00  11.01  -13.52  5.Kg2 
 00:00:00  11.01  -13.52  5.Kg2 
 00:00:00  11.01  -0.03  5.Kg2 Ka7 6.Kh1 Kb8 7.Kg2 Kc7 8.Kh1 Kd6 9.Kg2 
                         Kc5 10.Kh1 Kd4 11.Kg2 Kc4 12.Kh1 Kd3 13.Kg2 
                         Ke4 14.Kh1 Kd3 15.Kg2 Ke4 16.Kh1 
 00:00:00  12.00  -14.02  5.Kg2 Ka7 6.Kh1 Kb8 7.Kg2 Kc7 8.Kh1 Kd6 9.Kg2 
                          Kc5 10.Kf3 h1 11.Ke2 Qg2 12.Kd1 Qf3 13.Kc1 
                          Qf1 14.Kc2 Qe2 15.Kc1 Qe3 16.Kd1 Qd4 
 00:00:00  12.01  -13.52  5.Kg4 h1=Q 
 00:00:00  13.00  -13.47  5.Kg4 h1=Q 
 00:00:00  14.00  -13.55  5.Kg4 Bc3 6.Kf5 h1=Q 
 00:00:00  14.01  -13.55  5.Kg2 
 00:00:00  14.01  -13.55  5.Kg2 
 00:00:01  15.00  -M11  5.Kg4 Bc3 6.Kf5 h1=Q 
 00:00:01  15.01  -M11  5.Kg2 
 00:00:01  15.01  -M11  5.Kg2 
 00:00:01  15.01  -0.03  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bd6 8.Kh1 Kc6 9.Kg2 
                         Kc5 10.Kh1 Bf4 11.Kg2 Kd5 12.Kh1 Bd6 13.Kg2 
                         Be5 14.Kh1 Bf4 15.Kg2 Be5 16.Kh1 
 00:00:02  16.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bd6 8.Kh1 Kc6 9.Kg2 
                          Kd5 10.Kh1 Be5 11.Kg2 Bf4 12.Kf3 h1 13.Kxf4 
                          Qe4 14.Kg5 Qd4 15.Kf5 Qd3 16.Kf4 Qe4 
 00:00:02  17.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bf4 8.Kh1 Be5 9.Kg2 
                          Bf4 10.Kh1 
 00:00:02  18.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Kb6 8.Kh1 Kc5 9.Kg2 
                          Kc6 10.Kh1 Kd5 11.Kg2 Bd6 12.Kh1 Be5 13.Kg2 
                          Bd6 14.Kh1 
 00:00:02  19.00  -10.26  5.Kg2 Ka7 6.Kh1 Kb7 7.Kg2 Bf4 8.Kh1 Kc6 9.Kg2 
                          Bd6 10.Kh1 Kc5 11.Kg2 Kd5 12.Kh1 Be5 13.Kg2 
                          Bd6 14.Kh1 Be5 15.Kg2 
 00:00:03  20.00  -0.04  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kb7 8.Kh1 Kc6 9.Kg2 
                         Kd5 10.Kh1 Bf4 11.Kg2 Bd6 12.Kh1 Bf4 13.Kg2 
                         Bd6 14.Kh1 
 00:00:15  21.00  -0.04  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kc5 8.Kh1 Kd5 9.Kg2 
                         Bf4 10.Kh1 Bd6 11.Kg2 Ke4 12.Kh1 Be5 13.Kg2 
                         Bf4 14.Kh1 Bd6 15.Kg2 Kd3 16.Kh1 Bf4 
 00:00:16  22.00  -13.01  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kc5 8.Kh1 Kd5 9.Kg2 
                          Bf4 10.Kh1 Bd6 11.Kg2 Bf4 12.Kh1 Bd6 13.Kg2 
 00:00:19  23.00  -7.15  5.Kg2 Ka7 6.Kh1 Kb6 7.Kg2 Kb5 8.Kh1 Bf4 9.Kg2 
                         Kb4 10.Kh1 Kc5 11.Kg2 Kd5 12.Kh1 Kd4 13.Kg2 
                         Kc3 14.Kh1 Kd3 15.Kg2 Kd2 16.Kh1 Ke3 
What's your best bug ?
Have you tried simply disabling razoring to see what happens ?

I've just recently implemented KBPK in DiscoCheck, and discovered the exact same bug independantly. Or rather the same end result with perhaps a different underlying cause because DiscoCheck is not Rebel.

The solution (for DiscoCheck) is quite simple: disable razoring when the side to move has only a king. At this point I only recognize as draws the KPK and KBPK, so this condition seems appropriate. As for slowing down, I doubt it would be significant. When we only have a lone king (no pawns and no piece) it is very likely that the game outcome is already decided, no matter how fast we search. And the calculation that determines that we have only a king left, is intself very fast (material count bitfield).

User avatar
Rebel
Posts: 4787
Joined: Thu Aug 18, 2011 10:04 am

Re: Your best bug ?

Post by Rebel » Thu Aug 09, 2012 7:03 am

lucasart wrote: I've just recently implemented KBPK in DiscoCheck, and discovered the exact same bug independantly. Or rather the same end result with perhaps a different underlying cause because DiscoCheck is not Rebel.
Too funny.
The solution (for DiscoCheck) is quite simple: disable razoring when the side to move has only a king.
In my notes now.

yl84
Posts: 21
Joined: Tue Sep 07, 2010 4:37 pm

Re: Your best bug ?

Post by yl84 » Thu Aug 09, 2012 12:42 pm

At the beginning I was passing Alpha and Beta byref. The search was almost unstable and not reliable.
:oops:

User avatar
hgm
Posts: 23772
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Your best bug ?

Post by hgm » Thu Aug 09, 2012 1:08 pm

lucasart wrote:I've just recently implemented KBPK in DiscoCheck, and discovered the exact same bug independantly. Or rather the same end result with perhaps a different underlying cause because DiscoCheck is not Rebel.

The solution (for DiscoCheck) is quite simple: disable razoring when the side to move has only a king.
I am afraid I still don't get it. If the PV sees the opponent queening, so that the search window moves to a score of -1200 for the bare King... Why would you razor moves like Kh1 which keep the current eval at -400 (or perhaps -550 with 7th-rank passer bonus)? That is at alpha + 800. Usually one razors moves because they are far below alpha, and not when they tower beta.

User avatar
lucasart
Posts: 3041
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Your best bug ?

Post by lucasart » Thu Aug 09, 2012 1:31 pm

hgm wrote:
lucasart wrote:I've just recently implemented KBPK in DiscoCheck, and discovered the exact same bug independantly. Or rather the same end result with perhaps a different underlying cause because DiscoCheck is not Rebel.

The solution (for DiscoCheck) is quite simple: disable razoring when the side to move has only a king.
I am afraid I still don't get it. If the PV sees the opponent queening, so that the search window moves to a score of -1200 for the bare King... Why would you razor moves like Kh1 which keep the current eval at -400 (or perhaps -550 with 7th-rank passer bonus)? That is at alpha + 800. Usually one razors moves because they are far below alpha, and not when they tower beta.
As I said: disable razoring when the side to move has only a king.

User avatar
hgm
Posts: 23772
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Your best bug ?

Post by hgm » Thu Aug 09, 2012 4:53 pm

lucasart wrote:As I said: disable razoring when the side to move has only a king.
Indeed, that is what you said.

So from that I concluded that with razoring enabled you would see the bug Ed describes.

And that suggests there is something horribly wrong with your implementation of razoring... Because, as I explained above, normal razoring should not cause you to stop defending h1.

User avatar
Evert
Posts: 2923
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: Your best bug ?

Post by Evert » Fri Aug 10, 2012 1:02 pm

Looking at this position I actually found a bug in Jazz' evaluation function for wrong bishop+edge pawn. It would recognise as a draw a position where the defending king could reach the promotion square, but not positions where it was actually on the promotion square. Easily fixed, of course, but the issue was entirely cosmetic anyway: it still preferred to stop the pawn over letting the pawn promote, but the score jumped between a large negative value and 0. It now correctly stays on 0.

Which is a round-about way of saying that I don't see how incorrect razor margins would cause you to get this wrong either, especially if the evaluation function recognises the draw and returns a draw score...

User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 9:44 am
Location: Madrid - Spain
Contact:

Re: Your best bug ?

Post by Kempelen » Fri Aug 10, 2012 3:29 pm

Evert wrote:Looking at this position I actually found a bug in Jazz' evaluation function for wrong bishop+edge pawn. It would recognise as a draw a position where the defending king could reach the promotion square, but not positions where it was actually on the promotion square. Easily fixed, of course, but the issue was entirely cosmetic anyway: it still preferred to stop the pawn over letting the pawn promote, but the score jumped between a large negative value and 0. It now correctly stays on 0.

Which is a round-about way of saying that I don't see how incorrect razor margins would cause you to get this wrong either, especially if the evaluation function recognises the draw and returns a draw score...
Very curious.... I have exactly the same bug
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/

Post Reply