Tuning

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Huge simplification

Post by bob »

mcostalba wrote:
mcostalba wrote: I can write a closed position detector to be used by people to write tests on it
Ok I have pushed a branch called closed_positions:

https://github.com/mcostalba/Stockfish/ ... d_position

with the code that implements your definition. Now I am able to detect positions like this one:

[d]r1q2rk1/2p3pp/2Pp4/p2P1p2/Q3p3/4P3/PP1R2PP/1K5R b - - 0 23
That is not close to blocked.
User avatar
AdminX
Posts: 6339
Joined: Mon Mar 13, 2006 2:34 pm
Location: Acworth, GA

Re: Huge simplification

Post by AdminX »

bob wrote:
mcostalba wrote:
mcostalba wrote: I can write a closed position detector to be used by people to write tests on it
Ok I have pushed a branch called closed_positions:

https://github.com/mcostalba/Stockfish/ ... d_position

with the code that implements your definition. Now I am able to detect positions like this one:

[d]r1q2rk1/2p3pp/2Pp4/p2P1p2/Q3p3/4P3/PP1R2PP/1K5R b - - 0 23
That is not close to blocked.
That's semi-open! :D
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Huge simplification

Post by mcostalba »

I have generalized the close position detector to evaluate any chain of blocked pawns: now is very general and flexible, the chain is evaluated according to its size and if is in the center or not. I have submitted some tests although very probably weights are wrong so I don't expect nice surprises.
arjuntemurnikar
Posts: 204
Joined: Tue Oct 15, 2013 10:22 pm
Location: Singapore

Re: Huge simplification

Post by arjuntemurnikar »

Lyudmil Tsvetkov wrote:Hi Arjun.

By 4th rank I meant considering in storm danger f4,g4, h4 pawns as dangerous for a black king on g8.
Yes same thing. 5 ranks are included: Assuming King was RANK_1, then 1, 2, 3, 4, and 5 are included.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Huge simplification

Post by Lyudmil Tsvetkov »

arjuntemurnikar wrote:
Lyudmil Tsvetkov wrote:Hi Arjun.

By 4th rank I meant considering in storm danger f4,g4, h4 pawns as dangerous for a black king on g8.
Yes same thing. 5 ranks are included: Assuming King was RANK_1, then 1, 2, 3, 4, and 5 are included.
Because, in some particular types of position, SF frequently does not see pushes to the 4th rank like f4,g4 and h4, especially when both kings have castled on the same side.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Why this does not work?

Post by Lyudmil Tsvetkov »

2 further games where SF underestimates doubled rooks on an open file.

[pgn][PlyCount "131"]
[MLNrOfMoves "65"]
[MLFlags "010100"]
[Date "2014.04.20"]
[Round "232"]
[White "SF"]
[Black "Gull"]
[Result "0-1"]
[TimeControl "64+0.32"]

1. c4 {book} 1... e5 {book} 2. Nc3 {book} 2... Nf6 {book} 3. Nf3 {book} 3... Nc6
{book} 4. e4 {book} 4... Bb4 {book} 5. d3 {book} 5... d6 {book} 6. Be2 {book}
6... a5 {book} 7. O-O {book} 7... Bc5 {book} 8. Nd2 {book} 8... Nd4 {book} 9.
Nb3 {0.00/22 4.5s} 9... Nxb3 {-0.03/18 2.5s} 10. Qxb3 {0.00/22 2.1s} 10... c6
{0.00/18 3.3s} 11. Be3 {+0.03/20 2.1s} 11... Bd4 {+0.03/17 3.7s} 12. Rae1
{-0.03/20 3.7s} 12... O-O {+0.10/17 3.0s} 13. Bxd4 {-0.10/22 2.2s} 13... exd4
{+0.21/17 0.89s} 14. Nb1 {-0.10/23 1.1s} 14... Re8 {+0.19/18 1.9s} 15. Qc2
{-0.12/22 1.1s} 15... Qb6 {+0.20/18 2.3s} 16. Nd2 {-0.10/22 1.1s} 16... Bd7
{+0.23/19 2.6s} 17. f4 {-0.10/22 1.1s} 17... a4 {+0.21/19 2.5s} 18. Bf3
{-0.10/19 1.5s} 18... c5 {+0.21/18 1.5s} 19. Rf2 {-0.07/21 2.7s} 19... Bc6
{+0.24/17 2.0s} 20. g3 {-0.10/21 2.2s} 20... h6 {+0.29/17 2.1s} 21. Rfe2
{-0.10/23 1.1s} 21... Re7 {+0.27/17 1.8s} 22. Rf2 {-0.10/21 1.8s} 22... Rae8
{+0.33/18 5.3s} 23. Rb1 {-0.09/22 3.4s} 23... Qa5 {+0.25/19 12s} 24. Rff1
{-0.07/22 1.1s} 24... Bd7 {+0.40/16 1.6s} 25. Rfc1 {-0.08/22 1.0s} 25... Ra8
{+0.39/15 1.1s} 26. a3 {-0.08/22 2.6s} 26... g6 {+0.42/16 2.3s} 27. Re1
{0.00/22 4.4s} 27... Rae8 {+0.38/16 1.4s} 28. Qc1 {0.00/22 0.95s} 28... Kg7
{+0.45/15 0.88s} 29. b4 {0.00/21 3.8s} 29... axb3 {+0.48/13 0.000s} 30. Nxb3
{-0.08/22 1.4s} 30... Qa7 {+0.41/17 0.77s} 31. Nd2 {-0.11/19 1.3s} 31... Qa6
{+0.41/18 2.3s} 32. Rf1 {-0.10/22 1.6s} 32... Rb8 {+0.41/15 0.89s} 33. Rb3
{-0.14/20 2.4s} 33... Qa5 {+0.42/17 0.67s} 34. Re1 {-0.13/21 1.6s} 34... Ba4
{+0.43/17 1.2s} 35. Rb2 {-0.18/22 1.1s} 35... Nd7 {+0.43/15 0.000s} 36. Rf1
{-0.15/22 1.6s} 36... Bc6 {+0.44/15 1.2s} 37. Rb3 {-0.15/21 0.77s} 37... Ree8
{+0.48/15 1.3s} 38. Bg4 {-0.10/22 2.0s} 38... f5 {+0.39/14 1.1s} 39. Bf3
{-0.10/21 1.3s} 39... Ba4 {+0.40/15 0.42s} 40. Rb2 {-0.04/23 0.72s} 40... Nf6
{+0.39/15 0.52s} 41. Qb1 {-0.06/22 0.70s} 41... Bd7 {+0.39/14 0.000s} 42. Rf2
{-0.12/20 3.6s} 42... b6 {+0.37/16 1.1s} 43. Re2 {0.00/22 0.88s} 43... h5
{+0.35/15 0.61s} 44. Nb3 {0.00/22 3.7s} 44... Qa7 {+0.44/15 0.75s} 45. Nd2
{0.00/22 0.50s} 45... Ng4 {+0.38/15 1.1s} 46. Re1 {0.00/22 0.64s} 46... Kh6
{+0.32/16 2.3s} 47. Qa2 {0.00/19 0.78s} 47... Qa5 {+0.39/15 0.84s} 48. Rd1
{0.00/19 0.62s} 48... Nf6 {+0.41/15 0.47s} 49. Rf1 {0.00/20 1.2s} 49... Kg7
{+0.43/15 0.48s} 50. Rfb1 {-0.05/20 0.70s} 50... Re7 {+0.49/15 0.39s} 51. Bg2
{0.00/20 1.1s} 51... Qa4 {+0.41/15 0.62s} 52. Qb3 {0.00/21 0.55s} 52... Qa7
{+0.41/17 0.42s} 53. a4 {0.00/21 0.39s} 53... Qa5 {+0.48/14 0.47s} 54. Qa2
{0.00/22 0.39s} 54... Ree8 {+0.39/14 0.61s} 55. Bf3 {0.00/23 0.39s} 55... Kh6
{+0.33/14 0.36s} 56. Ra1 {0.00/24 0.72s} 56... Re7 {+0.35/15 0.66s} 57. Bg2
{0.00/21 0.56s} 57... Ng4 {+0.28/16 1.4s} 58. Bf3 {0.00/23 1.5s} 58... fxe4
{+0.28/15 0.55s} 59. Nxe4 {0.00/19 0.56s} 59... Bc6 {+0.35/15 2.2s} 60. Qb1
{0.00/20 0.31s} 60... Kg7 {+0.35/14 0.000s} 61. Nd2 {0.00/21 0.31s} 61... Bxf3
{+0.71/13 0.093s} 62. Nxf3 {-0.28/23 0.92s} 62... Rbe8 {+0.65/14 0.61s} 63. Rxb6
{-0.38/20 0.42s} 63... Qa8 {+0.95/14 0.19s} 64. Nh4 {-0.54/22 0.73s} 64... Re2
{+1.21/15 0.31s} 65. Rxd6 {-1.89/21 0.84s} 65... Rb8 {+3.77/14 0.27s} 66. Rd7+
{Black wins by adjudication} 0-1

