What should the next step be ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

MahmoudUthman
Posts: 234
Joined: Sat Jan 17, 2015 11:54 pm

What should the next step be ?

Post by MahmoudUthman »

So far I have this :
-Search (PVS ,Null Move pruning ,TT , Check extension ,QS (stand pat & skip SEE<0))
-Evaluation (Tapered ,Safe mobility ,PSQT ,King Safety , Pawn Structure + Hash Table )
-Move ordering (TT,MVV-LVA&SEE , Killers[2] , Relative History[Color][PT][To])

What should the next step/s be ?
cetormenter
Posts: 170
Joined: Sun Oct 28, 2012 9:46 pm

Re: What should the next step be ?

Post by cetormenter »

Very low hanging fruit that you still have left would be to implement futility pruning and LMR. Both of which can be implemented with only a couple of lines of code.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: What should the next step be ?

Post by Dann Corbit »

If you have not already done so, the next step should be to test very thoroughly to ensure that everything is implemented correctly and bug free.

For instance, if your centipawn evaluation does not agree exactly for these four positions:
r3rk2/ppp1q1pp/2n5/5bN1/2B1pP2/Q7/PPP4P/1KR3R1 w - - bm Nxh7+;
2kr3r/pp1q1ppp/5n2/1Nb5/2Pp1B2/7Q/P4PPP/1R3RK1 w - - bm Nxa7+;
1r3rk1/p4ppp/7q/2pP1b2/1nB5/5N2/PP1Q1PPP/2KR3R b - - bm Nxa2+;
1kr3r1/ppp4p/q7/2b1Pp2/5Bn1/2N5/PPP1Q1PP/R3RK2 b - - bm Nxh2+;

then something is broken.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: What should the next step be ?

Post by Dann Corbit »

Stockfish Output:

Code: Select all

position fen "r3rk2/ppp1q1pp/2n5/5bN1/2B1pP2/Q7/PPP4P/1KR3R1 w - - 0 1"
eval
      Eval term |    White    |    Black    |    Total
                |   MG    EG  |   MG    EG  |   MG    EG
----------------+-------------+-------------+-------------
       Material |   ---   --- |   ---   --- | -0.55 -1.31
      Imbalance |   ---   --- |   ---   --- | -0.02 -0.02
          Pawns |   ---   --- |   ---   --- | -0.06 -0.03
        Knights |  0.09  0.02 |  0.00  0.00 |  0.09  0.02
         Bishop | -0.03 -0.09 |  0.04 -0.13 | -0.07  0.04
          Rooks |  0.08  0.03 |  0.00  0.00 |  0.08  0.03
         Queens | -0.20 -0.04 |  0.00  0.00 | -0.20 -0.04
       Mobility |  0.65  1.64 |  0.41  1.17 |  0.24  0.46
    King safety |  0.74 -0.06 | -2.58 -0.10 |  3.32  0.04
        Threats |  0.00  0.27 |  0.15  0.09 | -0.15  0.18
   Passed pawns |  0.00  0.00 |  0.27  0.37 | -0.27 -0.37
          Space |  0.15  0.00 |  0.25  0.00 | -0.10  0.00
----------------+-------------+-------------+-------------
          Total |   ---   --- |   ---   --- |  2.30 -1.04

Total Evaluation&#58; 1.78 &#40;white side&#41;

position fen "2kr3r/pp1q1ppp/5n2/1Nb5/2Pp1B2/7Q/P4PPP/1R3RK1 w - - 0 1"
eval
      Eval term |    White    |    Black    |    Total
                |   MG    EG  |   MG    EG  |   MG    EG
