Not logged inRybka Chess Community Forum
Up Topic The Rybka Lounge / Computer Chess / Yet another Stockfish derivative
- - By Eelco de Groot (***) Date 2017-07-03 05:34 Edited 2017-07-03 05:40 Upvotes 1
Not sure if this works, or if the forum moderators would rather not see executables posted here. In which case I will delete the post. This is an installment of an oldie, by Tolkien inspired dragon name Ancalagon, (the Black). It is based on the very latest Stockfish sources of three days ago, with very little change mainly in search.cpp. One small change in eval to give a greater penalty to locked up pieces, not just based on mobility but also on threats to their mobility. The main thing changed in search is "real" Deep Blue like extensions which differ from Stockfish extensions mainly that they can also be applied in ALL nodes in a nullwindow search. I've written them as reductions however so, IF this works it should actually reduce the branching factor. I don't know yet if my implementation is possible I first tried a single ply reduction, but it now goes much farther than that almost IID search size reductions of depth/4! If this does not work I'll have to cut it back. I love the bench though:  

===========================
Total time (ms) : 2107
Nodes searched  : 3987091
Nodes/second    : 1892307

I've included a single compile, a 64 bit bmi2 This is just a one time upload as I don't think it's a good idea to distribute compiled code this way. Source code is included in the archive.

My mobility calculation, not tuned, I just used the existing 'Hanging' penalty again.:

              int count = 0;
        if (b & kingRing[Them])
        {
            kingAttackersCount[Us]++;
            kingAttackersWeight[Us] += KingAttackWeights[Pt];
            count = popcount(b & attackedBy[Them][KING]);
            kingAdjacentZoneAttacksCount[Us] += count;
        }

        bb = b & mobilityArea[Us];
        int mob = popcount(bb);

        mobility[Us] += MobilityBonus[Pt - 2][mob];

        if (mob == 0 || !(bb & ~attackedBy[Them][ALL_PIECES]))
        {
            if ( mob > 0 || s & attackedBy[Them][ALL_PIECES])
                score -= Hanging;
            if (count == 0 && mob == 0)
                score -= Hanging;
        }
Attachment: Ancalagon20170703Stockfish-derivative.7z - BMI2 compile + sources (447k)
Parent - - By gsgs (***) [de] Date 2017-07-03 13:16
how to implement that in asmfish ?

asmfish comes with its compiler and working make.bat on old Windows

(I need Linux-popcnt executables)
Parent - - By Eelco de Groot (***) Date 2017-07-03 18:59 Edited 2017-07-03 19:02
Helo Guenter,

Thanks for the interest! Well, I would not know how to make an assembler version, I do have some books but they are about Z80 assembly code, fine for studying the original Sargon code from Dan and Kate Spracklen (I have the book) but a bit out of date for the Ryzen or Epyc. I even bought a very thick book about the Zilog Z8000 assembly code :red: I never read as much as a single page out of it I think and I don't think many computers were ever built using that processor, one of the first generation 16 bit processor.... The Motorola 68000 took over the market. This was way before the 80386...

It's not a lot of code to add, but it's also not something you could do with a hex editor. Frans Morsch could do it I'm sure or Ed Schröder from Rebel. The wizards. Or the Spracklen's, or Marty Hirsch.

Even if you could get somebody to do it, the real problem would be maintaining it if Stockfish code is changed. I don't think it is really worth the effort unless the code itself would bring Elo, in which case there is no obstacle to integrating it in Stockfish itself. At the moment my machine is a bit busy so I could not run any match.  Anyway, for speed critical application chess I think most people will just use asmFish now.  


Sargon in bookform
Parent - - By gsgs (***) [de] Date 2017-07-04 06:03
Helo Eelco,

it looked so easy with that small bit of code above ...

the .asm sources are available and commented and organized
and variable-named and updated similar to stockfish,
your small addition could be easily (?) included each time by you or me or others.

the best system in terms of $/(kn/s)  and W/(kn/s) are Z3735 tablets running asmfish,
stockfish is 2.5 times slower here.

also easier,faster,smaller to compile and to test (app-finger-touch instead of keyboard and mouse)
Parent - - By Eelco de Groot (***) Date 2017-07-05 23:30

