simple search yet a bug ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

simple search yet a bug ?

Post by Chan Rasjid »

[D]8/8/2q4p/2k5/4Q3/5PP1/5K1P/8 w - - 0 91

I tested that most programs just do the Q exchange to win the game. But mine just do not want the Q exchange. I cannot figure out why?

I don't think any program need to treat this as an exceptional position.

I did these:
1) disable search tricks like razoring, LMR, futility, etc.
2) just use mat+pst evaluation
3) disable hashing, others...

Still to no avail. Anyone familiar with such search behavior?

Thanks,
Rasjid
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: simple search yet a bug ?

Post by Chan Rasjid »

Opps,

Maybe it is a very good sign. :D

When Rybka 1 was just released, it was well known that it cannot finish a game of kqk. I think I am on the right track :shock:

Rasjid
Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

Re: simple search yet a bug ?

Post by Karlo Bala »

Chan Rasjid wrote:[D]8/8/2q4p/2k5/4Q3/5PP1/5K1P/8 w - - 0 91

I tested that most programs just do the Q exchange to win the game. But mine just do not want the Q exchange. I cannot figure out why?

I don't think any program need to treat this as an exceptional position.

I did these:
1) disable search tricks like razoring, LMR, futility, etc.
2) just use mat+pst evaluation
3) disable hashing, others...

Still to no avail. Anyone familiar with such search behavior?

Thanks,
Rasjid
Reduce penalty for king safety when only queens are on the board. Increase bonus for trading pieces if you have the advantage in material
Best Regards,
Karlo Balla Jr.
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: simple search yet a bug ?

Post by Chan Rasjid »

Karlo Bala wrote:
Chan Rasjid wrote:[D]8/8/2q4p/2k5/4Q3/5PP1/5K1P/8 w - - 0 91

I tested that most programs just do the Q exchange to win the game. But mine just do not want the Q exchange. I cannot figure out why?

I don't think any program need to treat this as an exceptional position.

I did these:
1) disable search tricks like razoring, LMR, futility, etc.
2) just use mat+pst evaluation
3) disable hashing, others...

Still to no avail. Anyone familiar with such search behavior?

Thanks,
Rasjid
Reduce penalty for king safety when only queens are on the board. Increase bonus for trading pieces if you have the advantage in material
Your reply seems to indicate that some normal programs might also not do an immediate QxQ.

OK. I checked further with the linux programs with me. Homer, Hoichess - ok. Olithink fails - so I have company !

The problem is that mine still fails if I just eval() with mat + pst + imbalance bonus from material tables. My table has exchange bonus for a side up in material - scaling up as winning material goes down to zero. Still don't do an immediate QxQ.

I don't know about Olithink, but seems the author tries something different.

I'll see what I can do.

Rasjid.
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: simple search yet a bug ?

Post by Chan Rasjid »

I have tested all the other programs I have:-
SF, Robbo, Fruit, Hermann, phalanx, Roce, Crafty - all will do an immediate QxQ.

So it seems that most programs should be able to fine the best move in less than a second otherwise there is something that could be taken as a form of a bug.

So now only Olithink and my program fails.

Rasjid
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: simple search yet a bug ?

Post by Sven »

Chan Rasjid wrote:I have tested all the other programs I have:-
SF, Robbo, Fruit, Hermann, phalanx, Roce, Crafty - all will do an immediate QxQ.

So it seems that most programs should be able to fine the best move in less than a second otherwise there is something that could be taken as a form of a bug.

So now only Olithink and my program fails.

Rasjid
Can you post the analysis (PVs) of your program for that position?

Does your program have the ability to print the static evaluation of a given position so that you can compare the eval before and after the queen exchange? If the eval after exchanging queens is better than before then it is probably some search bug, otherwise it could be an eval problem.

Sven
Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: simple search yet a bug ?

Post by Chan Rasjid »

Sven Schüle wrote:
Chan Rasjid wrote:I have tested all the other programs I have:-
SF, Robbo, Fruit, Hermann, phalanx, Roce, Crafty - all will do an immediate QxQ.

So it seems that most programs should be able to fine the best move in less than a second otherwise there is something that could be taken as a form of a bug.

So now only Olithink and my program fails.

Rasjid
Can you post the analysis (PVs) of your program for that position?

Does your program have the ability to print the static evaluation of a given position so that you can compare the eval before and after the queen exchange? If the eval after exchanging queens is better than before then it is probably some search bug, otherwise it could be an eval problem.

