Fortress Detection and Evaluation

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

Moderators: hgm, Rebel, chrisw

Stephen Ham
Posts: 2488
Joined: Wed Mar 08, 2006 9:40 pm
Location: Eden Prairie, Minnesota
Full name: Stephen Ham

Fortress Detection and Evaluation

Post by Stephen Ham »

Hello All,

In one of my ICCF games, my forward looking analyses ran into a couple of positions that I believe are fortresses. I can supply FENs for those positions later, if needed. But at present, my concern is that Cfish 170719 doesn't detect this fortress. So, I've allowed it to run for over three hours. But after a 70 ply search depth, it still claims a 1.14 cp advantage.

Yes, I know I can force subsequent moves and run back-and-forth analyses to confirm that no progress can be made. But my primary question is whether any progress is being made with AB engine coding to detect and correctly evaluate fortresses without such measures. My second question is: can NN engines detect and correctly evaluate fortress positions upon reaching them?

Thanks in advance for educating me on this topic.

All the best,
-Steve-
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Fortress Detection and Evaluation

Post by zullil »

As for your first question, almost no A/B engines have code to correctly evaluate fortress draws as 0.00. My sense is that there is little to no interest in creating and including such code. Certainly Stockfish/Cfish has no such code. Sting, which is based on a very old version of Stockfish, might be worth a look.

I, for one, would be interested in seeing the position(s) in question.
Stephen Ham
Posts: 2488
Joined: Wed Mar 08, 2006 9:40 pm
Location: Eden Prairie, Minnesota
Full name: Stephen Ham

Re: Fortress Detection and Evaluation

Post by Stephen Ham »

Hi Louis,

Thanks for your valued input.

What about NN engines, Louis? Is it possible that based upon experience derived from playing millions of games, and from learning, that they can detect fortresses and evaluate them as 0.00?

I'll be happy to share my fortress FENs. But first, I need to attend a birthday party...my own. :-) It's really on August 27th, but logistically it's best to celebrate now.

All the very best,
Steve
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Fortress Detection and Evaluation

Post by jhellis3 »

You happen to be in luck, this is an issue I have been thinking about for some time (years). I had hoped to have something for it in the initial release of Crystal, but it didn't make it in time. However, I seem to have crossed the biggest hurdle, and should have something out within a couple of weeks which I think people will find quite nice :).

FENs would certainly be welcome, I have a few I validate against, but can always use more.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Fortress Detection and Evaluation

Post by zullil »

Stephen Ham wrote: Fri Aug 23, 2019 11:54 pm Hi Louis,

Thanks for your valued input.

What about NN engines, Louis? Is it possible that based upon experience derived from playing millions of games, and from learning, that they can detect fortresses and evaluate them as 0.00?

I'll be happy to share my fortress FENs. But first, I need to attend a birthday party...my own. :-) It's really on August 27th, but logistically it's best to celebrate now.

All the very best,
Steve
Happy Birthday. Sounds like J. Ellis might soon have a present for you. See above.

[d]7Q/2r5/4K3/1p6/8/1k6/8/8 b - - 0 1

Lc0 doesn't see this as 0.00---though it would with endgame tables, of course.

Code: Select all

       _
|   _ | |
|_ |_ |_| v0.22.0 built Aug  5 2019

