Sting - A fatal error in Hash code (Stockfish.2.1.1)

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
lech
Posts: 921
Joined: Sun Feb 14, 2010 9:02 pm

Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by lech » Mon Mar 14, 2016 11:15 am

I found a very important bug, next and next and I doubt that the last one; in the Stockfish 2.1.1 code.
Thanks to this, you (Sting) may use only max 3072 M hash. If you try tu set more (e.g. 4096) you in fact get and use only 64 K (KILO !!!).

Sting probably has all needed tools but to solve each tough position, needs strong hardware (large Hash and many CPUs), solid and stable search.

I prepared quickly a test (with correction) version of Sting 7 (only 32 bit).
download: http://www.mediafire.com/download/xxceg ... 7-test.zip

If somebody is able to help me and to test (solving with a large hash) this version, is welcome.
Especially this very intersting position for a question of lazzy King is worth to try (I can to add a special code or not).
[d]B7/p1p5/k2p4/p3p3/P1Nb1p2/6p1/7p/3K4 w - - 0 1 win Ke1 -> c8 by h3 gate.
White King can statrs from e.g. a2!

The full version of Sting 7 (with source code and 64-bit compilation) should to be ready in c.a. two weeks.
Maybe, I can't be friendly, but let me be useful.

Jouni
Posts: 1786
Joined: Wed Mar 08, 2006 7:15 pm

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by Jouni » Mon Mar 14, 2016 8:27 pm

Analysis by Stockfish 100316 64 BMI2:

1.Ke1 f3 2.Bxf3 Be3 3.Kf1 Bg5 4.Kg2 Bh4 5.Bc6 h1R 6.Kxh1 Bg5 7.Kg2 Bf4 8.Bf3 e4 9.Bxe4 Be5 10.Kh3 Bf4 11.Kg4 Bg5 12.Kf5 Bd8 13.Ke6 d5 14.Bxd5 c6 15.Bxc6 g2 16.Bxg2 Bg5 17.Kd7 Bf6 18.Kc8 Bd8 19.Bb7#
+- (#19) Depth: 55/62 00:05:39 4155mN, tb=3132094
Jouni

Paloma
Posts: 645
Joined: Thu Dec 25, 2008 8:07 pm

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by Paloma » Mon Mar 14, 2016 9:02 pm

Thank's Marek

unfortunately my comp has only 4GB RAM, so i can't test it.

Vinvin
Posts: 4024
Joined: Thu Mar 09, 2006 8:40 am

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by Vinvin » Tue Mar 15, 2016 4:11 am

Hello Marek,
the engine have trouble to start in Arena with 8 GB of hashtable ...

Dann Corbit
Posts: 8662
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by Dann Corbit » Tue Mar 15, 2016 4:30 am

32 bit processes have limits on addressable ram.
SEE:
https://msdn.microsoft.com/en-us/library/aa366778.aspx

Typically you get 2 GB by default and 4GB with a special flag (if available) on 32 bit Windows.

The rules differ on 32 and 64 bit OS, but in both cases 32 bit processes are limited.
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.

lech
Posts: 921
Joined: Sun Feb 14, 2010 9:02 pm

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by lech » Tue Mar 15, 2016 10:56 am

Dann Corbit wrote:32 bit processes have limits on addressable ram.
SEE:
https://msdn.microsoft.com/en-us/library/aa366778.aspx

Typically you get 2 GB by default and 4GB with a special flag (if available) on 32 bit Windows.

The rules differ on 32 and 64 bit OS, but in both cases 32 bit processes are limited.
Thanks Dann!

I changed the hash code of Stockfish 2.1.1 :

Code: Select all

size_t newSize = 1024;
 while &#40;2ULL * newSize * sizeof&#40;TTCluster&#41; <= &#40;mbSize << 20&#41;)
      newSize *= 2;
to:

Code: Select all

size_t newSize = 1024;
while &#40;2ULL * newSize * sizeof&#40;TTCluster&#41; <= &#40;uint64_t&#40;mbSize&#41; << 20&#41;)
      newSize *= 2;
mbSize is size_t type, and it is probably 32-bit for 64-bit Microsoft compiler too.
But, as you wrote it is too small for the 32-bit compilation. :)
Maybe, I can't be friendly, but let me be useful.

lech
Posts: 921
Joined: Sun Feb 14, 2010 9:02 pm

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by lech » Tue Mar 15, 2016 11:01 am

Vinvin wrote:Hello Marek,
the engine have trouble to start in Arena with 8 GB of hashtable ...
Hi Vincent, if you can start this test Sting with 4 GB it would be a good result. Let me know if not. Thanks! :)
Maybe, I can't be friendly, but let me be useful.

lech
Posts: 921
Joined: Sun Feb 14, 2010 9:02 pm

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by lech » Tue Mar 15, 2016 11:06 am

Jouni wrote:Analysis by Stockfish 100316 64 BMI2:

1.Ke1 f3 2.Bxf3 Be3 3.Kf1 Bg5 4.Kg2 Bh4 5.Bc6 h1R 6.Kxh1 Bg5 7.Kg2 Bf4 8.Bf3 e4 9.Bxe4 Be5 10.Kh3 Bf4 11.Kg4 Bg5 12.Kf5 Bd8 13.Ke6 d5 14.Bxd5 c6 15.Bxc6 g2 16.Bxg2 Bg5 17.Kd7 Bf6 18.Kc8 Bd8 19.Bb7#
+- (#19) Depth: 55/62 00:05:39 4155mN, tb=3132094
Thanks, Jouni.
It would be good to know, if Stockfish is able to solve the same positions but with white King on a2 square.
[d]B7/p1p5/k2p4/p3p3/P1Nb1p2/6p1/K6p/8 w - - 0 1 win Ka2 -> c8 by h3 gate.
The problem of lazy King is very interesting and you can help me much. :)
Maybe, I can't be friendly, but let me be useful.

lech
Posts: 921
Joined: Sun Feb 14, 2010 9:02 pm

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by lech » Tue Mar 15, 2016 11:08 am

Paloma wrote:Thank's Marek

unfortunately my comp has only 4GB RAM, so i can't test it.
Thanks Herbert!
Unfortunately I can use only 1 GB Hash and I am like a blind men in the forest. :lol:
Maybe, I can't be friendly, but let me be useful.

Dann Corbit
Posts: 8662
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Sting - A fatal error in Hash code (Stockfish.2.1.1)

Post by Dann Corbit » Tue Mar 15, 2016 11:19 am

If you use size_t for allocations it should be useful for any model.
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.

Post Reply