> Helo Eelco,
>
> it looked so easy with that small bit of code above ...
>


Hello!

:red: I'm sorry, that was only the single change in evaluation at the time. I think it is a fair assumption that this little change does not cost much but it would have to pass in Fishtest. I have not tried that yet, but anybody is free to try. I have added some more small changes in eval in a new version 14 of this Ancalagon, finished a few hours ago, mainly because I wanted to improve performance in Topalov - Shirov and in a testposition from Michael Byrne a bit where a bishop pins a queen on the king. So I give larger penalties for pieces pinned on the king, not just pinning a queen. And they don't count as own King protector or enemy King attackers because they are at the moment supposed to be pinned. The pinners may be hanging themselves so it is risky to give these large penalties but a little bit less King Safety does not hurt much on a very long search (probably). These eval changes probably are not totally free in nps etc. Or they could be simplified. And should be tested, etc...

I updated search too and it is now supposed to be less susceptible to Zugzwang in my new version 14.

The search changes are more interesting for me to try and easier to see some effect on deep searches which in turn is not always easy to test with the framework. Anyway measuring Elo is requiring enormous amounts of games and probably a machine with little else running on it than the matches, which in my case is not often.

Tested for Elo it's not, but now it can solve Topalov - Shirov :smile:

8/8/4kpp1/3p1b2/p6P/2B5/6P1/6K1 b - -


Engine: Ancalagon HT (4 + 3 threads, i7 6700, 512 MB)
by T. Romstad, M. Costalba, J. Kiiski, G. Linscott

28/36  0:01   -3.53   {no scalefactor in the unequal coloured bishop endgame, if the strong side has more than one passer.}  1...Be4 2.g3 f5 3.Kf2 Kd6 4.Bd4 Kc6
                       5.Ke3 Kb5 6.Kd2 Kb4 7.Bg7 a3 8.Bd4 Bb1
                       9.Ke3 Kb3 10.Kd2 Kc4 11.Ke3 Bd3
                       12.Bf6 Bc2 13.Kd2 Be4 14.Ke3 Bd3 (18.766.016) 16066

29/37  0:03   -3.97--  1...a3 2.Kf2 (51.242.283) 16519

29/39  0:03   -3.60--  1...a3 2.Kf2 Be4 3.g4 f5 4.Kg3 fxg4
                       5.Kxg4 Kd7 6.Kf4 Kc6 7.Bb4 a2 8.Bc3 Kb5
                       9.Ke3 Kc5 10.Be5 Kc4 11.Bd4 Bd3
                       12.Bg7 Bc2 (59.156.880) 16556

29/39  0:03   -3.60    1...a3 2.Kf2 Be4 3.g4 f5 4.Kg3 fxg4
                       5.Kxg4 a2 6.Kf4 Bc2 7.Be5 Kd7 8.Ke3 Kc6
                       9.Bb2 Kb5 10.Kd2 Bf5 11.Be5 Kc5
                       12.Ke3 Bc8 13.Bd4+ Kc4 14.Be5 Bh3 (62.426.623) 16563

30/45  0:04   -3.53--  1...a3 2.Kf2 Be4 3.g4 f5 4.Kg3 fxg4
                       5.Kxg4 Kd7 6.Kf4 Kc6 7.Bb4 a2 8.Bc3 Kc5
                       9.Ke3 Kc4 10.Bd4 Kb3 11.Kd2 Bb1
                       12.Bg7 Kc4 13.Ke3 (74.543.852) 16732

30/45  0:04   -3.53    1...a3 2.Kf2 Be4 3.g4 f5 4.Kg3 fxg4
                       5.Kxg4 Kd7 6.Kf4 Kc6 7.Bb4 a2 8.Bc3 Kc5
                       9.Ke3 Kc4 10.Bf6 Kb3 11.Kd2 Bf5
                       12.Bg7 Kc4 13.Ke3 Bd3 14.Bd4 Be2 (77.608.589) 16754

31/45  0:04   -3.60++  1...a3 2.Kf2 Be4 3.g4 f5 4.Kg3 fxg4
                       5.Kxg4 Kd7 6.Kf4 Kc6 7.Bb4 a2 8.Bc3 Kc5
                       9.Ke3 Kc4 10.Bg7 Kb3 11.Kd2 Bf5
                       12.Bf6 Kb4 13.Ke3 (81.508.001) 16743