Sven
Give me a little time.

My program lacks many such analytical facilities - Perft and fen JUST recently done in an old program!

Rasjid.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: simple search yet a bug ?

Post by michiguel »

Chan Rasjid wrote:
Karlo Bala wrote:
Chan Rasjid wrote:[D]8/8/2q4p/2k5/4Q3/5PP1/5K1P/8 w - - 0 91

I tested that most programs just do the Q exchange to win the game. But mine just do not want the Q exchange. I cannot figure out why?

I don't think any program need to treat this as an exceptional position.

I did these:
1) disable search tricks like razoring, LMR, futility, etc.
2) just use mat+pst evaluation
3) disable hashing, others...

Still to no avail. Anyone familiar with such search behavior?

Thanks,
Rasjid
Reduce penalty for king safety when only queens are on the board. Increase bonus for trading pieces if you have the advantage in material
Your reply seems to indicate that some normal programs might also not do an immediate QxQ.

OK. I checked further with the linux programs with me. Homer, Hoichess - ok. Olithink fails - so I have company !

The problem is that mine still fails if I just eval() with mat + pst + imbalance bonus from material tables. My table has exchange bonus for a side up in material - scaling up as winning material goes down to zero. Still don't do an immediate QxQ.

I don't know about Olithink, but seems the author tries something different.

I'll see what I can do.

Rasjid.
Is the PST giving huge bonuses for centralization? Then engine may not want to exchange Q.

Gaviota score in this position is

Code: Select all

+-----------------+
| . . . . . . . . |
| . . . . . . . . |
| . . q . . . . p |
| . . k . . . . . |    Castling: 
| . . . . Q . . . |    ep: -
| . . . . . P P . |
| . . . . . K . P |
| . . . . . . . . | [White]
+-----------------+

score
===> 2.75
Qxc6+
Kxc6
score
===> 2.51
f4
Kd6
score
===> 2.82
So, it would not like to change (2.51 < 2.75) but immediately the score in the pawn endgame goes up (2.82). As a consequence, Gaviota prefers to trade. See how the score steadily increases.

Code: Select all

+-----------------+
| . . . . . . . . |
| . . . . . . . . |
| . . q . . . . p |
| . . k . . . . . |    Castling&#58; 
| . . . . Q . . . |    ep&#58; -
| . . . . . P P . |
| . . . . . K . P |
| . . . . . . . . | &#91;White&#93;
+-----------------+

analyze
********* Starts iterative deepening, thread = 0
set timer to infinite
       219   1&#58;      0.0    +2.85  46.Qxc6+ Kxc6 47.f4
      1048   2&#58;      0.0    +2.82  46.Qxc6+ Kxc6 47.f4 Kd5
      1120   3       0.0      &#58;-)  46.Qxc6+
      4090   3&#58;      0.0    +3.33  46.Qxc6+ Kxc6 47.f4 Kd5 48.f5
     14945   4&#58;      0.0    +2.93  46.Qxc6+ Kxc6 47.f4 Kd5 48.f5 Ke5
     46048   5&#58;      0.1    +2.93  46.Qxc6+ Kxc6 47.f4 Kd5 48.f5 Ke5 49.g4
     48108   6       0.1      &#58;-)  46.Qxc6+
     51617   6       0.1    +3.50  46.Qxc6+ Kxc6 47.g4 Kd5 48.h4 Ke5 49.g5
                                   hxg5 50.hxg5
     96846   6&#58;      0.2    +3.50  46.Qxc6+ Kxc6 47.g4 Kd5 48.h4 Ke5 49.g5
                                   hxg5 50.hxg5
    105536   7       0.2    +3.13  46.Qxc6+ Kxc6 47.f4 Kd5 48.Kf3 Ke6
                                   49.Kg4 Kf6 50.f5
    305443   7&#58;      0.6    +3.13  46.Qxc6+ Kxc6 47.f4 Kd5 48.Kf3 Ke6
                                   49.Kg4 Kf6 50.f5
    320614   8       0.7    +3.42  46.Qxc6+ Kxc6 47.f4 Kd5 48.g4 Ke6 49.h4
                                   Kf6 50.g5+ hxg5 51.fxg5+ Kg6
    743833   8&#58;      1.5    +3.42  46.Qxc6+ Kxc6 47.f4 Kd5 48.g4 Ke6 49.h4
                                   Kf6 50.g5+ hxg5 51.fxg5+ Kg6
    774290   9       1.6    +3.53  46.Qxc6+ Kxc6 47.f4 Kd5 48.g4 Ke6 49.h4
                                   Kf6 50.g5+ Kf5 51.gxh6 Kg6 52.f5+ Kxh6
   1574201   9&#58;      3.2    +3.53  46.Qxc6+ Kxc6 47.f4 Kd5 48.g4 Ke6 49.h4
                                   Kf6 50.g5+ Kf5 51.gxh6 Kg6 52.f5+ Kxh6
   1640475  10       3.3    +3.58  46.Qxc6+ Kxc6 47.f4 Kd5 48.g4 Ke6 49.g5
                                   hxg5 50.fxg5 Kf5 51.h4 Kg6 52.Kg3
   3515716  10&#58;      6.9    +3.58  46.Qxc6+ Kxc6 47.f4 Kd5 48.g4 Ke6 49.g5
                                   hxg5 50.fxg5 Kf5 51.h4 Kg6 52.Kg3
   3713558  11       7.2    +3.58  46.Qxc6+ Kxc6 47.f4 Kd5 48.g4 Ke6 49.g5
                                   hxg5 50.fxg5 Kf5 51.h4 Kg6 52.Kg3 Kh5