----------------+-------------+-------------+-------------
       Material |   ---   --- |   ---   --- | -0.55 -1.31
      Imbalance |   ---   --- |   ---   --- | -0.02 -0.02
          Pawns |   ---   --- |   ---   --- | -0.06 -0.03
        Knights |  0.09  0.02 |  0.00  0.00 |  0.09  0.02
         Bishop | -0.03 -0.09 |  0.04 -0.13 | -0.07  0.04
          Rooks |  0.08  0.03 |  0.00  0.00 |  0.08  0.03
         Queens | -0.20 -0.04 |  0.00  0.00 | -0.20 -0.04
       Mobility |  0.65  1.64 |  0.41  1.17 |  0.24  0.46
    King safety |  0.74 -0.06 | -2.58 -0.10 |  3.32  0.04
        Threats |  0.00  0.27 |  0.15  0.09 | -0.15  0.18
   Passed pawns |  0.00  0.00 |  0.27  0.37 | -0.27 -0.37
          Space |  0.15  0.00 |  0.25  0.00 | -0.10  0.00
----------------+-------------+-------------+-------------
          Total |   ---   --- |   ---   --- |  2.30 -1.04

Total Evaluation&#58; 1.78 &#40;white side&#41;

position fen "1r3rk1/p4ppp/7q/2pP1b2/1nB5/5N2/PP1Q1PPP/2KR3R b - - 0 1"
eval
      Eval term |    White    |    Black    |    Total
                |   MG    EG  |   MG    EG  |   MG    EG
----------------+-------------+-------------+-------------
       Material |   ---   --- |   ---   --- |  0.55  1.31
      Imbalance |   ---   --- |   ---   --- |  0.02  0.02
          Pawns |   ---   --- |   ---   --- |  0.06  0.03
        Knights |  0.00  0.00 |  0.09  0.02 | -0.09 -0.02
         Bishop |  0.04 -0.13 | -0.03 -0.09 |  0.07 -0.04
          Rooks |  0.00  0.00 |  0.08  0.03 | -0.08 -0.03
         Queens |  0.00  0.00 | -0.20 -0.04 |  0.20  0.04
       Mobility |  0.41  1.17 |  0.65  1.64 | -0.24 -0.46
    King safety | -2.58 -0.10 |  0.74 -0.06 | -3.32 -0.04
        Threats |  0.15  0.09 |  0.00  0.27 |  0.15 -0.18
   Passed pawns |  0.27  0.37 |  0.00  0.00 |  0.27  0.37
          Space |  0.25  0.00 |  0.15  0.00 |  0.10  0.00
----------------+-------------+-------------+-------------
          Total |   ---   --- |   ---   --- | -2.30  1.04

Total Evaluation&#58; -1.78 &#40;white side&#41;

position fen "1kr3r1/ppp4p/q7/2b1Pp2/5Bn1/2N5/PPP1Q1PP/R3RK2 b - - 0 1"
eval
      Eval term |    White    |    Black    |    Total
                |   MG    EG  |   MG    EG  |   MG    EG
----------------+-------------+-------------+-------------
       Material |   ---   --- |   ---   --- |  0.55  1.31
      Imbalance |   ---   --- |   ---   --- |  0.02  0.02
          Pawns |   ---   --- |   ---   --- |  0.06  0.03
        Knights |  0.00  0.00 |  0.09  0.02 | -0.09 -0.02
         Bishop |  0.04 -0.13 | -0.03 -0.09 |  0.07 -0.04
          Rooks |  0.00  0.00 |  0.08  0.03 | -0.08 -0.03
         Queens |  0.00  0.00 | -0.20 -0.04 |  0.20  0.04
       Mobility |  0.41  1.17 |  0.65  1.64 | -0.24 -0.46
    King safety | -2.58 -0.10 |  0.74 -0.06 | -3.32 -0.04
        Threats |  0.15  0.09 |  0.00  0.27 |  0.15 -0.18
   Passed pawns |  0.27  0.37 |  0.00  0.00 |  0.27  0.37
          Space |  0.25  0.00 |  0.15  0.00 |  0.10  0.00
----------------+-------------+-------------+-------------
          Total |   ---   --- |   ---   --- | -2.30  1.04

Total Evaluation&#58; -1.78 &#40;white side&#41;
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: What should the next step be ?

Post by Henk »

I remember few years ago that if Skipper lost from Fairy Max then there was a serious bug in my engine. (Maybe I should find and restore that old version)

So you can use Fairy max to test your engine.

Misery starts when you try to improve your engine while making your code more complicated.