.
.
.
42/52  0:42   -4.17    1...a3 2.Kf2 Bc2 3.g3 Kf5 4.Ke3 Kg4
                       5.Bxf6 Kxg3 6.Kd2 Bf5 7.Ke3 a2 8.Kd2 Kf3
                       9.Ba1 Bd7 10.Bb2 Kf4 11.Bf6 Ke4
                       12.Ba1 Be6 13.Ke2 Kf4 14.Bb2 Bg4+ (710.651.410) 16645

43/52  0:54   -4.19    1...a3 2.Kf2 Bc2 3.Ke2 Kf5 4.Ke3 a2
                       5.Bd4 Be4 6.g3 Bh1 7.Ba1 Kg4 8.Bxf6 Kxg3
                       9.Kd2 Kf3 10.Kd3 Kf4 11.Kd2 Ke4
                       12.Bc3 Kf3 13.Bf6 Bg2 14.Bc3 Kg4 (905.282.544) 16533

44/52  1:10   -4.26++  1...a3 2.Kf2 Bc2 3.Ke2 Kf5 4.Ke3 Be4
                       5.g3 Kg4 6.Bxf6 Kxg3 7.Ke2 Bf5 8.Ke3 a2
                       9.Kd2 Kf3 10.Ba1 Bh3 11.Kd3 Kf4
                       12.Kd2 Ke4 13.Bb2 d4 14.Ba1 Bf5 (1.153.605.377) 16438

44/52  1:20   -4.19--  1...a3 2.Kf2 Bc2 3.Ke3 Kf5 4.Kd2 Bb3
                       5.Ke3 a2 6.Bb2 Bc2 7.Bd4 Bb1 8.g3 Kg4
                       9.Bxf6 Kxg3 10.Kd2 Kg4 11.Ke3 Bf5
                       12.Kd2 Be4 13.Ke3 Bb1 14.Kd2 Bf5 (1.323.609.746) 16394

44/52  1:37   -4.17    1...a3 2.Kf2 Bc2 3.Ke3 Kf5 4.Kd2 Bb1
                       5.g4+ Kxg4 6.Bxf6 a2 7.Ke3 Kg3 8.Kd2 Kh3
                       9.Ke3 Kg2 10.Be5 Bf5 11.Ke2 Be6
                       12.Kd2 Kf3 13.Bc3 Bf5 14.Bf6 Be4 (1.612.583.937) 16455

45/53  3:03   -4.25++  1...Bc2 (3.039.473.344) 16594

45/53  3:09   -4.19    1...a3 2.Kf2 Bc2 3.Ke3 Kf5 4.Kd2 Be4
                       5.g3 Kg4 6.Bxf6 Kxg3 7.Kc3 a2 8.Kd2 Bf3
                       9.Ke3 Bg4 10.Kd2 Bd7 11.Ke3 Bc6
                       12.Kd2 Kg4 13.Kc2 Bb5 14.Kd2 Kf3 (3.154.232.370) 16603

46/57  3:22   -4.24    1...a3 2.Kf2 Bc2 3.Ke3 Kf5 4.Kd2 Bb3
                       5.Kd3 a2 6.Bb2 Bc4+ 7.Ke3 Bf1 8.g3 Kg4
                       9.Bxf6 Kxg3 10.Kd2 Bb5 11.Ke3 Bc4
                       12.Kd2 Bf1 13.Kc2 Kf4 14.Kd2 Ke4 (3.346.738.025) 16545

47/57  5:04   -4.17--  1...a3 2.Kf2 Bc2 3.Ke3 Kf5 4.Kd2 Bb1
                       5.Ke3 Be4 6.g3 a2 7.Bb2 Bh1 8.Bd4 Bg2
                       9.g4+ Kxg4 10.Bxf6 Bf3 11.Kd3 Be4+
                       12.Kd2 Bf5 13.Ke3 Bc2 14.Kd2 Bb3 (5.113.013.784) 16767

47/57  7:17   -4.24++  1...Bh3 (7.392.912.146) 16897