That is of course without TBs. With TBs the increase is even steeper.

Code: Select all

analyze
********* Starts iterative deepening, thread = 0
set timer to infinite
       219   1&#58;      0.0    +2.85  46.Qxc6+ Kxc6 47.f4
      1048   2&#58;      0.0    +2.82  46.Qxc6+ Kxc6 47.f4 Kd5
      1120   3       0.0      &#58;-)  46.Qxc6+
      4090   3&#58;      0.0    +3.33  46.Qxc6+ Kxc6 47.f4 Kd5 48.f5
     12752   4&#58;      0.1    +3.72  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5
     13010   5       0.1      &#58;-)  46.Qxc6+
     29359   5&#58;      0.1    +4.61  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5 49.g6
                                   Ke6
     30215   6       0.1      &#58;-)  46.Qxc6+
     31774   6       0.1    +5.08  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5 49.g6
                                   Ke6 50.g7 Kf7
     69384   6&#58;      0.2    +5.08  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5 49.g6
                                   Ke6 50.g7 Kf7
     73319   7       0.2    +4.83  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5 49.f4
                                   Ke6 50.f5+ Ke5
    211585   7&#58;      0.7    +4.83  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5 49.f4
                                   Ke6 50.f5+ Ke5
    216435   8       0.7      &#58;-)  46.Qxc6+
    221889   8       0.7    +5.53  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5 49.g6
                                   Ke6 50.g7 Kf7 51.f4 Kg8
    444268   8&#58;      1.3    +5.53  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 h5 49.g6
                                   Ke6 50.g7 Kf7 51.f4 Kg8
    456863   9       1.3      &#58;-)  46.Qxc6+
    461485   9       1.3      &#58;-)  46.Qxc6+
    466099   9       1.3      &#58;-)  46.Qxc6+
    505126   9       1.5  +Mat_26  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 hxg5
                                   <=TABLE
   6547695   9&#58;     16.3  +Mat_26  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 hxg5
                                   <=TABLE
   6557467  10      16.3  +Mat_26  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 hxg5
                                   <=TABLE
  24627196  10&#58;     58.3  +Mat_26  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 hxg5
                                   <=TABLE
  24657455  11      58.3  +Mat_26  46.Qxc6+ Kxc6 47.g4 Kd5 48.g5 hxg5
                                   <=TABLE
In your analysis, you should see a steady increase in evaluation after each iteration after Qxc6+ Kxc6 because pawns are advancing and the engine could easily force an exchange of the last black pawn.

Miguel
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: simple search yet a bug ?

Post by jwes »

I would guess it is an eval problem. Try doing a static evaluation of these two positions and see which your program thinks is better.
[d]8/8/2q4p/2k5/8/3Q1PP1/5K1P/8 w - - 0 1
[d]8/8/2q4p/2k5/8/3Q1PP1/5K1P/8 w - - 0 1
vladstamate
Posts: 161
Joined: Thu Jan 08, 2009 9:06 pm
Location: San Francisco, USA

Re: simple search yet a bug ?

Post by vladstamate »

When analyzing in Plisk, for the first few plies it tries Qe3+ but then it find Qxc6 and sticks with it.

Also like Miguel said, notice how, as it searches deeper the score increases as well. So maybe your problem is depth? Or, if you have SEE maybe you value the trade as negative and somehow you prune the capture?

Code: Select all

 1 0&#58;0 +3.61 1.Qf4 Qd5  &#40;92/0&#41;
 2 0&#58;0 +3.85 1.Qe3+ Kb5 2.g4  &#40;983/61&#41;
 3 0&#58;0 +3.72 1.Qe3+ Kb5 2.g4 Qd6  &#40;1874/117&#41;
 4 0&#58;0 +3.73 1.Qe3+ Kd5 2.Qd3 Ke6 3.g4  &#40;6661/416&#41;
 5 0&#58;0 +3.70 1.Qe3+ Kd5 2.Qd2 Kc5 3.g4 Qf6  &#40;16610/535&#41;
 6 0&#58;0 +3.80 1.Qe3+ Kd5 2.Kg2 Qe6 3.Qd3 Kc6 4.g4  &#40;44077/565&#41;
 7 0&#58;0 +3.79 1.Qe3+ Kd5 2.g4 Qe6 3.Qxe6 Kxe6 4.f4 Kf6 5.Ke3  &#40;110970/711&#41;
 8 0&#58;0 +3.83 1.Qe3+ Kd5 2.g4 Qe6 3.Qd2 Kc6 4.Kg2 h5 5.Qc3 Kd7  &#40;214562/809&#41;
 9 0&#58;0 +3.83 1.Qe3+ Kd5 2.Qd2 Ke5 3.g4 Qf6 4.Qe3 Kd5 5.Kg2 h5  &#40;411336/849&#41;
Pondering&#58; Qxc6 &#40;1/32&#41;
10 0&#58;1 +3.84 1.Qe3+ Kd5 2.Qd2 Ke5 3.g4 Qf6 4.Qe3 Kd6 5.h3 Qe6 6.Qf4 Kc6 7.Kg1  &#40;993531/872&#41;
Pondering&#58; Qxc6 &#40;1/32&#41;
11 0&#58;2 +4.26 1.Qxc6+ Kxc6 2.g4 Kd5 3.Ke3 Kd6 4.f4 Kd5 5.h3 Kd6 6.f5 Ke5  &#40;2325365/882&#41;
Pondering&#58; Qe1 &#40;30/32&#41;
12 0&#58;3 +4.16 1.Qxc6+ Kxc6 2.g4 Kd5 3.Ke3 Kd6 4.f4 Kd5 5.Kd3 Ke6 6.Kd4 Kf6 7.h4 &#40;3272036/900&#41;
Pondering&#58; Qd4 &#40;10/32&#41;
13 0&#58;5 +4.38 1.Qxc6+ Kxc6 2.g4 Kd5 3.Ke3 Kd6 4.f4 Kd5 5.Kd3 Kd6 6.Kd4 h5 7.gxh5 Ke6  &#40;4895855/939&#41;
Pondering&#58; Kg2 &#40;3/32&#41;
Pondering&#58; Qd4 &#40;10/32&#41;
14 0&#58;9 +4.44 1.Qxc6+ Kxc6 2.g4 Kd5 3.Ke3 h5 4.gxh5 Ke6 5.h3 Kf6 6.Kf4 Kg7 7.Kg5 Kf7 8.f4  &#40;8614184/943&#41;
Pondering&#58; f4 &#40;2/32&#41;
Pondering&#58; g4 &#40;4/32&#41;
Pondering&#58; Ke3 &#40;5/32&#41;
Pondering&#58; Qd5 &#40;11/32&#41;
Pondering&#58; Qf4 &#40;20/32&#41;
15 0&#58;17 +4.58 1.Qxc6+ Kxc6 2.g4 Kd5 3.Ke3 Kd6 4.f4 Kd5 5.h3 Kd6  6.Kd4 Ke6 7.Ke4 Kd6 8.f5 Kc5  &#40;16656353/967&#41;
Pondering&#58; f4 &#40;2/32&#41;
Pondering&#58; g4 &#40;3/32&#41;
Pondering&#58; Qc4 &#40;14/32&#41;
Pondering&#58; Qe2 &#40;16/32&#41;
Pondering&#58; Qg6 &#40;22/32&#41;
16 0&#58;30 +4.76 1.Qxc6+ Kxc6 2.g4 Kd5 3.Ke3 Kd6 4.Ke4 Ke7 5.f4 Kf6 6.h4 Ke7 7.g5 h xg5 8.fxg5 Ke6 9.h5  &#40;29109385/967&#41;
Regards,
Vlad.