[PlyCount "76"]
[MLNrOfMoves "38"]
[MLFlags "000100"]
[Date "2014.04.20"]
[Round "249"]
[White "Gull"]
[Black "SF"]
[Result "1-0"]
[TimeControl "64+0.32"]

1. c4 {book} 1... e6 {book} 2. Nf3 {book} 2... f5 {book} 3. g3 {book} 3... Nf6
{book} 4. Bg2 {book} 4... Be7 {book} 5. O-O {book} 5... O-O {book} 6. d4 {book}
6... d5 {book} 7. b3 {book} 7... b6 {book} 8. Qc2 {book} 8... c6 {book} 9. Nc3
{+0.30/14 1.3s} 9... Bb7 {-0.31/19 3.3s} 10. Bb2 {+0.35/16 2.6s} 10... Bd6
{-0.27/19 2.6s} 11. cxd5 {+0.43/16 3.2s} 11... cxd5 {-0.32/24 1.7s} 12. Nb5
{+0.41/16 0.97s} 12... Nc6 {-0.33/23 1.8s} 13. Nxd6 {+0.40/17 2.6s} 13... Qxd6
{-0.37/24 1.1s} 14. a3 {+0.40/17 0.30s} 14... Ne4 {-0.24/21 2.5s} 15. Rac1
{+0.53/16 1.3s} 15... Rac8 {-0.29/23 4.1s} 16. Qd3 {+0.49/17 1.1s} 16... Qe7
{-0.27/21 3.1s} 17. Rc2 {+0.57/18 2.0s} 17... f4 {-0.21/21 1.1s} 18. Rfc1
{+0.56/18 2.4s} 18... fxg3 {-0.25/22 1.5s} 19. hxg3 {+0.50/17 5.7s} 19... a6
{-0.32/22 1.9s} 20. Qe3 {+0.48/17 2.4s} 20... h6 {-0.20/24 1.1s} 21. Nh4
{+0.57/16 1.4s} 21... Qf7 {-0.21/22 1.6s} 22. Bh3 {+0.58/18 4.4s} 22... Qf6
{-0.47/21 3.2s} 23. f3 {+0.59/18 5.8s} 23... Ng5 {-0.61/22 1.7s} 24. Bg2
{+0.59/17 0.000s} 24... a5 {-0.57/23 2.0s} 25. f4 {+0.97/16 0.81s} 25... Nf7
{-0.42/22 2.2s} 26. Bh3 {+0.97/15 0.000s} 26... Rfe8 {-0.74/22 1.8s} 27. Nf3
{+0.98/15 1.1s} 27... Qg6 {-0.82/22 1.6s} 28. Kh2 {+1.00/16 0.84s} 28... b5
{-0.75/24 1.4s} 29. Rc5 {+1.10/16 1.1s} 29... b4 {-0.77/24 3.1s} 30. a4
{+1.06/17 1.0s} 30... Qh5 {-0.75/20 2.1s} 31. Kg2 {+1.13/16 1.2s} 31... Nd6
{-0.92/23 1.3s} 32. Ne5 {+1.17/16 0.81s} 32... Nf5 {-1.07/25 1.5s} 33. Qf3
{+1.25/17 0.75s} 33... Qxf3+ {-1.03/21 1.6s} 34. Nxf3 {+1.25/16 0.078s} 34... g6
{-1.20/23 2.5s} 35. Rb5 {+1.25/15 0.015s} 35... Ba8 {-1.31/23 1.5s} 36. Bxf5
{+1.23/15 0.42s} 36... exf5 {-1.40/24 1.7s} 37. Kf2 {+1.28/19 1.2s} 37... Rcd8
{-1.51/24 1.9s} 38. Ne5 {+1.32/19 1.1s} 38... Re6 {White wins by adjudication}
1-0
[/pgn]