47/60  11:07  -4.35++  1...Bh3 2.gxh3 Kf5 3.Kf2 Ke4 4.Bb2 f5
                       5.Kf1 Ke3 6.Bc1+ Kd3 7.Bb2 d4 8.Ke1 Ke3
                       9.Ba3 f4 10.Bf8 Kf3 11.Bd6 d3 12.Kd1 Ke3
                       13.Bc5+ Ke4 14.Bf8 f3 (11.435.305.222) 17141

47/60  14:35  -4.50++  1...Bh3 2.gxh3 Kf5 3.Bb4 Ke4 4.Kf1 Kd3
                       5.Bc5 Kc3 6.Ke1 f5 7.Ba3 Kc2 8.Bd6 Kd3
                       9.Kf1 Kd2 10.Bc5 Kc3 11.Kg2 Kc4
                       12.Be7 Kd3 13.Kf2 Kc3 14.Bf8 Kd2 (15.314.750.988) 17493

47/60  18:47  -4.71++  1...Bh3 (20.087.362.696) 17816

47/62  22:30  -5.00++  1...Bh3 2.gxh3 (24.363.768.507) 18046

47/62  27:02  -5.37++  1...Bh3 2.gxh3 (29.604.976.237) 18240

47/62  32:05  -5.85++  1...Bh3 2.Kf2 Kf5 3.gxh3 Ke4 4.Bb2 f5
                       5.Ke2 f4 6.Kf1 Kf3 7.Ba3 d4 8.Bc1 Kg3
                       9.Bb2 d3 10.Be5 a3 11.Ke1 d2+
                       12.Kxd2 a2 13.Kd3 Kxh4 14.Ke2 Kg3 (35.323.108.218) 18346

47/62  37:01  -6.47++  1...Bh3 2.Kf2 Kf5 3.Bb4 Ke4 4.gxh3 f5
                       5.Ke1 Kf3 6.Kd2 Kg3 7.Be7 Kxh3 8.Ke2 Kg3
                       9.Kd2 f4 10.Bd6 d4 11.Ke1 Kg4 12.Be5 d3
                       13.h5 d2+ 14.Kxd2 gxh5 (40.640.712.785) 18298

47/62  44:00  -7.27++  1...Bh3 2.gxh3 Kf5 3.Bb2 Ke4 4.Kg2 d4
                       5.Kf2 f5 6.Ke1 f4 7.Ba3 d3 8.Bc1 Kf3
                       9.Kd1 d2 10.Bxd2 a3 11.h5 gxh5 12.h4 a2
                       13.Bc3 Kg3 14.Ke2 Kg2 (48.165.931.219) 18241

47/62  54:59  -8.29++  1...Bh3 2.Kf2 Kf5 3.Bb2 Ke4 4.gxh3 f5
                       5.Bc1 d4 6.Kg3 f4+ 7.Kf2 d3 8.Ba3 Kd5
                       9.Bb2 Kc4 10.Be5 Kb3 11.Bxf4 a3
                       12.Ke3 a2 13.Be5 a1Q 14.Bxa1 Kc2 (59.610.470.544) 18069
.
.
.
48/73  543:53 -28.45   1...Bh3 2.Kh2 Bg4 3.Kg3 Kf5 4.Kf2 Bh3
                       5.Bb2 Ke4 6.h5 gxh5 7.gxh3 d4 8.Kf1 f5
                       9.Ke2 f4 10.Kd2 f3 11.h4 d3 12.Ke1 Kf4
                       13.Ba3 Kg4 14.Bb4 Kg3 (528.768.565.684) 16203


best move: Bf5-h3 time: 543:53.469 min  n/s: 16.203.326  nodes: 528.768.565.684

> the .asm sources are available and commented and organized
> and variable-named and updated similar to stockfish,
> your small addition could be easily (?) included each time by you or me or others.
>


Yes this an amzing effort.

> the best system in terms of $/(kn/s)  and W/(kn/s) are Z3735 tablets running asmfish,
> stockfish is 2.5 times slower here.
>


That is amazing that asmFish runs so much faster there.

> also easier,faster,smaller to compile and to test (app-finger-touch instead of keyboard and mouse)

Attachment: Ancalagon20170705Stockfish-derivative.7z - Ancalagon The Black (version with search_014.cpp) (447k)
Parent - - By Hamster (**) [ch] Date 2017-07-07 17:29
Sounds intriguing, just googled and saw a variety of processors (Z3735D, Z3735E, Z3735F, Z3735G) which do not seem to differ too much but there are lots of tablets with those processors. Any tips on a specific tablet with a lot of bang for the buck? What is the kN/s for asmFish on such a tablet? Price seems to be around €100.
Parent - By gsgs (***) [de] Date 2017-07-07 18:04 Edited 2017-07-07 18:25
~1700 kn/s in the startposition, stable ... I run several of these for days, weeks.
Cheapest was Irulu 7'' Nuvision for ~40$, no longer available and don't easily ship to Europe.
Someone wanted to sell 50 of these for $1500 in Jan. or such at ebay, afair.

In USA you can probably still get the 8'' version for ~$60
Then Onda tablets from China for ~$80
In Germany old used Tolino Tab 8
"Compute sticks" for ~$100
"Nextbook" at Walmart in USA
cheapest that I could just find was the "Nuvision" tablet, 7.85'', for $55, 1GB RAM
Get Android versions, or dual OS, it's also possible to install Android on Windows-versions,
but maybe not so easy.

It should be possible to just use the mainboards and connect them to PC or
assign tasks to them by wireless commands from PC (?)
Parent - - By Felix Kling (Gold) [de] Date 2017-07-06 18:37
it is no problem to post executables if there are neither legal problems nor malware is distributed. So feel free to post :-)
Parent - - By Labyrinth (*****) [us] Date 2017-07-06 23:55
Should probably zip first though, as plenty of upload sites/browsers/anti-virus like to bitch about .exe by itself
Parent - By Eelco de Groot (***) Date 2017-09-02 14:05 Edited 2017-09-02 14:21
Thanks Felix and Labyrinth,

I used .7z, it is more Linux originally but 7zip is easy to install on Windows as well.
Development is slowed down a bit but I will upload a -bmi2 compile of Marco's 'Natural TB' branch. I add my own small eval changes.

bench:

===========================
Total time (ms) : 2433
Nodes searched  : 4974113
Nodes/second    : 2044436
TB hits         : 0
Parent - By Eelco de Groot (***) Date 2018-01-19 10:29 Edited 2018-01-19 10:46 Upvotes 1
Hi All,

A new version out based on almost the latest Stockfish sources. This one is called Kaissa. The goddess of chess but also in honour of the original Russian Kaissa program that competed with Chess 4.7

I am not yet including a default contempt, it is still set at zero so up to the user. Also I have not yet reverted to Joona's old timemanagement, it is not very urgent for analysis but for playing without a time increment I'd recommend increasing the Move Overhead in this to prevent at least time losses. The default is 30 ms but I would increase that a lot, to at least one second for say game in five minutes (so set it at 1000) Just to be on the safe side :fat: That would also be my advice for Stockfish with the non Joona time management. If you have the latest Stockfish development version that is at least a bit safer but default move overhead is still a very low number.

I also did not put in the latest King safety change as I'm not certain Kaissa is compatible with that and not Günther Demetz' simplification of his own Enhanced Verification Search. In short this is basically still Stockfish Dev version of 2018-01-04 with some changes. I am trying to modify eval based on the Alpha Zero games we know but that is a slow process and without Fishtest or lczero or Alpha Zero hardware, hazardous. In other words there could be regressions in Kaissa compared with the Stockfish Development Version it is based on. That is one more reason why you should consider this a beta.

Only a BMI2 compile at the moment but I could make others. Compiled with TDM-GCC-64 Not the latest version I think but I would recommend it to Windows users who want to experiment with compiling Stockfish C++11 themselves. The great advantage of this compiler in my opinion is that it really works on Windows :lol:

(Referring to the last upload I made here: No Natural Tablebases in this version as I don't believe that particular experiment fom Marco was an instantaneous success. I don't have Syzygy tablebases installed so I also would not be able to test it myself at the moment.)

This is just a beta because I did not yet test it. It should work but I can't guarantee instantaneous success :fat: Bench on my i7 6700:

===========================
Total time (ms) : 3107
Nodes searched  : 5786415
Nodes/second    : 1862380
Attachment: Kaissa20180104basedonStockfish.7z - BMI2 compile is included with the Stockfish sources (444k)
Parent - - By Eelco de Groot (***) Date 2018-01-23 19:16 Edited 2018-01-23 19:25 Upvotes 1
Here is a version of Kaissa, especially for Flying Dutchman. He requested a popcount version, I don't know exactly how to make that but I made one with make profile-build ARCH=x86-64-modern COMP=mingw which I hope will work on his system. It is not from the same sources as in above post because I don't think the present version of Stockfish is working very well with the Kaissa changes. I just went back to the original sources from 2017-09-22 Here I think the Kaissa changes are at least working better. It is not as strong as present day Stockfish but if the changes don't work in that, you'd not gain anything and I think probably lose Elo. For analysis it is not so important anyway.

So, this is at least the original Kaissa :smile:

I will add the sources later but it is much like the above, only with a much earlier Stockfish (a few months back) At least time magement is up to date in this one, because it was not changed yet.
Benchnumber is also more reasonable than in present day Stockfish.

bench:

===========================
Total time (ms) : 3039
Nodes searched  : 5687670
Nodes/second    : 1871559
Attachment: Kaissa.exe - uncompressed version (1149k)
Parent - By Eelco de Groot (***) Date 2018-01-25 11:08 Edited 2018-01-25 11:13
If this does not work on AMD machines that do not have SSE4, can someone maybe make a compile for Flying Dutchman? I made another using make profile-build ARCH=x86-64 COMP=mingw so that is for machines without SSE4 but I don't know if that will work on a Ryzen for instance, which I suppose some people have. This is the latest Stockfish version by the way. The bench has gone up again mainly -well my theory for the moment- because of the latest eval changes in Stockfish that make King Safety with all the changes in Kaissa probably too high to be optimal. But I have not tested that. Maybe even people may like the high King Safety. No Large Pages etc, sorry You will have to adapt the code for that. Also no old or extra UCI options like in SugaR. You will have to adapt the code for that.

Up to date with Stockfish sources except the Enhanced Verification Search for which I use Günther's first version which I think may be better but I can be wrong. It is still a beta after all.

Benchnumber:

===========================
Total time (ms) : 3631
Nodes searched  : 6897786
Nodes/second    : 1899693
Attachment: Kaissa_noSSE4.exe - Source code is Stockfish 2018-01-23 with Kaissa changes. (1148k)
Attachment: src.7z (431k)
Parent - - By FlyingDutchman (*) [nl] Date 2018-01-25 18:06
Hi Eelco,

Thanks for this popcnt compile. It is running very stable on my systen with 2X 8C E5-2690 cpu.
As I understand is this version based on older SF sources so I will try the NOSSE4 version also.
Though it lacks support for Large Pages, it does 30.000 - 35.000 Kn/s in middle games.
Thanks for sharing you're ideas with the chess community.

With kind regards,

Gerrit aka Victorious aka FlyingDutchman
Parent - By Eelco de Groot (***) Date 2018-01-26 16:02
Thank you, for the feedback Gerrit! I'm glad one at least works now on your E5. I was afraid I had to make yet another version for AMD processors somehow but it seems that is not necessary :red: I hope you have some fun with Kaissa!
Parent - By Eelco de Groot (***) Date 2017-09-02 14:15 Upvotes 1
This is Marco's Natural TB branch, bmi2 compile. Not intended for Threadrippers :slim: (You need a -popcount compile at least I think so. Or asm version.. :fat:) Marco has some very good testresults with this one, but 'Syzygy Ronald' is rather skeptical and there is quite a bit of discussion which I have not followed at the moment. Everyone using Syzygy bases can look for himself. The eval is a bit changed, that change is mine. Testresult I have only 50 games played so that does not say anything. I anyone wants the .pgn I can post but this is not yet of the Natural TB version, just my eval changes.

Marco's Natural TB sources can also be found here, without eval change: https://github.com/official-stockfish/Stockfish/tree/699d5df83a67dd2e11cce6e653b62d8b1309cd56
Attachment: Stockfish-Natural20170902.7z - Probably the strongest normal Stockfish at the moment, excluding Cerebellum or asm versions (437k)
Up Topic The Rybka Lounge / Computer Chess / Yet another Stockfish derivative

Powered by mwForum 2.27.4 © 1999-2012 Markus Wichitill