[pgn]
[Event "Computer Chess Game"]
[Site "HP"]
[Date "2017.03.04"]
[Round "-"]
[White "Fairy-Max 4.8S"]
[Black "SkipperWinb"]
[Result "1-0"]
[TimeControl "120"]
[Annotator "1. +0.07 1... -0.03"]

1. Nc3 {+0.07/8} Nc6 {-0.03/80 2.0} 2. Nf3 {+0.07/8 2.4} e6 {-0.03/90 2.0}
3. d4 {+0.14/9 6} Nf6 {-0.16/80 2.0} 4. g3 {-0.08/8 5} Bb4 {+0.39/90 1.9}
5. a3 {-0.04/8 1.4} Bxc3+ {+0.55/100 1.9} 6. bxc3 {+0.25/9 3} O-O
{+0.41/90 1.9} 7. Bh3 {+0.43/8 2.8} Ne4 {+0.39/80 1.9} 8. Qd3 {+0.46/9 1.7}
d5 {+0.49/80 1.8} 9. O-O {+0.62/8 2.0} h6 {+0.55/80 1.8} 10. Bf4
{+0.47/8 2.4} Nd6 {+0.41/80 1.8} 11. Bg4 {+0.35/8 1.9} Na5 {+0.56/70 1.8}
12. Ne5 {+0.25/8 1.7} Qe7 {+0.53/70 1.7} 13. h4 {+0.25/8 2.0} Nac4
{+0.85/90 1.7} 14. Nxc4 {+0.28/8 1.3} Nxc4 {+0.82/90 1.7} 15. a4
{+0.20/9 2.4} e5 {+0.96/80 1.7} 16. Bxc8 {+0.30/9 1.8} e4 {+0.56/90 1.7}
17. Qd1 {+0.33/11 3} Raxc8 {+0.77/90 1.6} 18. e3 {+0.32/10 1.0} Qd7
{+0.87/80 1.6} 19. Rb1 {+0.29/8 1.4} b6 {+0.70/80 1.6} 20. Ra1
{-0.20/7 1.1} Nb2 {+1.53/90 1.6} 21. Qb1 {-0.37/10 1.0} Nxa4
{+1.39/100 1.6} 22. Qb4 {-0.40/10 1.9} b5 {+1.50/90 1.5} 23. Qa5
{-0.47/9 4} c6 {+1.28/80 1.5} 24. Qb4 {-0.42/9 2.6} Qh3 {+1.48/80 1.5} 25.
Ra3 {-0.37/8 1.3} Rfd8 {+1.53/80 1.5} 26. Rc1 {-0.38/8 1.2} a6
{+1.53/80 1.5} 27. Qa5 {-0.40/9 1.6} Ra8 {+1.45/80 1.5} 28. Qc7
{-0.41/9 1.3} Rdc8 {+1.47/90 1.4} 29. Qe7 {-0.42/9 1.1} Re8 {+1.31/80 1.4}
30. Qc7 {-0.41/9 1.0} Qe6 {+0.81/80 1.4} 31. Rb3 {-0.43/8 0.8} Rac8
{+1.59/90 1.3} 32. Qa5 {-0.43/8 0.8} c5 {+1.68/80 1.3} 33. Be5
{-0.43/8 0.7} Re7 {+1.53/80 1.3} 34. Bf4 {-0.45/8 0.8} Rb7 {+1.53/80 1.3}
35. Ra1 {-0.38/8 1.1} Rd7 {+1.35/80 1.3} 36. Rab1 {-0.44/8 0.8} Qf6
{+1.60/80 1.3} 37. Ra3 {-0.39/9 5} Re8 {+1.62/70 1.3} 38. Be5 {-0.38/8 1.7}
Qc6 {+1.52/80 1.2} 39. Bf4 {-0.39/8 0.7} Rc8 {+1.53/80 1.2} 40. Rba1
{-0.41/8 0.9} Ra8 {+1.43/80 1.2} 41. Rb3 {-0.41/7 0.6} Rad8 {+1.67/80 1.2}
42. g4 {-0.37/8 0.8} cxd4 {+1.91/80 1.2} 43. exd4 {-0.60/9 1.6} Qe6
{+2.01/90 1.2} 44. g5 {-0.65/9 1.3} Qg4+ {+2.03/80 1.1} 45. Bg3 {-0.71/8 3}
hxg5 {+1.90/90 1.1} 46. hxg5 {-0.68/8 0.5} e3 {+1.96/90 1.1} 47. Qxa6
{-1.50/7 0.5} exf2+ {+2.86/90 1.1} 48. Kxf2 {-1.63/8 0.9} Qf5+
{+2.68/90 1.1} 49. Kg1 {-1.86/8 0.5} Qxg5 {+3.13/90 1.1} 50. Kg2
{-1.84/9 1.0} Nxc3 {+3.88/80 1.1} 51. Qc6 {-1.63/8 0.6} Ne2 {+4.35/80 1.0}
52. Qc5 {-1.86/8 0.6} Qg4 {+4.43/80 1.0} 53. Re1 {-1.96/8 0.9} Nxd4
{+4.32/80 1.0} 54. Ra3 {-1.89/7 0.4} Rb7 {+4.89/80 1.0} 55. Rae3
{-2.12/7 0.7} Rbb8 {+4.51/80 1.0} 56. Rd3 {-2.16/8 0.9} Nf5 {+4.42/80 1.0}
57. Qf2 {-2.18/8 1.1} Nxg3 {+4.05/70 1.0} 58. Rxg3 {-2.25/8 0.3} Qc4
{+3.85/80 1.0} 59. c3 {-2.25/8 1.0} Re8 {+3.99/70 1.0} 60. Rf3
{-2.27/8 0.6} Rxe1 {+4.32/80 1.1} 61. Qxe1 {-2.54/9 0.4} Qc6 {+4.32/80 0.9}
62. Qg3 {-2.24/8 0.5} Re8 {+4.13/80 0.9} 63. Qf2 {-2.37/8 0.4} Qg6+
{+4.13/80 0.9} 64. Qg3 {-2.49/8 0.4} Qc2+ {+4.42/90 0.9} 65. Rf2
{-2.60/8 0.5} Qh7 {+4.12/90 0.9} 66. Qg5 {-2.33/8 0.4} Qe4+ {+4.47/90 0.8}
67. Rf3 {-2.52/7 0.3} Re5 {+4.55/80 0.8} 68. Qg3 {-2.66/8 0.4} Rf5
{+4.12/80 0.8} 69. Qb8+ {-2.38/10 0.3} Kh7 {+4.38/100 0.8} 70. Qg3
{-2.86/10 0.3} g6 {+4.38/100 0.8} 71. Qh3+ {-2.62/9 0.2} Kg8
{+4.69/100 0.8} 72. Qg3 {-2.97/10 0.3} g5 {+4.40/100 0.8} 73. Kf2
{-2.95/10 0.5} Qc2+ {+4.13/100 0.8} 74. Ke1 {-3.01/9 0.5} Qb1+
{+4.23/90 0.8} 75. Ke2 {-2.93/9 0.5} Qa2+ {+4.28/100 0.8} 76. Ke3
{-2.84/9 0.3} Qa7+ {+4.13/90 0.8} 77. Ke2 {-2.54/8 0.2} Qe7+
{+3.88/100 0.8} 78. Re3 {-2.38/8 0.3} Qf8 {+3.53/80 0.8} 79. Qh3
{-2.07/8 0.2} Rf4 {+3.56/90 0.9} 80. Qd7 {-1.71/8 0.5} Qh6 {+2.73/80 0.7}
81. Qd8+ {-1.70/7 0.2} Kg7 {+2.62/90 0.7} 82. Qxd5 {-1.86/8 0.5} b4
{+2.77/80 0.7} 83. Qe5+ {-1.41/7 0.2} Kh7 {+2.66/80 0.7} 84. cxb4
{-1.60/8 0.2} Rxb4 {+2.57/80 0.7} 85. Qf5+ {-1.50/7 0.4} Qg6 {+2.72/90 0.7}
86. Qxg6+ {-1.57/8 0.5} fxg6 {+2.75/90 0.7} 87. Re7+ {-1.53/9 0.2} Kh6
{+2.86/100 0.7} 88. Kf2 {-1.55/10 0.2} Rf4+ {+2.70/90 0.7} 89. Kg3
{-1.48/10 0.3} Rc4 {+2.73/90 0.6} 90. Re2 {-1.51/10 0.2} Rc1 {+2.63/90 0.7}
91. Kf3 {-1.48/10 0.2} Rf1+ {+2.69/90 0.6} 92. Kg3 {-1.54/11 0.2} Rg1+
{+2.63/100 0.6} 93. Kf2 {-1.49/12 0.4} Ra1 {+2.71/100 0.6} 94. Kf3
{-1.49/10 0.2} Rh1 {+2.66/100 0.8} 95. Rg2 {-1.49/10 0.2} Kh5
{+2.83/100 0.6} 96. Rg3 {-1.50/11 0.2} Rh4 {+2.83/100 0.6} 97. Kf2
{-1.60/11 0.2} g4 {+2.65/90 0.6} 98. Rg1 {-1.56/10 0.1} g5 {+3.00/100 0.6}
99. Kg2 {-2.02/10 0.2} Rh3 {+2.94/100 0.6} 100. Rc1 {-1.54/11 0.1} Ra3
{+2.93/100 0.6} 101. Rh1+ {-1.55/12 0.2} Kg6 {+2.94/100 0.7} 102. Rf1
{-1.52/12 0.3} Rc3 {+2.81/80 0.6} 103. Rf8 {-1.52/11 0.1} Kg7
{+2.93/90 0.6} 104. Rf5 {-1.51/11 0.1} Kh6 {+2.92/100 0.7} 105. Rf1
{-1.55/12 0.2} Kh5 {+2.91/100 0.5} 106. Rh1+ {-1.51/14 0.2} Kg6
{+2.92/100 0.6} 107. Rf1 {-1.51/13 0.1} Rb3 {+2.92/90 0.5} 108. Rf8
{-1.50/13 0.2} Kh7 {+2.91/90 0.5} 109. Rf7+ {-1.52/11 0.1} Kh6
{+2.91/110 0.5} 110. Rf1 {-1.52/12 0.1} Kh5 {+2.91/100 0.5} 111. Rh1+
{-1.51/14 0.1}
{White wins on time} 1-0
[/pgn]
mar
Posts: 2555
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: What should the next step be ?