[d]1r6/4r1k1/1pbp2p1/q1p4p/P1Pp1Pn1/3P1BP1/1R1N3P/RQ4K1 b - - 0 61
SF has just played 61.Ne4-d2 with a zero score.

[d]4r3/4r1k1/1p1p2p1/q1p4p/P1Pp1Pn1/3P1NP1/1R5P/RQ4K1 w - - 0 63
After Gull doubles its rooks along the e file, it sees +70cps black edge. SF here still thinks white is worse by only some 30-40cps.

[d]q3r3/6k1/1R1p2p1/2p4p/P1Pp1PnN/3P2P1/4r2P/RQ4K1 w - - 0 65
Upon entering the 7th rank, the black rook decides the game. Doubled rooks on an open file are so forceful, because they remain unchallenged.

[d]2r2rk1/pb2q1pp/1pn1p3/3p4/3Pnp2/PP1Q1NP1/1BR1PPBP/2R3K1 b - - 0 18
Gull has just doubled its rooks on the c file and sees half a pawn white edge, SF only 20cps.

[d]2r1r1k1/1b3np1/2n1p1qp/ppRp4/3P1P2/PP2QNPB/1B2P2K/2R5 b - - 0 29
SF now sees white is winning, but it is already too late. The battle is decided mainly by the white doubled rooks that support tactically a wide range of lines that would otherwise be impossible. That is why it is always good to have doubled rooks, even if you see nothing concrete, something is bound to exist.

SF would do well to think over why doubled rooks code does not work in it. This is a major term and SF loses games because of its lack, but probably some redundancies again, or imperfect definitions, or maybe even search, influences such an outcome. People that know SF code should know better.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Hacky rules 2

Post by Lyudmil Tsvetkov »

2 other games where a rook is much stronger than an enemy minor plus pawns, but SF would not think so.

[pgn][PlyCount "110"]
[MLNrOfMoves "55"]
[MLFlags "000100"]
[Date "2014.04.20"]
[Round "323"]
[White "Gull"]
[Black "SF"]
[Result "1-0"]
[TimeControl "64+0.32"]

1. d4 {book} 1... e6 {book} 2. c4 {book} 2... Bb4+ {book} 3. Bd2 {book} 3... a5
{book} 4. Nf3 {book} 4... Nf6 {book} 5. Qc2 {book} 5... d6 {book} 6. Nc3 {book}
6... Qe7 {book} 7. g3 {book} 7... e5 {book} 8. dxe5 {book} 8... dxe5 {book} 9.
Bg2 {+0.38/17 3.1s} 9... O-O {-0.35/21 3.3s} 10. O-O {+0.37/18 3.7s} 10... Bg4
{-0.39/21 3.2s} 11. Rfd1 {+0.44/16 3.1s} 11... Re8 {-0.40/21 4.8s} 12. h3
{+0.46/17 2.8s} 12... Bxf3 {-0.37/23 1.1s} 13. Bxf3 {+0.29/17 2.7s} 13... c6
{-0.48/23 7.5s} 14. Bg5 {+0.56/17 1.5s} 14... Bxc3 {-0.46/24 0.98s} 15. Qxc3
{+0.56/17 0.58s} 15... Nbd7 {-0.46/24 0.98s} 16. Bg2 {+0.57/18 2.5s} 16... Nc5
{-0.49/22 2.3s} 17. Be3 {+0.57/16 0.000s} 17... g6 {-0.47/23 1.0s} 18. Rac1
{+0.63/17 3.0s} 18... Kg7 {-0.46/19 1.8s} 19. Kf1 {+0.63/16 1.1s} 19... Nfd7
{-0.46/21 1.9s} 20. g4 {+0.80/15 1.4s} 20... f5 {-0.22/20 2.8s} 21. Rd2
{+0.79/15 1.1s} 21... Kg8 {-0.43/20 1.8s} 22. f3 {+0.61/18 5.5s} 22... e4
{0.00/22 1.2s} 23. f4 {+0.67/17 1.1s} 23... fxg4 {0.00/26 1.2s} 24. hxg4
{+0.35/18 4.6s} 24... Qh4 {0.00/26 0.97s} 25. g5 {+0.35/17 0.000s} 25... Rf8
{0.00/27 0.97s} 26. Kg1 {+0.29/19 2.4s} 26... Rxf4 {-0.06/26 1.4s} 27. Bxf4
{+0.29/18 0.000s} 27... Qxf4 {0.00/26 0.97s} 28. Rcd1 {+0.29/18 0.000s} 28... e3
{0.00/27 0.98s} 29. Rd4 {+0.20/18 2.0s} 29... Qf2+ {0.00/26 0.98s} 30. Kh2
{+0.20/18 0.000s} 30... Ne5 {0.00/26 1.0s} 31. Qe1 {+0.20/18 1.8s} 31... Qxe1
{0.00/26 0.98s} 32. Rxe1 {+0.20/18 0.34s} 32... Re8 {0.00/26 0.98s} 33. Kg1
{+0.28/18 0.88s} 33... Nf7 {-0.16/24 1.6s} 34. Rg4 {+0.16/18 0.52s} 34... Re5
{-0.07/23 1.6s} 35. Rc1 {+0.24/18 1.7s} 35... Nxg5 {-0.09/24 1.4s} 36. Rc3
{+0.29/20 1.8s} 36... Nge6 {-0.20/26 2.4s} 37. Rg3 {+0.21/18 0.000s} 37... Nd4
{0.00/24 1.4s} 38. Rcxe3 {+0.24/19 1.0s} 38... Nxe2+ {0.00/25 0.84s} 39. Kh2
{+0.24/18 0.000s} 39... Rh5+ {-0.21/26 7.1s} 40. Rh3 {+0.24/18 0.000s} 40...
Rxh3+ {-0.17/26 1.8s} 41. Bxh3 {+0.24/18 0.047s} 41... Nd4 {-0.17/27 0.64s} 42.
Re7 {+0.24/18 0.31s} 42... h5 {-0.16/26 1.7s} 43. Rc7 {+0.26/20 1.3s} 43... Kf8
{-0.18/22 1.2s} 44. b3 {+0.26/18 0.000s} 44... g5 {-0.20/21 0.97s} 45. Rh7
{+0.36/17 0.45s} 45... h4 {-0.20/24 0.67s} 46. Bc8 {+0.38/17 0.36s} 46... b5
{-0.50/22 1.6s} 47. cxb5 {+0.46/17 0.33s} 47... cxb5 {-0.53/24 0.75s} 48. Bg4
{+0.54/18 0.84s} 48... Ke8 {-0.65/21 1.0s} 49. Rg7 {+0.64/18 0.52s} 49... Ne4
{-1.32/23 1.8s} 50. Rd7 {+0.80/18 0.42s} 50... Ne2 {-1.27/24 0.44s} 51. Rd3
{+1.12/18 1.2s} 51... N2g3 {-1.49/23 1.3s} 52. Rd5 {+1.12/18 0.45s} 52... a4
{-1.45/24 0.42s} 53. Rxb5 {+1.20/18 1.8s} 53... axb3 {-1.27/22 1.3s} 54. Rxb3
{+1.20/16 0.000s} 54... Nf6 {-1.77/22 1.6s} 55. Kh3 {+1.28/17 0.42s} 55... Kf7
{White wins by adjudication} 1-0

[PlyCount "132"]
[MLNrOfMoves "66"]
[MLFlags "000100"]
[Date "2014.04.20"]
[Round "337"]
[White "Gull"]
[Black "SF"]
[Result "1-0"]
[TimeControl "64+0.32"]

1. e4 {book} 1... c5 {book} 2. Nf3 {book} 2... d6 {book} 3. d4 {book} 3... cxd4
{book} 4. Nxd4 {book} 4... Nf6 {book} 5. Nc3 {book} 5... a6 {book} 6. h3 {book}
6... e6 {book} 7. g4 {book} 7... d5 {book} 8. Nde2 {book} 8... Nxe4 {book} 9.
Nxe4 {+0.31/15 0.83s} 9... dxe4 {-0.33/21 1.7s} 10. Qxd8+ {+0.31/17 0.86s} 10...
Kxd8 {-0.33/1 0.016s} 11. Be3 {+0.39/18 2.7s} 11... Nd7 {-0.29/22 3.3s} 12.
O-O-O {+0.47/16 1.3s} 12... g6 {-0.46/22 4.8s} 13. g5 {+0.43/17 4.9s} 13... h6
{-0.46/22 2.2s} 14. Nc3 {+0.48/18 1.4s} 14... hxg5 {-0.50/23 2.4s} 15. Nxe4
{+0.48/17 0.000s} 15... Be7 {-0.46/24 1.8s} 16. Nxg5 {+0.36/17 3.5s} 16... Ke8
{-0.45/25 1.1s} 17. Bg2 {+0.39/17 0.30s} 17... Nf6 {-0.44/24 3.1s} 18. Bd4
{+0.32/17 1.3s} 18... Rh4 {-0.48/24 1.4s} 19. b3 {+0.37/18 4.0s} 19... Nd5
{-0.39/21 2.0s} 20. Nf3 {+0.38/15 0.70s} 20... Re4 {-0.33/22 3.5s} 21. Ne5
{+0.50/17 1.4s} 21... Rh4 {-0.32/22 3.7s} 22. Nc4 {+0.45/17 0.70s} 22... Bd7
{-0.45/23 1.7s} 23. Bxd5 {+0.53/17 0.69s} 23... exd5 {-0.45/24 0.98s} 24. Nb6
{+0.51/18 1.5s} 24... Rd8 {-0.48/24 1.0s} 25. Be5 {+0.51/17 0.000s} 25... Be6
{-0.46/24 1.0s} 26. Bc7 {+0.51/17 0.047s} 26... d4 {-0.34/21 1.4s} 27. Bxd8
{+0.51/19 4.0s} 27... Kxd8 {-0.43/22 1.4s} 28. Nc4 {+0.51/18 1.8s} 28... Kc7
{-0.37/21 1.0s} 29. Ne5 {+0.51/16 0.000s} 29... Rf4 {-0.45/21 1.6s} 30. Rhe1
{+0.58/17 1.7s} 30... Ba3+ {-0.26/21 2.5s} 31. Kb1 {+0.50/16 0.84s} 31... Rxf2
{-0.38/23 1.5s} 32. Rxd4 {+0.50/17 0.59s} 32... Bxh3 {-0.25/23 0.95s} 33. Rc4+
{+0.46/18 1.2s} 33... Kb8 {-0.32/24 2.7s} 34. Ra4 {+0.52/18 1.4s} 34... Bd6
{-0.32/24 1.4s} 35. Rd4 {+0.42/18 5.4s} 35... Ba3 {-0.26/24 0.88s} 36. Nd3
{+0.44/18 1.8s} 36... Rf3 {-0.32/25 3.1s} 37. Rde4 {+0.39/17 1.1s} 37... Bf5
{-0.09/22 1.3s} 38. R4e3 {+0.28/18 2.1s} 38... Rxe3 {-0.25/25 2.9s} 39. Rxe3
{+0.28/17 0.000s} 39... Bd6 {-0.25/26 0.73s} 40. Re8+ {+0.44/19 1.2s} 40... Kc7
{-0.25/22 1.6s} 41. Rg8 {+0.44/18 0.000s} 41... b5 {-0.27/24 0.70s} 42. Rg7
{+0.46/18 1.2s} 42... Be6 {-0.27/24 0.69s} 43. Kc1 {+0.46/18 0.047s} 43... Be7
{-0.32/24 2.2s} 44. Rg8 {+0.46/18 1.1s} 44... Kc6 {-0.32/22 2.6s} 45. Ra8
{+0.51/20 1.6s} 45... Kb6 {-0.32/23 0.77s} 46. Kd2 {+0.56/21 1.2s} 46... Bg5+
{-0.41/22 2.9s} 47. Ke2 {+0.59/20 1.4s} 47... Bg4+ {-0.41/22 0.50s} 48. Kf2
{+0.68/18 0.47s} 48... Be6 {-0.32/20 1.4s} 49. Rb8+ {+0.75/17 1.7s} 49... Kc7
{-0.44/22 1.5s} 50. Re8 {+0.75/16 0.000s} 50... Bh4+ {-0.49/22 2.9s} 51. Ke3
{+0.77/18 0.67s} 51... Bg5+ {-0.47/22 0.55s} 52. Ke2 {+0.77/18 0.094s} 52... Kc6
{-0.54/21 0.44s} 53. Nb4+ {+0.77/17 0.093s} 53... Kb7 {-0.41/21 0.33s} 54. Kf3
{+0.77/16 0.000s} 54... Bd7 {-0.63/22 1.3s} 55. Rh8 {+0.85/16 0.031s} 55... Be6
{-0.63/21 0.28s} 56. Nd3 {+1.03/18 1.2s} 56... Bd5+ {-0.71/22 0.81s} 57. Ke2
{+0.99/20 1.1s} 57... Kb6 {-0.71/24 0.27s} 58. Rb8+ {+1.07/19 0.72s} 58... Kc7
{-0.71/19 0.41s} 59. Re8 {+1.10/17 0.59s} 59... Be6 {-0.74/20 0.27s} 60. Nc5
{+1.10/16 0.000s} 60... Bg4+ {-0.71/20 0.56s} 61. Kd3 {+1.10/16 0.000s} 61...
Kb6 {-0.83/21 0.88s} 62. Kd4 {+1.18/17 0.56s} 62... a5 {-1.03/19 0.50s} 63. c4
{+1.26/17 0.52s} 63... bxc4 {-1.11/17 0.31s} 64. Kxc4 {+1.33/14 0.34s} 64... Bh6
{-1.05/17 0.33s} 65. Re7 {+1.69/15 0.25s} 65... f6 {-1.63/19 0.31s} 66. Re4
{+1.73/16 0.84s} 66... Bf5 {White wins by adjudication} 1-0
[/pgn]

[d]6k1/1p5p/2p3p1/p1n5/2Pn4/4R2B/PP5K/8 w - - 0 42
It is interesting that both engines do not evaluate quite correctly this position, seeing only some 20cps white advantage. Gull is a bit better in its eval, but just by cps.

[d]5k2/7R/8/ppn3p1/3n2Bp/1P6/P6K/8 b - - 0 48
Now SF is faster to recognize white is much better, but that does not help a lot, as the position is already lost. A good eval knowledge moves earlier, however, before the vital exchanges were made, could have saved SF much trouble and the point.

[d]4k3/8/8/pp4p1/4n1Bp/1P1R4/P3n2K/8 b - - 0 51
A rook seems to be so much stronger than N + 2 pawns.

[d]1k6/1p3p2/p2b2p1/5b2/8/1P1NR3/P1P5/1K6 w - - 0 40
It is rook vs minor + pawn. Gull sees half a pawn white edge, SF only 25cps.

[d]4R3/1k3p2/p3b1p1/1p4b1/1N6/1P6/P1P1K3/8 w - - 0 54
Same imbalance. Moves later search already helps SF realise white is winning.

[d]8/8/1k3ppb/p1N2b2/2K1R3/1P6/P7/8 w - - 0 67
Once again, rook proves to be much stronger than minor + pawn.

Well, you see SF imbalance eval, what concerns rook-minor imbalances, is really wrong. Games where SF evaluates incorrectly this imbalance are really rife. I posted just a few, but there are much more. Something really should be done to fix this problem.

One of Reuven's patches started well, maybe try to improve on it?
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Gullible 2

Post by Lyudmil Tsvetkov »

2 more games where SF severely underestimates blocked pawn on the 6th rank.

[pgn][PlyCount "91"]
[MLNrOfMoves "45"]
[MLFlags "000100"]
[Date "2014.04.20"]
[Round "308"]
[White "SF"]
[Black "Gull"]
[Result "0-1"]
[TimeControl "64+0.32"]

1. Nf3 {book} 1... d5 {book} 2. b3 {book} 2... c5 {book} 3. Bb2 {book} 3... f6
{book} 4. e3 {book} 4... e5 {book} 5. Bb5+ {book} 5... Nc6 {book} 6. O-O {book}
6... Bd6 {book} 7. Be2 {book} 7... Nge7 {book} 8. d3 {book} 8... Be6 {book} 9.
Nfd2 {-0.45/21 1.8s} 9... Ng6 {+0.46/16 1.9s} 10. e4 {-0.34/22 2.0s} 10... d4
{+0.37/16 1.0s} 11. Bg4 {-0.38/22 1.6s} 11... Bxg4 {+0.45/17 1.8s} 12. Qxg4
{-0.50/21 1.8s} 12... Kf7 {+0.51/17 0.92s} 13. a4 {-0.37/21 1.7s} 13... h5
{+0.72/16 1.2s} 14. Qd1 {-0.44/21 2.6s} 14... Bc7 {+0.69/17 3.3s} 15. Ba3
{-0.46/21 1.5s} 15... Qe7 {+0.69/18 2.5s} 16. Nf3 {-0.44/21 1.1s} 16... Rad8
{+0.69/17 0.45s} 17. Nbd2 {-0.48/21 3.3s} 17... a6 {+0.72/19 2.7s} 18. Qb1
{-0.35/22 3.2s} 18... Nf4 {+0.80/18 2.2s} 19. Nh4 {-0.34/23 1.1s} 19... g6
{+0.72/17 2.1s} 20. Qd1 {-0.39/22 8.2s} 20... Ne6 {+0.71/18 3.1s} 21. Bc1
{-0.36/21 0.98s} 21... Qd7 {+0.78/17 2.4s} 22. Ba3 {-0.41/21 1.4s} 22... b5
{+0.74/17 2.0s} 23. Bb2 {-0.36/21 0.98s} 23... Ra8 {+0.77/16 2.0s} 24. g3
{-0.44/18 2.1s} 24... Rhg8 {+0.70/16 2.2s} 25. Ndf3 {-0.20/20 7.6s} 25... Ne7
{+0.68/15 2.2s} 26. Qe2 {-0.31/18 1.2s} 26... Rh8 {+0.63/16 2.8s} 27. Bc1
{-0.33/19 4.0s} 27... Ba5 {+0.69/16 1.2s} 28. Bd2 {-0.34/22 1.4s} 28... Bc3
{+0.63/18 6.6s} 29. Bxc3 {-0.31/23 0.80s} 29... dxc3 {+0.63/17 0.000s} 30. Ng2
{-0.24/22 0.80s} 30... Nc6 {+0.63/16 0.000s} 31. Qd1 {-0.37/22 1.4s} 31... b4
{+0.48/16 6.0s} 32. Ne3 {-0.39/21 1.4s} 32... Rad8 {+0.56/16 0.62s} 33. h4
{-0.48/21 2.8s} 33... Ned4 {+0.72/15 0.45s} 34. Kh2 {-0.57/21 2.4s} 34... Nxf3+
{+0.85/14 0.31s} 35. Qxf3 {-0.35/22 0.67s} 35... Nd4 {+0.90/15 1.1s} 36. Qg2
{-0.43/22 1.0s} 36... g5 {+0.90/14 0.000s} 37. f3 {-0.43/24 0.67s} 37... Rdg8
{+0.78/16 0.81s} 38. Qf2 {-0.48/22 1.2s} 38... Rg6 {+0.82/18 1.5s} 39. Rg1
{-0.46/23 0.64s} 39... Rhg8 {+0.90/17 0.41s} 40. hxg5 {-0.49/22 0.62s} 40...
fxg5 {+0.82/15 0.000s} 41. Raf1 {-0.49/21 0.62s} 41... Qe6 {+0.90/15 0.094s} 42.
Nf5 {-0.62/22 5.0s} 42... Rf6 {+0.95/15 0.59s} 43. Re1 {-0.68/20 0.84s} 43... g4
{+1.56/14 0.36s} 44. Nxd4 {-1.46/19 1.2s} 44... cxd4 {+2.40/16 1.0s} 45. f4
{-1.79/21 0.64s} 45... exf4 {+2.51/16 1.2s} 46. Qxd4
{Black wins by adjudication} 0-1

[PlyCount "93"]
[MLNrOfMoves "46"]
[MLFlags "000100"]
[Date "2014.04.20"]
[Round "318"]
[White "SF"]
[Black "Gull"]
[Result "0-1"]
[TimeControl "64+0.32"]

1. e4 {book} 1... e5 {book} 2. Nf3 {book} 2... Nc6 {book} 3. d4 {book} 3... exd4
{book} 4. Nxd4 {book} 4... Bc5 {book} 5. Nxc6 {book} 5... Qf6 {book} 6. Qd2
{book} 6... bxc6 {book} 7. Nc3 {book} 7... Ne7 {book} 8. Qf4 {book} 8... Qxf4
{book} 9. Bxf4 {0.00/22 2.5s} 9... d6 {+0.01/17 2.1s} 10. f3 {0.00/23 1.1s}
10... Be6 {+0.01/16 3.1s} 11. O-O-O {0.00/22 1.1s} 11... Kd7 {-0.03/16 2.4s} 12.
b3 {+0.29/20 2.0s} 12... Ng6 {-0.10/16 3.1s} 13. Bd2 {+0.36/19 1.2s} 13... h5
{-0.19/16 3.7s} 14. Kb1 {+0.53/20 4.7s} 14... h4 {-0.17/16 1.8s} 15. Na4
{+0.44/21 3.2s} 15... Bd4 {-0.09/16 1.7s} 16. Be2 {+0.37/23 9.8s} 16... Be5
{-0.13/16 1.5s} 17. Ba5 {+0.43/24 1.9s} 17... Nf4 {-0.20/16 0.39s} 18. Ba6
{+0.50/24 0.95s} 18... Nxg2 {-0.07/18 2.3s} 19. Nc5+ {+0.51/23 2.0s} 19... Ke7
{-0.07/17 0.000s} 20. Nd3 {+0.58/24 0.97s} 20... Bc8 {-0.07/17 0.000s} 21. Nxe5
{+0.54/25 0.95s} 21... Bxa6 {-0.06/18 1.4s} 22. Nxc6+ {+0.54/23 0.97s} 22... Kd7
{-0.06/18 0.000s} 23. Nb4 {+0.48/23 2.2s} 23... Bb7 {-0.06/16 0.70s} 24. Nd3
{+0.42/23 3.2s} 24... h3 {-0.03/16 0.88s} 25. Rhg1 {+0.48/22 0.94s} 25... Rh5
{+0.07/19 2.2s} 26. Bc3 {+0.22/20 1.5s} 26... g6 {+0.07/18 2.7s} 27. Rd2
{+0.16/20 1.2s} 27... Re8 {+0.06/18 1.5s} 28. Rf1 {+0.13/23 1.3s} 28... Ba6
{+0.26/16 0.89s} 29. Kb2 {+0.19/22 1.9s} 29... Bxd3 {+0.17/17 1.5s} 30. Rxd3
{+0.13/23 2.2s} 30... Nf4 {+0.24/19 2.5s} 31. Rdd1 {+0.05/23 2.0s} 31... a6
{+0.24/18 0.000s} 32. Bd2 {+0.06/22 2.5s} 32... Ng2 {+0.23/19 1.2s} 33. Bc1
{+0.01/21 1.7s} 33... Rhe5 {+0.31/18 1.5s} 34. Rd3 {0.00/24 3.0s} 34... f5
{+0.40/18 1.4s} 35. Bd2 {-0.02/24 1.6s} 35... g5 {+0.50/18 2.3s} 36. Bc3
{0.00/25 1.1s} 36... R5e6 {+0.42/16 0.000s} 37. exf5 {-0.03/24 2.0s} 37... Re2
{+0.58/17 0.88s} 38. Rd2 {0.00/26 1.5s} 38... R8e5 {+0.45/19 1.3s} 39. f6
{-0.10/21 1.0s} 39... Rxd2 {+0.89/16 1.1s} 40. Bxd2 {-0.51/21 1.1s} 40... Rf5
{+0.89/15 0.000s} 41. Kc3 {-0.37/21 0.84s} 41... g4 {+0.96/14 0.39s} 42. f4
{-0.81/21 1.7s} 42... Ke6 {+0.99/16 0.92s} 43. Kd3 {-1.02/21 2.0s} 43... Rxf6
{+1.18/14 0.42s} 44. Ke4 {-1.02/21 0.52s} 44... d5+ {+1.32/15 0.64s} 45. Kd4
{-1.47/21 2.6s} 45... Kf5 {+1.46/15 0.61s} 46. Ba5 {-1.58/21 0.98s} 46... Re6
{+1.63/16 0.50s} 47. Rf2 {Black wins by adjudication} 0-1
[/pgn]

[d]r6r/3qnk2/p3npp1/1pp1p2p/P3P2N/1PpP1NP1/2P1QP1P/R4RK1 w - - 0 30
Gull sees 60cps black edge, SF only 20cps. The c3 blocked pawn on the 6th rank does not bother SF too much.

[d]3r3r/3q1k2/p4p2/2p1p1pp/Pp1nP2P/1PpPN1P1/2P2PQK/R4R2 w - - 0 37
Even now, SF sees only 40cps black edge, Gull 80cps. The c3 pawn is tremendous.

[d]6r1/5k2/p3qr2/2p1pN1p/Pp1nP1p1/1PpP1PP1/2P2Q1K/4R1R1 w - - 0 44
Only now SF realises it is dead lost. The c3 blocked pawn is instrumental in claiming the win by the sheer pressure it exercises.

[d]4r3/p1pk1p2/3p2p1/7r/4Pn2/1PB2P1p/PKP4P/3R1R2 b - - 0 31
Both engines see themselves in advantage. Who is right? I think Gull. The h3 black pawn is tremendous, and besides h2 is very vulnerable.

[d]4r3/2pk4/p2p2p1/4rp2/4P3/1P1R1P1p/PKP3nP/2B2R2 w - - 0 35
SF still thinks it is equal, Gull sees half a pawn black advantage. The h3 blocked pawn is a permanent threat.

[d]8/2pk4/p2p1P2/5r2/6p1/1PK2P1p/P1PB2nP/5R2 w - - 0 42
Only now SF realises it is losing.

Well, what to say, too many lost SF games on one and the same theme. I really already lost count of them. It should not be very difficult to fix this problem, but who knows when will this happen.
carldaman
Posts: 2283
Joined: Sat Jun 02, 2012 2:13 am

Re: Huge simplification

Post by carldaman »

Lyudmil Tsvetkov wrote:
mcostalba wrote:
mcostalba wrote: Ok I have pushed a branch called closed_positions:

https://github.com/mcostalba/Stockfish/ ... d_position
Following Lyudmil indications I have refined the detector requiring that pawns are on a diagonal chain. Now I don't detect anymore positions as the previous one posted, but only these kind of positions:

[d]rn1qk2r/pp3ppp/2p2n2/2Pp1b2/3Pp3/P1P1P3/3B1PPP/R2QKBNR w KQkq - 1 9
Perfect, that is precisely a KID-type closed position.

Taking into account that an f2 backward pawn is also present, this is precisely the type of position for which the white king should receive some nice penalty, as the general pattern favours black very much, especially what concerns possible king attacks.

I see SF starts understanding the KID now. Carl will be very happy. :D


I'm very happy even more so seeing that Marco is working with you on this very critical matter. :D I believe he won't regret it :)

Now, I've known that since about 5 months ago SF can play a mean KID (usually from the attacking/Black side) and some of the tweaks clearly found their way into how it plays these positions. It is mind boggling how every move has a purpose (see game below) and the execution is incredibly accurate, while Houdini or other top engines have no idea what's coming their way until it's too late.

The problem as I see it, is that SF's eval does not yet allow it to seek out these KID positions in the first place. Once faced with the well-known position after 12 moves in the game below, it outplays everybody in spectacular fashion.

The next step should be to bring its eval in line so that it fully recognizes the attacking potential of such positions and doesn't shy away from them. Rating such positions as much better for White is incorrect and counterproductive, since SF has tremendous fighting chances on the Black side of the Classical KID.

The game is _very typical_ of how SF plays the KID against top engines. I have numerous other examples.

40m/20m acc., 512 MB hash, 2 cores, 5-man syzygy, ponder off

[pgn]
[Date "2014.04.25"]
[Round "1"]
[White "Houdini_4_x64A MP Tactical"]
[Black "Stockfish_140424_x64_sse42 rdm"]
[Result "0-1"]
[ECO "E99"]
[Annotator "CL"]
[PlyCount "85"]
[EventDate "2014.??.??"]
[TimeControl "40/1200:40/600:40/300"]

1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5
Ne7 9. Ne1 Nd7 10. Be3 f5 11. f3 f4 12. Bf2 g5 {<end book>} 13. Nd3 {[%eval
120,22] 63} c5 $5 {[%eval -76,24] [%emt 0:00:28] Mark Tseitlin's rarely seen
move from 1982 (!)} 14. Rb1 $5 {[%eval 114,20] 70 N} Nf6 {[%eval -68,26] [%emt
0:00:21]} 15. b4 {[%eval 110,20] [%emt 0:00:22]} b6 {[%eval -65,24] [%emt 0:00:
29]} 16. a4 {[%eval 110,18] [%emt 0:00:25]} Ng6 {[%eval -75,24] [%emt 0:00:40]
^^} 17. Rb2 $143 $6 {[%eval 120,19] [%emt 0:00:46] this is too slow, White has
to play more energetically on the Q-side} (17. a5 $5 {(30) Richter,M (2410)
-Voelzke,F (2265) Hamburg 1999}) (17. bxc5 bxc5 18. Nxc5 $5 dxc5 19. Bxc5 Rf7
$13 {(28) Novakovic,S (2090)-Zuberoski,E Skopje FRM 1998}) 17... h5 {[%eval
-57,23] [%emt 0:00:56]} 18. Qc2 $143 $6 {[%eval 126,19] 71 White needs to find
an improvement just about here or else he's strategically lost} g4 {[%eval -43,
23] [%emt 0:00:58]} 19. Ra1 {[%eval 111,18] [%emt 0:00:28]} g3 $1 {[%eval -7,
24] [%emt 0:00:42]} 20. hxg3 {[%eval 83,18] [%emt 0:00:56]} fxg3 {[%eval 0,25]
[%emt 0:00:28]} 21. Bxg3 {[%eval 62,18] 67} h4 {[%eval 0,26] [%emt 0:00:21]}
22. Bf2 {[%eval 69,19] [%emt 0:00:36]} cxb4 {[%eval 3,24] [%emt 0:00:32]} 23.
Rxb4 {[%eval 27,18] 112} Nh5 {[%eval 29,25] [%emt 0:00:49]} 24. Bf1 {[%eval 34,
19] 67} Qg5 $40 {[%eval 68,26] [%emt 0:00:57] now Black's attack will only
gather more momentum} 25. Qc1 {[%eval -22,20] 154} Ngf4 {[%eval 59,28] [%emt 0:
00:38]} 26. Nxf4 $2 {[%eval -34,19] [%emt 0:00:29]} ({White is clearly worse
but he could try the tricky} 26. Ne2 $5 Ng3 $40 (26... Qg6 $5)) 26... exf4 {
[%eval 95,28] [%emt 0:00:32]} 27. Rb3 {[%eval -31,20] [%emt 0:00:25]} (27. Ra2
Be5 $1 28. -- $140 h3) 27... h3 $40 {[%eval 107,29] [%emt 0:00:23]} 28. Ra2 {
[%eval -27,19] [%emt 0:00:18]} Be5 $5 {[%eval 122,25] [%emt 0:00:38]} 29. Qe1
$6 {[%eval -55,19] 82} Rf7 $1 $19 {[%eval 262,25] [%emt 0:00:41] the White
King is stuck in the line of fire, so Black only needs a handful of pieces to
gang up on the K-side and it will be over soon} 30. Nb5 {[%eval -171,19] 60} a6
$1 {[%eval 336,26] [%emt 0:00:50] very precise} 31. Nxd6 {[%eval -171,17]
[%emt 0:00:12]} Bxd6 {[%eval 304,27] [%emt 0:00:33]} 32. Rxb6 {[%eval -140,19]
[%emt 0:00:42]} Be5 {[%eval 346,28] [%emt 0:00:25]} 33. Bh4 {[%eval -177,17]
[%emt 0:00:11]} Qg7 {[%eval 411,28] 76} 34. Bf2 $143 $6 {[%eval -207,17] [%emt
0:00:28]} h2+ $1 {[%eval 607,30] [%emt 0:00:50]} 35. Kh1 {[%eval -492,19]
[%emt 0:00:20]} Bd4 $1 {[%eval 662,29] [%emt 0:00:38] deflecting away the
defender of g3} 36. Kxh2 {[%eval -597,18] [%emt 0:00:14]} Bxb6 {[%eval 704,30]
[%emt 0:00:26]} 37. Bxb6 {[%eval -696,18] [%emt 0:00:10]} Ng3 {[%eval 875,30]
106} 38. Kg1 {[%eval -708,19] [%emt 0:00:07]} Qg6 $1 {[%eval 706,30] 72 so the
_Rook_ can take the h-file} 39. Be3 {[%eval -744,17] [%emt 0:00:09]} fxe3 {
[%eval 1112,28] [%emt 0:00:28]} 40. Qxe3 {[%eval -722,15] [%emt 0:00:03]} Rh7 {
[%eval 1259,29] [%emt 0:00:39]} 41. Kf2 {[%eval -1306,19] 89} Rh1 {[%eval 1277,
29] [%emt 0:00:51] 41 moves played and Black's Queenside Bishop and Rook
haven't moved yet (!), yet White is toast anyhow} 42. Bd3 {[%eval -1678,19]
Diagram [#] 78} Bh3 $1 {[%eval 1388,29] 120 Bishop finally moves and it's Game
Over; the final position is amazing, with Black's KID pawn chain magically
gone from the board, but having served its army with great valor (!!)} 43. Qd2
{[%eval -1657,18] [%emt 0:00:37] Arena Adjudication} (43. Qd2 Nh5 $1 44. Be2
Rf8 $19) (43. gxh3 Nxe4+ 44. Bxe4 Qg1+ 45. Ke2 Qd1+ 46. Kf2 Qf1+ 47. Kg3 Qxh3+
48. Kf4 Qh6+) (43. e5 Nf5 $1 44. g4 Rh2+ 45. Ke1 Nxe3 46. Bxg6 Rxa2 $19) (43.
Qd4 Nf5 $19) 0-1
[/pgn]

[D]r1b3k1/8/p5q1/3P4/P1P1P3/3BQPn1/R4KP1/7r b - - 4 42

Surreal, isn't it? :lol:

Cheers,
CL
carldaman
Posts: 2283
Joined: Sat Jun 02, 2012 2:13 am

Re: Huge simplification

Post by carldaman »

Lyudmil Tsvetkov wrote:
Joerg Oster wrote:
mcostalba wrote:
Lyudmil Tsvetkov wrote: this is precisely the type of position for which the white king should receive some nice penalty, as the general pattern favours black very much, especially what concerns possible king attacks.
Why it favors black and not white? What if position is flipped? It would favor white instead?

Once detected the closed position how can SF understand if it favors white or black?
Black's pawn chain is pointing towards the kingside. White's chain towards the queenside. If Black castles short, there is no impact from white's chain. Contrary to black's chain, if White castles short.
So another idea might be to give a penalty for White castling short in these KID like positions. Or, if White already castled short, give a penalty to king safety.
Since this is partially redundant with pawns attacking kingRing, maybe that penalty should be increased in such positions.
Of course, that's all only valid if I correctly understood Lyudmil's idea. :lol:
Hi Joerg.

As usual, you understood my idea better than myself. :D

If you allow me, I think the best thing with such structures would be to give penalty for the king in the general case when it is on the side where the chain is pointed at, i.e. for king on e1,f1,g1,h1, regardless of whether it has castled or not.
I do not know about the penalty, maybe 20cps for a start would be OK, but who knows. What were Joona's values?
Hi Joerg and Lyudmil,

You could also try a progressively larger penalty that increases from e1 to f1 to g1/h1. Maybe 10 cp for e1, 15 cp for f1 and 20 cp for g1/h1.

Regards,
CL