setoption name Backend value cudnn-fp16
setoption name Threads value 2
setoption name NNCacheSize value 20000000
setoption name LogFile value lc0.log
ucinewgame
Found pb network file: ./320x24.J13-swa-410000
Creating backend [cudnn-fp16]...
GPU: GeForce RTX 2080 Ti
GPU memory: 10.7534 Gb
GPU clock frequency: 1635 MHz
GPU compute capability: 7.5
CUDA Runtime version: 10.1.0
Cudnn version: 7.6.2
Latest version of CUDA supported by the driver: 10.1.0
position fen 7Q/2r5/4K3/1p6/8/1k6/8/8 b - - 0 1
go nodes 10000000
info depth 1 seldepth 2 time 38 nodes 3 score cp -10 hashfull 0 nps 78 tbhits 0 pv b5b4 e6d5
info depth 2 seldepth 3 time 51 nodes 18 score cp -2 hashfull 0 nps 352 tbhits 0 pv b5b4 h8e5 c7c3
info depth 3 seldepth 4 time 64 nodes 56 score cp -3 hashfull 0 nps 875 tbhits 0 pv b5b4 e6d5 c7c3 h8h1
info depth 3 seldepth 5 time 80 nodes 132 score cp -3 hashfull 0 nps 1650 tbhits 0 pv b5b4 h8h3 c7c3 h3f1 b3b2
info depth 4 seldepth 5 time 92 nodes 196 score cp -2 hashfull 0 nps 2130 tbhits 0 pv b5b4 e6d5 c7c3 h8d4 b3a3
info depth 4 seldepth 7 time 101 nodes 210 score cp -2 hashfull 0 nps 2079 tbhits 0 pv b5b4 e6d5 c7c3 h8d4 b3a3
info depth 4 seldepth 8 time 118 nodes 340 score cp -5 hashfull 0 nps 2881 tbhits 0 pv b5b4 h8h3 c7c3 h3f1 b3b2 e6d5
info depth 5 seldepth 9 time 166 nodes 681 score cp -8 hashfull 0 nps 4102 tbhits 0 pv b5b4 h8h3 c7c3 h3f1 b3b2 e6d5 b4b3
info depth 5 seldepth 10 time 289 nodes 1972 score cp -8 hashfull 0 nps 6823 tbhits 0 pv b5b4 h8h1 c7c3 h1b1 b3a3 e6d5 a3a4 b1a2 a4b5
info depth 6 seldepth 11 time 365 nodes 3150 score cp -9 hashfull 0 nps 8630 tbhits 0 pv b5b4 h8h1 c7c3 h1b1 b3a3 e6d5 a3a4 b1a2 a4b5
info depth 6 seldepth 12 time 505 nodes 5947 score cp -11 hashfull 0 nps 11776 tbhits 0 pv b5b4 h8h1 c7c3 e6d5 b3a3 h1a1 a3b3 d5d4 c3c4 d4d3 c4c3
info depth 6 seldepth 13 time 575 nodes 7428 score cp -11 hashfull 0 nps 12918 tbhits 0 pv b5b4 h8h1 c7c3 e6d5 b3a4 h1a1 a4b5 a1a7 c3c1
info depth 6 seldepth 14 time 650 nodes 9194 score cp -11 hashfull 0 nps 14144 tbhits 0 pv b5b4 h8h1 c7c3 h1b1 b3a3 e6d5 a3a4 b1a2 a4b5
info depth 6 seldepth 15 time 834 nodes 14038 score cp -13 hashfull 0 nps 16832 tbhits 0 pv b5b4 h8h1 c7c3 h1d1 b3a3 e6d5 a3b2 d1a4 b4b3 d5d4 c3c1 a4a5
info depth 7 seldepth 15 time 922 nodes 16715 score cp -14 hashfull 0 nps 18129 tbhits 0 pv b5b4 h8h1 c7c3 h1a1 c3c5 e6d6 c5c3 d6d5 c3c8 a1b1 b3a3 d5d4
info depth 7 seldepth 16 time 1103 nodes 22828 score cp -14 hashfull 0 nps 20696 tbhits 0 pv b5b4 h8h1 c7c3 h1a1 c3c5 e6d6 c5c3 d6d5 c3c8 a1b1 b3a3 d5d4
info depth 7 seldepth 17 time 1516 nodes 38749 score cp -15 hashfull 0 nps 25560 tbhits 0 pv b5b4 h8a1 c7c3 e6d5 c3c8 a1b1 b3a3 d5d4 c8c3 b1a1 a3b3 d4d5 c3c7
info depth 8 seldepth 17 time 2190 nodes 68374 score cp -16 hashfull 0 nps 31221 tbhits 0 pv b5b4 h8a1 c7c3 e6d5 c3c8 a1b1 b3a3 d5d4 c8c3 b1d1 a3b2 d1a4 b4b3
info depth 8 seldepth 18 time 2580 nodes 89690 score cp -16 hashfull 1 nps 34763 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1e2 c8c3 d6d5 a3b3 e2d1 b3a3
info depth 8 seldepth 19 time 3019 nodes 115624 score cp -16 hashfull 1 nps 38298 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1e2 c8c3 d6d5 a3b3 e2d1 b3a3
info depth 8 seldepth 19 time 4322 nodes 203311 score cp -17 hashfull 1 nps 47040 tbhits 0 pv c7c3 h8h1 b5b4 h1a1 c3c6 e6d5 c6c3 a1b1 b3a3 d5d4 a3a4 b1a2 a4b5 a2a7 c3c4
info depth 8 seldepth 19 time 4450 nodes 212244 score cp -17 hashfull 1 nps 47695 tbhits 0 pv b5b4 h8a1 c7c3 e6d5 c3c7 a1d1 b3a3 d1b1 c7c3 d5d4 a3a4 b1a2 a4b5 a2a7 c3c4
info depth 9 seldepth 19 time 5640 nodes 295695 score cp -17 hashfull 2 nps 52428 tbhits 0 pv b5b4 h8a1 c7c3 e6d5 c3c7 a1d1 b3a3 d1b1 c7c3 d5d4 a3a4 b1a2 a4b5 a2a7 c3c4 d4d5
info depth 9 seldepth 20 time 6460 nodes 354936 score cp -17 hashfull 2 nps 54943 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c4 a1d1 b3a3 d6d5 c4c3 d1b1 a3a4 b1a2 a4b5 a2e2 b5a4 e2a6
info depth 9 seldepth 21 time 8793 nodes 524414 score cp -17 hashfull 3 nps 59639 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3a6 a3b3 d6d5 c3c2 a6a1 c2c3 d5d4
info depth 9 seldepth 22 time 13280 nodes 847606 score cp -17 hashfull 4 nps 63825 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3a6 a3b3 d6d5 c3c2 a6a1 c2c3 d5d4 c3c4
info depth 10 seldepth 22 time 16076 nodes 1046049 score cp -17 hashfull 4 nps 65068 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1f1 c8c3 d6d5 a3b2 d5d4 c3c2 f1e1 b4b3 e1b4 b2a2
info depth 10 seldepth 23 time 17572 nodes 1151217 score cp -17 hashfull 5 nps 65514 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3a6 a3b3 d6d5 c3c2 a6a1 c2c3 d5d4 c3c4
info depth 10 seldepth 23 time 22573 nodes 1515778 score cp -17 hashfull 6 nps 67150 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1f1 c8c3 d6d5 a3b2 d5d4 c3c2 f1e1 b4b3 e1b4 b2a2
info depth 10 seldepth 23 time 27574 nodes 1874265 score cp -17 hashfull 7 nps 67972 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1f1 c8c3 d6d5 a3b2 d5d4 c3c2 f1e1 b4b3 e1b4 b2a2
info depth 10 seldepth 24 time 29967 nodes 2044324 score cp -17 hashfull 7 nps 68219 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 a1d1 b3a3 d1f1 c8c3 d6d5 a3b2 d5d4 c3c2 f1e1 b4b3 e1b4 b2a2
info depth 10 seldepth 25 time 33848 nodes 2318078 score cp -17 hashfull 8 nps 68484 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1f3 c8c3 f3a8 a3b3 a8a1
info depth 10 seldepth 25 time 38851 nodes 2672475 score cp -17 hashfull 8 nps 68787 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3a6 a3b3 d6d5 c3c2
info depth 10 seldepth 25 time 43852 nodes 3032524 score cp -17 hashfull 9 nps 69153 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3a6 a3b3 d6d5 c3c2 a6a1
info depth 10 seldepth 25 time 48855 nodes 3387703 score cp -17 hashfull 10 nps 69341 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3a6 a3b3 d6d5 c3c2 a6a1
info depth 10 seldepth 25 time 53858 nodes 3745829 score cp -17 hashfull 10 nps 69550 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3a6 a3b3 d6d5 c3c2 a6a1
info depth 11 seldepth 25 time 55992 nodes 3896866 score cp -17 hashfull 10 nps 69596 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 10 seldepth 25 time 55996 nodes 3897129 score cp -17 hashfull 10 nps 69596 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 25 time 56000 nodes 3897388 score cp -17 hashfull 10 nps 69596 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 25 time 61001 nodes 4251422 score cp -17 hashfull 11 nps 69694 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 26 time 61453 nodes 4281847 score cp -17 hashfull 11 nps 69676 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 26 time 66456 nodes 4638802 score cp -17 hashfull 12 nps 69802 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 26 time 71459 nodes 4998228 score cp -17 hashfull 12 nps 69945 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 26 time 76462 nodes 5353533 score cp -17 hashfull 13 nps 70015 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 26 time 81466 nodes 5707585 score cp -16 hashfull 13 nps 70060 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 26 time 86467 nodes 6063296 score cp -17 hashfull 14 nps 70122 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
info depth 11 seldepth 26 time 88997 nodes 6240232 score cp -17 hashfull 14 nps 70117 tbhits 0 pv b5b4 h8a1 c7c3 e6d6 c3c8 d6d5 c8c3 d5d6 c3c8 a1d1 b3a3 d1d3 c8c3 d3b1 c3c8 d6d5 c8c3 d5d4 a3a4
bestmove b5b4 ponder h8a1
Uri Blass
Posts: 10280
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Fortress Detection and Evaluation

Post by Uri Blass »

I think that more interesting to know if there is a top engine that can evaluate the following position from pablo's game as a draw or at least close to draw.

[d]4b1k1/rp4rp/p1p1p1pP/P1PpPpP1/1R3P2/4PB2/P4K2/7R b - - 0 85

I also wonder if white missed a win in that game or not.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Fortress Detection and Evaluation

Post by zullil »

Uri Blass wrote: Sat Aug 24, 2019 12:55 am I think that more interesting to know if there is a top engine that can evaluate the following position from pablo's game as a draw or at least close to draw.

[d]4b1k1/rp4rp/p1p1p1pP/P1PpPpP1/1R3P2/4PB2/P4K2/7R b - - 0 85

I also wonder if white missed a win in that game or not.
Well, Lc0 (network 320x24.J13-swa-410000) is at least "close" to a draw:

info depth 8 seldepth 23 time 21139 nodes 925517 score cp -28 hashfull 1000 nps 43323 tbhits 0 pv g7e7 h1d1 g8f8 f3g2 e8d7 e3e4 f5e4 b4d4 f8e8 f2e3 a7a8 d4b4 d7c8 g2f1 e8d8 f1e2 d8c7 d1b1 e7e8

Stockfish-dev has White ahead by almost 3 pawns, which is curious since the material is even:

info depth 40 seldepth 41 multipv 1 score cp -284 nodes 4513888 nps 2153572 hashfull 929 tbhits 0 time 2096 pv g7d7 h1b1 g8f8 f2e2 f8e7 b4b6 e7d8 b1b4 d8c7 e2d2 d7d8 f3e2 d8b8 e2d1 a7a8 d1a4 a8a7 d2c3 a7a8 b4b1 a8a7 c3d3 b8d8 d3d4 e8d7 b1b4 d7e8 a4d1 d8b8 a2a3 e8d7 d4c3 b8a8 b4b1 a8d8 c3d2 d8e8 d1a4 e8d8 d2d3 d7e8
bestmove g7d7 ponder h1b1
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Fortress Detection and Evaluation

Post by mwyoung »

Stephen Ham wrote: Fri Aug 23, 2019 10:58 pm Hello All,

In one of my ICCF games, my forward looking analyses ran into a couple of positions that I believe are fortresses. I can supply FENs for those positions later, if needed. But at present, my concern is that Cfish 170719 doesn't detect this fortress. So, I've allowed it to run for over three hours. But after a 70 ply search depth, it still claims a 1.14 cp advantage.

Yes, I know I can force subsequent moves and run back-and-forth analyses to confirm that no progress can be made. But my primary question is whether any progress is being made with AB engine coding to detect and correctly evaluate fortresses without such measures. My second question is: can NN engines detect and correctly evaluate fortress positions upon reaching them?

Thanks in advance for educating me on this topic.

All the best,
-Steve-
Having tested Lc0 NN in thousands of games. Yes it understands some fortresses, and how to create a fortress. Play to trap pieces. And how to breakdown a fortress, if it is not a perfect fortress were A/B engines would be clueless. But it is not perfect in all fortress setups. But better then any A/B engine I have tested.
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
Stephen Ham
Posts: 2488
Joined: Wed Mar 08, 2006 9:40 pm
Location: Eden Prairie, Minnesota
Full name: Stephen Ham

Re: Fortress Detection and Evaluation

Post by Stephen Ham »

Hello All,

Here's one of several fortress positions I've encountered in a present ICCF game - this is a potential future position, quite remote from the actual game:
[d]8/1b1q1pk1/1R2p2p/4P1p1/8/4Q3/5PP1/6K1 b - - 0 42

When I first saw this position, I immediately saw this is a fortress draw. So, I was shocked that Cfish claimed a large White advantage. Being busy, I allowed Cfish to calculate to 70 plies. At that stage it claimed a 1.14cp White advantage and wanted to play 42...Bd5.

While 42...Bd5 is surely OK, the obvious human response is 42...Qd1+ 43 Kh2 Qh5+ 44 Qh3 (forced to avoid perpetual check) Qxh3+ 45 Kxh3 Bd5. However, Cfish still disagrees with me. After searching 81 plies, it advocates 46 f3, claiming a 1.05cp advantage. Again, my human reply is 46...Kg6 (46...h5 probably works too). That brings us to:
[d]8/5p2/1R2p1kp/3bP1p1/8/5P1K/6P1/8 w - - 0 47

Again this seems an obvious fortress draw as White can't improve his position - Black can either move his King or bishop back and forth, or play ...h5. Meanwhile, Black threatens ...Kf5 and then ...Kxe5.

What say you?

All the best,
-Steve-
Stephen Ham
Posts: 2488
Joined: Wed Mar 08, 2006 9:40 pm
Location: Eden Prairie, Minnesota
Full name: Stephen Ham

Re: Fortress Detection and Evaluation

Post by Stephen Ham »

Hello again,

My initial post mentioned multiple fortress draws, all from positions in an ongoing ICCF game. That said, here's another position that's remote from the present game position:
[d]8/5p2/R3bk1p/8/5K2/1p4P1/6P1/8 w - - 0 49

I don't recall what Cfish's evaluation was after a 70 ply search, other than it was a very large White advantage. However, I'd guess that most humans can immediately see that this is a fortress draw.

I only have 5-man Tablebases, but an online 6-man Tablebase can hold this equivalent position, and confirm the draw.
[d]8/5p2/R3bk2/8/5K2/1p6/8/8 w - - 0 1

Sincerely,
-Steve-