Post by mar »

Henk wrote:Misery starts when you try to improve your engine while making your code more complicated.
The problem here is 1) bugs and 2) lack of proper testing
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: What should the next step be ?

Post by Henk »

mar wrote:
Henk wrote:Misery starts when you try to improve your engine while making your code more complicated.
The problem here is 1) bugs and 2) lack of proper testing
Hobby should be fun. In my opinion nothing more boring than testing.
mar
Posts: 2555
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: What should the next step be ?

Post by mar »

Henk wrote:In my opinion nothing more boring than testing.
Fully agree. But necessary if one wants to improve.
Patrice Duhamel
Posts: 193
Joined: Sat May 25, 2013 11:17 am
Location: France
Full name: Patrice Duhamel

Re: What should the next step be ?

Post by Patrice Duhamel »

Dann Corbit wrote: r3rk2/ppp1q1pp/2n5/5bN1/2B1pP2/Q7/PPP4P/1KR3R1 w - - bm Nxh7+;
2kr3r/pp1q1ppp/5n2/1Nb5/2Pp1B2/7Q/P4PPP/1R3RK1 w - - bm Nxa7+;
For the first and second positions, it's not a problem if your PST are not symmetrical vertically ?
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: What should the next step be ?

Post by Sven »

Patrice Duhamel wrote:
Dann Corbit wrote: r3rk2/ppp1q1pp/2n5/5bN1/2B1pP2/Q7/PPP4P/1KR3R1 w - - bm Nxh7+;
2kr3r/pp1q1ppp/5n2/1Nb5/2Pp1B2/7Q/P4PPP/1R3RK1 w - - bm Nxa7+;
For the first and second positions, it's not a problem if your PST are not symmetrical vertically ?
It is a problem, of course - but the solution is obvious :wink: