fairystockfish.git
5 years agoIncrease king danger for bughouse
Fabian Fichter [Sat, 14 Mar 2020 18:56:11 +0000]
Increase king danger for bughouse

bughouse
Total: 250 W: 143 L: 106 D: 1

5 years agoSmall cleanups
Joost VandeVondele [Sat, 14 Mar 2020 16:04:50 +0000]
Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2567

No functional change.

5 years agoRequest sit when winning in bughouse
Fabian Fichter [Sat, 14 Mar 2020 16:00:22 +0000]
Request sit when winning in bughouse

5 years agoSimplify futility pruning parent node
pb00067 [Fri, 13 Mar 2020 18:29:36 +0000]
Simplify futility pruning parent node

only continuation histories seem needed for this purpose.

STC:
http://tests.stockfishchess.org/tests/view/5e6b88dfe42a5c3b3ca2e4ab
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 113356 W: 21725 L: 21696 D: 69935
Ptnml(0-2): 1999, 13255, 26163, 13240, 2021

LTC:
http://tests.stockfishchess.org/tests/view/5e6babbfe42a5c3b3ca2e4c2
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 22164 W: 2917 L: 2821 D: 16426
Ptnml(0-2): 173, 2040, 6548, 2160, 161

closes https://github.com/official-stockfish/Stockfish/pull/2583

bench: 4839496

5 years agosimplify castling part of generate_all.
protonspring [Wed, 11 Mar 2020 22:27:51 +0000]
simplify castling part of generate_all.

somewhat more compact, generates same code.

close https://github.com/official-stockfish/Stockfish/pull/2580

No functional change.

5 years agoGeneral fast play in bughouse (#64)
Fabian Fichter [Fri, 13 Mar 2020 16:26:29 +0000]
General fast play in bughouse (#64)

Mainly affects play at longer time controls.

5 years agoEvaluate virtual piece drop checks in bughouse
Fabian Fichter [Fri, 13 Mar 2020 15:14:34 +0000]
Evaluate virtual piece drop checks in bughouse

bughouse
Total: 1000 W: 531 L: 459 D: 10

5 years agoEvaluate king proximity for bughouse
Fabian Fichter [Fri, 13 Mar 2020 14:06:15 +0000]
Evaluate king proximity for bughouse

bughouse
Total: 500 W: 280 L: 216 D: 4

5 years agoTweak piece values for nCheck
Fabian Fichter [Thu, 12 Mar 2020 20:09:51 +0000]
Tweak piece values for nCheck

3check STC
LLR: -2.97 (-2.94,2.94) [0.00,10.00]
Total: 11258 W: 5234 L: 5169 D: 855
http://www.variantfishtest.org:6543/tests/view/5e625bda6e23db46beba4f52

3check LTC
LLR: -2.96 (-2.94,2.94) [0.00,10.00]
Total: 18691 W: 8667 L: 8495 D: 1529
http://www.variantfishtest.org:6543/tests/view/5e6286876e23db46beba4f57

5check STC
LLR: -2.97 (-2.94,2.94) [0.00,10.00]
Total: 11102 W: 4635 L: 4568 D: 1899
http://www.variantfishtest.org:6543/tests/view/5e65f5776e23db46beba4f6d

5check LTC
LLR: -2.95 (-2.94,2.94) [0.00,10.00]
Total: 12616 W: 5145 L: 5056 D: 2415
http://www.variantfishtest.org:6543/tests/view/5e6539966e23db46beba4f6b

5 years agoCommunicate clock times in bughouse
Fabian Fichter [Wed, 11 Mar 2020 22:44:50 +0000]
Communicate clock times in bughouse

Consider clock times of partner board in time management (#64).

5 years agoRemove set statScore to zero
silversolver1 [Sun, 8 Mar 2020 19:52:05 +0000]
Remove set statScore to zero

Simplification. Removes setting statScore to zero if negative.

STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 84820 W: 16100 L: 16033 D: 52687
Ptnml(0-2): 1442, 9865, 19723, 9944, 1436
https://tests.stockfishchess.org/tests/view/5e654fdae42a5c3b3ca2e2f8

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57658 W: 7435 L: 7391 D: 42832
Ptnml(0-2): 441, 5397, 17104, 5451, 436
https://tests.stockfishchess.org/tests/view/5e657ce9e42a5c3b3ca2e307

closes https://github.com/official-stockfish/Stockfish/pull/2578

Bench: 5168890

5 years agoEquations for edges and corners.
protonspring [Mon, 9 Mar 2020 21:11:08 +0000]
Equations for edges and corners.

This is a functional simplification that removes the large arrays in endgames.cpp.
It also fixes a recently introduced bug (960d59d54143d84aab26deae65279a611fc989f4) in KNBvK,
now using flip_file() instead of ~.

One fen added to bench to increase endgame coverage.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 174724 W: 33325 L: 33404 D: 107995
Ptnml(0-2): 2503, 19607, 43181, 19608, 2463
http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 35640 W: 4679 L: 4621 D: 26340
Ptnml(0-2): 189, 2991, 11424, 3005, 211
http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8

closes https://github.com/official-stockfish/Stockfish/pull/2577

Bench: 5527957

5 years agoPlay fast when partner is dead in bughouse
Fabian Fichter [Sun, 8 Mar 2020 20:28:38 +0000]
Play fast when partner is dead in bughouse

bughouse
Total: 500 W: 263 L: 233 D: 4

5 years agoFix time unit of CECP st command
Fabian Fichter [Sat, 7 Mar 2020 12:09:24 +0000]
Fix time unit of CECP st command

Set `st` in seconds instead of milliseconds.

Closes #85.

5 years agoTweak shelter bonus for nCheck
Fabian Fichter [Sat, 7 Mar 2020 10:35:54 +0000]
Tweak shelter bonus for nCheck

3check STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 1845 W: 924 L: 801 D: 120
http://www.variantfishtest.org:6543/tests/view/5e6258ac6e23db46beba4f4c

3check LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 2573 W: 1251 L: 1119 D: 203
http://www.variantfishtest.org:6543/tests/view/5e6281ff6e23db46beba4f55

5 years agoFix ambiguity between clamp implementations
Gary Heckman [Thu, 5 Mar 2020 17:37:08 +0000]
Fix ambiguity between clamp implementations

There is an ambiguity between global and std clamp implementations when compiling in c++17,
and on certain toolchains that are not strictly conforming to c++11.
This is solved by putting our clamp implementation in a namespace.

closes https://github.com/official-stockfish/Stockfish/pull/2572

No functional change.

5 years agoRemove KRPPKRPScaleFactors array
protonspring [Wed, 4 Mar 2020 18:32:17 +0000]
Remove KRPPKRPScaleFactors array

Fucntional simplification that removes the KRPPKRPScaleFactors array.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 47374 W: 9159 L: 9049 D: 29166
Ptnml(0-2): 707, 5325, 11560, 5341, 754
http://tests.stockfishchess.org/tests/view/5e5ff464e42a5c3b3ca2e156

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 31268 W: 4064 L: 3995 D: 23209
Ptnml(0-2): 173, 2734, 9764, 2777, 186
http://tests.stockfishchess.org/tests/view/5e61be6ce42a5c3b3ca2e1c1

closes https://github.com/official-stockfish/Stockfish/pull/2575

Bench 5123316

5 years agoCleanup KBPsK endgame
protonspring [Thu, 5 Mar 2020 19:07:48 +0000]
Cleanup KBPsK endgame

* Clarify distinction between strong side pawns and all pawns.
* Simplify and speed-up determination of pawns on the same file.
* Clarify comments.
* more_than_one() is probably faster than pos.count.

Passed STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 40696 W: 7856 L: 7740 D: 25100
Ptnml(0-2): 584, 4519, 10054, 4579, 612
http://tests.stockfishchess.org/tests/view/5e6153b1e42a5c3b3ca2e1a9

closes https://github.com/official-stockfish/Stockfish/pull/2574

No functional change.

5 years agoSmall speed-up in BetweenBB
protonspring [Tue, 3 Mar 2020 23:35:45 +0000]
Small speed-up in BetweenBB

A speed-up removing some comparisons.

closes https://github.com/official-stockfish/Stockfish/pull/2571

No functional change.

5 years agoEvaluate virtual pawn drop checks for bughouse
Fabian Fichter [Fri, 6 Mar 2020 14:38:02 +0000]
Evaluate virtual pawn drop checks for bughouse

bughouse
Total: 500 W: 265 L: 232 D: 3

5 years agoConsider endgame king danger for bughouse
Fabian Fichter [Fri, 6 Mar 2020 14:10:02 +0000]
Consider endgame king danger for bughouse

bughouse
Total: 500 W: 270 L: 225 D: 5

5 years agoTweak piece values for bughouse
Fabian Fichter [Fri, 6 Mar 2020 10:51:04 +0000]
Tweak piece values for bughouse

bughouse
Total: 200 W: 124 L: 75 D: 1

5 years agoUse equations for PushAway and PushClose
protonspring [Tue, 3 Mar 2020 00:32:02 +0000]
Use equations for PushAway and PushClose

A functional simplification replacing the corresponding arrays. Tested in two variants,
also the simpler one performs well, even though differences to master should be minimal.

STC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 57864 W: 11092 L: 11001 D: 35771
Ptnml(0-2): 826, 6458, 14320, 6455, 873
http://tests.stockfishchess.org/tests/view/5e5da5b6e42a5c3b3ca2e05c

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 7198 W: 982 L: 883 D: 5333
Ptnml(0-2): 33, 575, 2296, 650, 45
http://tests.stockfishchess.org/tests/view/5e5df13ae42a5c3b3ca2e077

LTC (This exact version. . . more simplified)
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 5392 W: 729 L: 631 D: 4032
Ptnml(0-2): 23, 405, 1751, 485, 32
http://tests.stockfishchess.org/tests/view/5e5ead99e42a5c3b3ca2e0e4

closes https://github.com/official-stockfish/Stockfish/pull/2570

Bench 5123316

5 years agoConsolidate Square Flipping
protonspring [Sun, 1 Mar 2020 09:03:36 +0000]
Consolidate Square Flipping

Add a flip_rank() and flip_file() so that all of the square flipping can be consolidated.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57234 W: 11064 L: 10969 D: 35201
Ptnml(0-2): 822, 6562, 13801, 6563, 869
http://tests.stockfishchess.org/tests/view/5e5d2f2aafe6254521f2ffaa

closes https://github.com/official-stockfish/Stockfish/pull/2568

No functional change.

5 years agoImprove evaluation of checks by piece drops
Fabian Fichter [Sun, 1 Mar 2020 19:08:43 +0000]
Improve evaluation of checks by piece drops

shogun
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 426 W: 243 L: 143 D: 40

pocketknight STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 2526 W: 748 L: 648 D: 1130
http://www.variantfishtest.org:6543/tests/view/5e5b92a66e23db46beba4f20

pocketknight LTC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 1691 W: 505 L: 415 D: 771
http://www.variantfishtest.org:6543/tests/view/5e5bb85d6e23db46beba4f2a

5 years agoConsider board size in shogi king danger
Fabian Fichter [Sun, 1 Mar 2020 19:06:37 +0000]
Consider board size in shogi king danger

shogi
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 2688 W: 1391 L: 1251 D: 46

minishogi
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 2208 W: 1169 L: 1035 D: 4

5 years agoSmall cleanups
Joost VandeVondele [Sun, 1 Mar 2020 08:31:17 +0000]
Small cleanups

closes https://github.com/official-stockfish/Stockfish/pull/2546

No functional change.

5 years agoSimplify lowply-history logic
Guenther Demetz [Thu, 27 Feb 2020 14:58:22 +0000]
Simplify lowply-history logic

Don't restrict usage to ttPv nodes exclusively

STC:
http://tests.stockfishchess.org/tests/view/5e5634f284a82b4acd41499a
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 152796 W: 29146 L: 29178 D: 94472
Ptnml(0-2): 2590, 17792, 35628, 17836, 2552

LTC:
http://tests.stockfishchess.org/tests/view/5e575d4984a82b4acd4149e8
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 20078 W: 2688 L: 2587 D: 14803
Ptnml(0-2): 139, 1914, 5853, 1973, 160

closes https://github.com/official-stockfish/Stockfish/pull/2565

bench: 4923286

5 years agoFix race condition in holding command
Fabian Fichter [Sat, 29 Feb 2020 22:46:01 +0000]
Fix race condition in holding command

Prevent race conditions in bughouse by updating the holdings
with the captured piece instead of completely overriding them,
given that the GUI provides this optional information.

Closes #73.

5 years agoScale check danger with check count
Fabian Fichter [Sat, 29 Feb 2020 22:38:54 +0000]
Scale check danger with check count

3check STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 4529 W: 2174 L: 2014 D: 341
http://www.variantfishtest.org:6543/tests/view/5e5992676e23db46beba4f14

3check LTC
LLR: -2.95 (-2.94,2.94) [0.00,10.00]
Total: 6565 W: 3017 L: 3018 D: 530
http://www.variantfishtest.org:6543/tests/view/5e5999ca6e23db46beba4f17

5check STC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 1635 W: 735 L: 624 D: 276
http://www.variantfishtest.org:6543/tests/view/5e5999da6e23db46beba4f19

5check LTC
LLR: 2.94 (-2.94,2.94) [0.00,10.00]
Total: 1199 W: 533 L: 431 D: 235
http://www.variantfishtest.org:6543/tests/view/5e5a32106e23db46beba4f1b

5 years agoScale endgame danger with checks
Fabian Fichter [Fri, 28 Feb 2020 17:52:28 +0000]
Scale endgame danger with checks

3check STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 9256 W: 4385 L: 4157 D: 714
http://www.variantfishtest.org:6543/tests/view/5e564bfc6e23db46beba4ede

3check LTC
LLR: -2.97 (-2.94,2.94) [0.00,10.00]
Total: 11218 W: 5188 L: 5123 D: 907
http://www.variantfishtest.org:6543/tests/view/5e5685976e23db46beba4f00

5check STC
LLR: 2.95 (-2.94,2.94) [-10.00,5.00]
Total: 393 W: 189 L: 134 D: 70
http://www.variantfishtest.org:6543/tests/view/5e564c1d6e23db46beba4ee1

5 years agoFix queen check danger
Fabian Fichter [Fri, 28 Feb 2020 17:46:42 +0000]
Fix queen check danger

5 years agoFix definition of camp in king safety
Fabian Fichter [Fri, 28 Feb 2020 17:39:35 +0000]
Fix definition of camp in king safety

5 years agoIncrease check danger for nCheck variants
Fabian Fichter [Thu, 27 Feb 2020 22:48:01 +0000]
Increase check danger for nCheck variants

3check STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 3733 W: 1808 L: 1659 D: 266
http://www.variantfishtest.org:6543/tests/view/5e5649d26e23db46beba4ed3

3check LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 5655 W: 2672 L: 2497 D: 486
http://www.variantfishtest.org:6543/tests/view/5e576a846e23db46beba4f04

5 years agoTweak piece values for variants without checks
Fabian Fichter [Thu, 27 Feb 2020 18:56:20 +0000]
Tweak piece values for variants without checks

racingkings STC
LLR: 2.98 (-2.94,2.94) [0.00,10.00]
Total: 2872 W: 1009 L: 895 D: 968
http://www.variantfishtest.org:6543/tests/view/5e5662136e23db46beba4ef0

racingkings LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 2799 W: 907 L: 799 D: 1093
http://www.variantfishtest.org:6543/tests/view/5e566cf16e23db46beba4ef3

5 years agoWeak queen protection
Moez Jellouli [Sat, 22 Feb 2020 13:57:01 +0000]
Weak queen protection

Extra penalty if weak piece is only protected by a queen.

STC:
http://tests.stockfishchess.org/tests/view/5e53c6ab84a82b4acd4148fa
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 44630 W: 8615 L: 8359 D: 27656
Ptnml(0-2): 746, 5156, 10323, 5276, 814

LTC:
http://tests.stockfishchess.org/tests/view/5e54e05d84a82b4acd414947
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 175480 W: 23085 L: 22409 D: 129986
Ptnml(0-2): 1264, 16494, 51678, 16910, 1394

closes https://github.com/official-stockfish/Stockfish/pull/2564

Bench: 4923286

5 years agoFix compiler warnings
Fabian Fichter [Wed, 26 Feb 2020 15:20:37 +0000]
Fix compiler warnings

5 years agoFix TT write in MultiPV case.
AndyGrant [Mon, 24 Feb 2020 22:32:17 +0000]
Fix TT write in MultiPV case.

fixes an error reported earlier as https://github.com/official-stockfish/Stockfish/issues/2404 by @AndyGrant.

MultiPV at root shouldn't write to the TT for later lines, as that is neither the eval nor the bestmove for that position.
Fixing this error doesn't matter for playing games (http://tests.stockfishchess.org/tests/view/5dcdbd810ebc590256324a11).

However, it can lead to wrong mate announcements as reported by @uriblass. In particular the following testcase gives
wrong results for the second search, prior to this patch:

```
setoption name MultiPV value 2
position fen 5R2/2kB2p1/p2bR3/8/3p1B2/8/PPP5/2K5 b - - 0 49
go depth 40
position fen 2B2R2/3r2p1/p1kbR3/8/3p1B2/8/PPP5/2K5 b - - 8 48
go depth 40
```

fixes https://github.com/official-stockfish/Stockfish/issues/2561
closes https://github.com/official-stockfish/Stockfish/pull/2562

Only affects MultiPV search.

Bench: 4697493

5 years agoUse single param for Outpost and ReachableOutpost.
31m059 [Sun, 23 Feb 2020 02:27:32 +0000]
Use single param for Outpost and ReachableOutpost.

In November 2019, as a result of the simplification of rank-based outposts by 37698b0,
separate bonuses were introduced for outposts that are currently occupied and outposts
that are reachable on the next move. However, the values of these two bonuses are
quite similar, and they have remained that way for three months of development.

It appears that we can safely retire the separate ReachableOutpost parameter and
use the same Outpost bonus in both cases, restoring the basic principles of Stockfish
outpost evaluation to their pre-November state, while also reducing
the size of the parameter space.

STC:
LLR: 2.96 (-2.94,2.94) {-1.50,0.50}
Total: 47680 W: 9213 L: 9092 D: 29375
Ptnml(0-2): 776, 5573, 11071, 5594, 826
https://tests.stockfishchess.org/tests/view/5e51e33190a0a02810d09802

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 14690 W: 1960 L: 1854 D: 10876
Ptnml(0-2): 93, 1381, 4317, 1435, 119
https://tests.stockfishchess.org/tests/view/5e52197990a0a02810d0980f

closes https://github.com/official-stockfish/Stockfish/pull/2559

Bench: 4697493

5 years agoImprove move order near the root
Günther Demetz [Fri, 21 Feb 2020 13:01:59 +0000]
Improve move order near the root

Current move histories are known to work well near the leaves, whilst at
higher depths they aren't very helpful. To address this problem this
patch introduces a table dedicated for what's happening at plies 0-3.
It's structured like mainHistory with ply index instead of color.
It get cleared with each new search and is filled during iterative
deepening at higher depths when recording successful quiet moves near
the root or traversing nodes which were in the principal variation
(ttPv).

Medium TC (20+0.2):
https://tests.stockfishchess.org/tests/view/5e4d358790a0a02810d096dc
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 100910 W: 16682 L: 16376 D: 67852
Ptnml(0-2): 1177, 10983, 25883, 11181, 1231

LTC:
https://tests.stockfishchess.org/tests/view/5e4e2cb790a0a02810d09714
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 80444 W: 10495 L: 10095 D: 59854
Ptnml(0-2): 551, 7479, 23803, 7797, 592

closes https://github.com/official-stockfish/Stockfish/pull/2557

Bench: 4705960

5 years agoUpdate readme
Fabian Fichter [Thu, 20 Feb 2020 22:29:30 +0000]
Update readme

5 years agoSupport Three Kings Chess
Fabian Fichter [Thu, 20 Feb 2020 22:11:06 +0000]
Support Three Kings Chess

Closes #79.

5 years agoSupport Koedem
Fabian Fichter [Thu, 20 Feb 2020 20:56:43 +0000]
Support Koedem

http://schachclub-oetigheim.de/wp-content/uploads/2016/04/Koedem-rules.pdf

Closes #78.

5 years agoUpdated KNNKP endgame.
protonspring [Tue, 18 Feb 2020 16:10:58 +0000]
Updated KNNKP endgame.

This is a patch that significantly improves playing KNNKP endgames:

```
Score of 2553 vs master: 132 - 38 - 830 [0.547] 1000
Elo difference: 32.8 +/- 8.7, LOS: 100.0 %, DrawRatio: 83.0 %
```

At the same time it reduces the evaluation of this mostly draw engame
from ~7.5 to ~1.5

This patch does not regress against master in normal games:

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 96616 W: 18459 L: 18424 D: 59733
Ptnml(0-2): 1409, 10812, 23802, 10905, 1380
http://tests.stockfishchess.org/tests/view/5e49dfe6f8d1d52b40cd31bc

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 49726 W: 6340 L: 6304 D: 37082
Ptnml(0-2): 239, 4227, 15906, 4241, 250
http://tests.stockfishchess.org/tests/view/5e4ab9ee16fb3df8c4cc01d0

Theory: KNNK is a dead draw, however the presence of the additional weakSide pawn opens up some mate opportunities. The idea is to block the pawn (preferably behind the Troitsky line) with one of the knights and press the weakSide king into a corner. If we can stalemate the king, we release the pawn with the knight (to avoid actual stalemate), and use the knight to complete the mate before the pawn promotes. This is also why there is an additional penalty for advancement of the pawn.

closes https://github.com/official-stockfish/Stockfish/pull/2553

Bench: 4981770

5 years agoDouble material bonus for losing chess
Fabian Fichter [Wed, 19 Feb 2020 19:20:22 +0000]
Double material bonus for losing chess

giveaway STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 1273 W: 553 L: 451 D: 269
http://www.variantfishtest.org:6543/tests/view/5e4c63ff6e23db46beba4e50

giveaway LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 1470 W: 615 L: 512 D: 343
http://www.variantfishtest.org:6543/tests/view/5e4ce01e6e23db46beba4e64

losers LTC
LLR: 2.96 (-2.94,2.94) [-10.00,5.00]
Total: 624 W: 317 L: 258 D: 49
http://www.variantfishtest.org:6543/tests/view/5e4d6d576e23db46beba4e66

5 years agoTweak piece values for losing chess variants
Fabian Fichter [Wed, 19 Feb 2020 19:07:41 +0000]
Tweak piece values for losing chess variants

giveaway STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 968 W: 416 L: 320 D: 232
http://www.variantfishtest.org:6543/tests/view/5e4c62af6e23db46beba4e49

giveaway STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 808 W: 338 L: 247 D: 223
http://www.variantfishtest.org:6543/tests/view/5e4cdfff6e23db46beba4e60

losers STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 1862 W: 903 L: 783 D: 176
http://www.variantfishtest.org:6543/tests/view/5e4c62c36e23db46beba4e4c

losers LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 3538 W: 1617 L: 1476 D: 445
http://www.variantfishtest.org:6543/tests/view/5e4ce00a6e23db46beba4e62

5 years agoClear hash on new game in CECP
Fabian Fichter [Wed, 19 Feb 2020 18:58:37 +0000]
Clear hash on new game in CECP

Ensures reproducible results on repeated searches, e.g.:
```
xboard
new
go
new
go
```

Closes #80.

5 years agoSimplify Futility Move Count
protonspring [Mon, 10 Feb 2020 22:18:16 +0000]
Simplify Futility Move Count

remove two constants

STC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 62050 W: 11903 L: 11802 D: 38345
Ptnml(0-2): 1002, 7346, 14283, 7320, 1065
http://tests.stockfishchess.org/tests/view/5e41d73be70d848499f63c6d

LTC
LLR: 2.93 (-2.94,2.94) {-1.50,0.50}
Total: 12850 W: 1679 L: 1572 D: 9599
Ptnml(0-2): 82, 1171, 3818, 1249, 96
http://tests.stockfishchess.org/tests/view/5e42bf07e70d848499f63cc0

Bench: 4762351

5 years agoFix for incorrect VALUE_MATE_IN_MAX_PLY usage.
Joost VandeVondele [Tue, 11 Feb 2020 19:42:32 +0000]
Fix for incorrect VALUE_MATE_IN_MAX_PLY usage.

Fixes #2533, fixes #2543, fixes #2423.

the code that prevents false mate announcements depending on the TT
state (GHI), incorrectly used VALUE_MATE_IN_MAX_PLY. The latter
constant, however, also includes, counterintuitively, the TB win range.

This patch fixes that, by restoring the behavior for TB win scores,
while retaining the false mate correctness, and improving the mate
finding ability. In particular

no alse mates are announced with the poisened hash testcase
```
position fen 8/8/8/3k4/8/8/6K1/7R w - - 0 1
go depth 40
position fen 8/8/8/3k4/8/8/6K1/7R w - - 76 1
go depth 20
ucinewgame
```

mates are found with the testcases reported in #2543
```
position fen 4k3/3pp3/8/8/8/8/2PPP3/4K3 w - - 0 1
setoption name Hash value 1024
go depth 55
ucinewgame
```
and
```
position fen 4k3/4p3/8/8/8/8/3PP3/4K3 w - - 0 1
setoption name Hash value 1024
go depth 45
ucinewgame
```

furthermore, on the mate finding benchmark (ChestUCI_23102018.epd),
performance improves over master, roughly reaching performance with the
false mate protection reverted
```
Analyzing 6566 mate positions for best and found mates:

                 ----------------best ---------------found
           nodes master revert  fixed master revert  fixed
        16000000   4233   4236   4235   5200   5201   5199
        32000000   4583   4585   4585   5417   5424   5418
        64000000   4852   4853   4855   5575   5584   5579
       128000000   5071   5068   5066   5710   5720   5716
       256000000   5280   5282   5279   5819   5827   5826
       512000000   5471   5468   5468   5919   5935   5932
```

On a testcase with TB enabled, progress is made consistently, contrary
to master
```
setoption name SyzygyPath value ../../../syzygy/3-4-5/
setoption name Hash value 2048
position fen 1R6/3k4/8/K2p4/4n3/2P5/8/8 w - - 0 1
go depth 58
ucinewgame
```

The PR (prior to a rewrite for clarity)

passed STC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 65405 W: 12454 L: 12384 D: 40567
Ptnml(0-2): 920, 7256, 16285, 7286, 944
http://tests.stockfishchess.org/tests/view/5e441a3be70d848499f63d15

passed LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 27096 W: 3477 L: 3413 D: 20206
Ptnml(0-2): 128, 2215, 8776, 2292, 122
http://tests.stockfishchess.org/tests/view/5e44e277e70d848499f63d63

The incorrectly named VALUE_MATE_IN_MAX_PLY and VALUE_MATED_IN_MAX_PLY
were renamed into VALUE_TB_WIN_IN_MAX_PLY and VALUE_TB_LOSS_IN_MAX_PLY,
and correclty defined VALUE_MATE_IN_MAX_PLY and VALUE_MATED_IN_MAX_PLY
were introduced.

One further (corner case) mistake using these constants was fixed (go
mate X), which could lead to a premature return if X > MAX_PLY / 2,
but TB were present.

Thanks to @svivanov72 for one of the reports and help fixing the issue.

closes https://github.com/official-stockfish/Stockfish/pull/2552

Bench: 4932981

5 years agoFix notation for pieces in hand in SFEN
Fabian Fichter [Wed, 12 Feb 2020 21:26:26 +0000]
Fix notation for pieces in hand in SFEN

Prefix the piece letter by the piece count instead of repeating the letter.
Support old notation in parsing for backwards compatibility.

Closes #77.

6 years agoSpeed up move generation
Fabian Fichter [Wed, 12 Feb 2020 17:47:38 +0000]
Speed up move generation

chess STC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 4792 W: 1081 L: 969 D: 2742
http://www.variantfishtest.org:6543/tests/view/5e4317286e23db46beba4e0e

No functional change.

6 years agoDisable makruk counting for positions with pawns
Fabian Fichter [Wed, 12 Feb 2020 17:46:06 +0000]
Disable makruk counting for positions with pawns

makruk STC
LLR: 2.96 (-2.94,2.94) [-10.00,5.00]
Total: 2064 W: 169 L: 136 D: 1759
http://www.variantfishtest.org:6543/tests/view/5e4308466e23db46beba4e06

makruk LTC
LLR: 3.01 (-2.94,2.94) [-10.00,5.00]
Total: 2530 W: 163 L: 130 D: 2237
http://www.variantfishtest.org:6543/tests/view/5e430b2d6e23db46beba4e09

Closes #75.

6 years agoSimplify FEN parsing for large boards
Fabian Fichter [Mon, 10 Feb 2020 22:01:59 +0000]
Simplify FEN parsing for large boards

No functional change.

6 years agoModify singular beta for ttPv positions.
Vizvezdenec [Fri, 7 Feb 2020 17:04:43 +0000]
Modify singular beta for ttPv positions.

This patch lowers singular beta for positions that have been in pv and are not pv nodes.
The idea of using ttpv && !PvNode improved scaling with TC and could be
useful for other search heuristics.

passed STC
http://tests.stockfishchess.org/tests/view/5e3f6d7ce70d848499f63bbc
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 154953 W: 29688 L: 29272 D: 95993
Ptnml(0-2): 2616, 17912, 36037, 18210, 2673

passed LTC
http://tests.stockfishchess.org/tests/view/5e405561e70d848499f63bfa
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 70974 W: 9305 L: 8932 D: 52737
Ptnml(0-2): 466, 6658, 20920, 6826, 569

closes https://github.com/official-stockfish/Stockfish/pull/2550

Bench: 4932981

6 years agoFix wrong assert.
Joost VandeVondele [Fri, 7 Feb 2020 09:42:10 +0000]
Fix wrong assert.

can trigger an abort when compiling with debug=yes, and using 7men TB.
The assert should check that less than 8 pieces are in the key for each
side, matching the assumption that underlies the FEN string construction.
Also take explicitly care of a 'v' character in material strings.

Fixes an issue reported in the forum:
https://groups.google.com/d/msg/fishcooking/yoVC7etIpz0/7mS7ntZMBAAJ

closes https://github.com/official-stockfish/Stockfish/pull/2547

No functional change.

6 years agoSupport Makpong (Defensive Chess)
Fabian Fichter [Thu, 6 Feb 2020 20:45:34 +0000]
Support Makpong (Defensive Chess)

https://www.mayhematics.com/v/vol8/vc64b.pdf
https://books.google.de/books?id=0O02DwAAQBAJ&pg=PA81&lpg=PA81&dq=makpong

Closes #72.

No functional change for other variants.

6 years agoSimplify do_move and undo_move
Fabian Fichter [Fri, 7 Feb 2020 12:19:19 +0000]
Simplify do_move and undo_move

No functional change.

6 years agoSupport generation of FENs showing promoted pawns
Fabian Fichter [Thu, 6 Feb 2020 19:15:18 +0000]
Support generation of FENs showing promoted pawns

Required for gbtami/pychess-variants#87.

No functional change.

6 years agoMinor readme updates
Fabian Fichter [Thu, 6 Feb 2020 10:59:16 +0000]
Minor readme updates

6 years agoImplement variant configuration checker
Fabian Fichter [Wed, 5 Feb 2020 21:11:44 +0000]
Implement variant configuration checker

Usage: `./stockfish check variants.ini`

Closes #62.

6 years agoSmall cleanups.
Joost VandeVondele [Wed, 5 Feb 2020 14:18:24 +0000]
Small cleanups.

closes https://github.com/official-stockfish/Stockfish/pull/2532

Bench: 4869669

6 years agoReintroduce king infiltration
Vizvezdenec [Tue, 4 Feb 2020 17:41:58 +0000]
Reintroduce king infiltration

This patch reintroduces the recently simplified king infiltration bonus
in initiative calculation, doubling its effect, and compensating more.

passed STC
http://tests.stockfishchess.org/tests/view/5e3476f630ae32da08941d5c
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 75323 W: 14434 L: 14140 D: 46749
Ptnml(0-2): 1231, 8729, 17528, 8826, 1331

passed LTC
http://tests.stockfishchess.org/tests/view/5e377353e70d848499f638c1
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 171466 W: 22223 L: 21561 D: 127682
Ptnml(0-2): 1204, 15951, 50831, 16397, 1312

closes https://github.com/official-stockfish/Stockfish/pull/2545

Brench: 4869669

6 years agoExtend range of skill levels to negative values
Fabian Fichter [Tue, 4 Feb 2020 21:15:10 +0000]
Extend range of skill levels to negative values

6 years agoUpdate pychess-variants link in readme
Fabian Fichter [Tue, 4 Feb 2020 20:03:06 +0000]
Update pychess-variants link in readme

6 years agoSimplify away king infiltration.
xoto10 [Fri, 31 Jan 2020 15:55:29 +0000]
Simplify away king infiltration.

STC :
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 91438 W: 17496 L: 17438 D: 56504
Ptnml(0-2): 1573, 10711, 21067, 10790, 1563
https://tests.stockfishchess.org/tests/view/5e34812630ae32da08941d65

LTC :
LLR: 2.96 (-2.94,2.94) {-1.50,0.50}
Total: 40485 W: 5246 L: 5177 D: 30062
Ptnml(0-2): 289, 3818, 11976, 3812, 327
https://tests.stockfishchess.org/tests/view/5e354daee70d848499f6380c

closes https://github.com/official-stockfish/Stockfish/pull/2542

Bench: 5047825

6 years agoSimplify Tweak late move reductions at root.
xoto10 [Thu, 30 Jan 2020 20:42:58 +0000]
Simplify Tweak late move reductions at root.

Revert change from Jan 15.

STC 10+0.1 :
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 65135 W: 12543 L: 12436 D: 40156
Ptnml(0-2): 1090, 7618, 14947, 7623, 1136
https://tests.stockfishchess.org/tests/view/5e334016708b13464ceea32e

LTC 60+0.6 :
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 17768 W: 2286 L: 2191 D: 13291
Ptnml(0-2): 128, 1602, 5273, 1679, 140
https://tests.stockfishchess.org/tests/view/5e34011e57e1ecae66ec2aab

closes https://github.com/official-stockfish/Stockfish/pull/2537

Bench: 4914050

6 years agoRestore development version
Fabian Fichter [Sat, 1 Feb 2020 00:10:03 +0000]
Restore development version

6 years agoRevert 5 recent patches
Joost VandeVondele [Thu, 30 Jan 2020 20:44:04 +0000]
Revert 5 recent patches

Revert 5 patches which were merged, but lead to a regression test that showed negative Elo gain:

http://tests.stockfishchess.org/tests/view/5e307251ab2d69d58394fdb9

This was discussed in depth in:

https://github.com/official-stockfish/Stockfish/issues/2531

Each patch was removed and tested as a simplification, full list below, and the whole combo as well.

After the revert the regression test showed a neutral result:

http://tests.stockfishchess.org/tests/view/5e334851708b13464ceea33c

As a result of this experience, the SPRT testing bounds will be made more strict.

Reverted patches:

1 Dynamic Complexity 6d0eabd5fe2961551477820ab7619e2c31e01ffd :

STC 10+0.1 https://tests.stockfishchess.org/tests/view/5e31fcacec661e2e6a340d08 :
LLR: 2.97 (-2.94,2.94) {-1.50,0.50}
Total: 38130 W: 7326 L: 7189 D: 23615
Ptnml(0-2): 677, 4346, 8843, 4545, 646

LTC 60+0.6 https://tests.stockfishchess.org/tests/view/5e32c18fec661e2e6a340d73 :
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 38675 W: 4941 L: 4866 D: 28868
Ptnml(0-2): 270, 3556, 11429, 3584, 291

3 More bonus for bestMoves on past PV nodes 71e0b5385e2717679a57c6b77d8c7ac5fff3b89f :

STC 10+0.1 https://tests.stockfishchess.org/tests/view/5e31fe93ec661e2e6a340d10 :
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 46100 W: 8853 L: 8727 D: 28520
Ptnml(0-2): 796, 5297, 10749, 5387, 813

LTC 60+0.6 https://tests.stockfishchess.org/tests/view/5e32c187ec661e2e6a340d71 :
LLR: 2.96 (-2.94,2.94) {-1.50,0.50}
Total: 16920 W: 2161 L: 2055 D: 12704
Ptnml(0-2): 115, 1498, 5006, 1569, 130

4 Tweak Restricted Piece Bonus 0ae00454ba6928d181b46103e5c83e6d58fcebe5 :

STC 10+0.1 https://tests.stockfishchess.org/tests/view/5e31fefaec661e2e6a340d15 :
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 88328 W: 17060 L: 16997 D: 54271
Ptnml(0-2): 1536, 10446, 20169, 10422, 1581

LTC 60+0.6 https://tests.stockfishchess.org/tests/view/5e32c17aec661e2e6a340d6f :
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 34784 W: 4551 L: 4466 D: 25767
Ptnml(0-2): 255, 3279, 10061, 3345, 262

5 History update for pruned captures 01b6088af39902001d2d6844561b6a2faa549282 :

STC 10+0.1 https://tests.stockfishchess.org/tests/view/5e31ff5eec661e2e6a340d1a :
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 29541 W: 5735 L: 5588 D: 18218
Ptnml(0-2): 483, 3445, 6820, 3469, 545

LTC 60+0.6 https://tests.stockfishchess.org/tests/view/5e32c196ec661e2e6a340d75 :
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 22177 W: 2854 L: 2757 D: 16566
Ptnml(0-2): 143, 2005, 6555, 2055, 164

6 Tweak trapped rook penalty 18fc21eba0368fd5e3c4c4b8ee1000c9ac445425 :

STC 10+0.1 https://tests.stockfishchess.org/tests/view/5e31ffb1ec661e2e6a340d1c :
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 24476 W: 4727 L: 4569 D: 15180
Ptnml(0-2): 390, 2834, 5659, 2933, 417

LTC 60+0.6 https://tests.stockfishchess.org/tests/view/5e32c19eec661e2e6a340d77 :
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 97332 W: 12492 L: 12466 D: 72374
Ptnml(0-2): 690, 9107, 28738, 9034, 720

All 5 as one simplification :
LTC 60+0.6 https://tests.stockfishchess.org/tests/view/5e334098708b13464ceea330 :
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 7829 W: 1079 L: 964 D: 5786
Ptnml(0-2): 52, 690, 2281, 781, 65

Bench: 5153165

6 years agoFairy-Stockfish 11
Fabian Fichter [Fri, 31 Jan 2020 13:56:26 +0000]
Fairy-Stockfish 11

bench: 4794966

6 years agoUpdate Shogun chess in variants.ini
Fabian Fichter [Fri, 31 Jan 2020 10:25:30 +0000]
Update Shogun chess in variants.ini

Rename Ferz for compatibility with pychess-variants.

6 years agoSupport USI extensions
Fabian Fichter [Thu, 30 Jan 2020 20:44:43 +0000]
Support USI extensions

Improve Shogi GUI compatibility by supporting:
- bestmove resign
- go byoyomi

Closes #71.

6 years agoFix compilation on android
Joost VandeVondele [Tue, 28 Jan 2020 15:17:52 +0000]
Fix compilation on android

Fall back to the default implementation of aligned_ttmem_alloc, which
was introduced as part of 39437f4e55aaa26ef9f0d5a1c762e560e9ffde32

Fixes  #2524

No functional change.

6 years agoSimplify hashfull calculation.
joergoster [Mon, 27 Jan 2020 17:53:25 +0000]
Simplify hashfull calculation.

We can simplify the calculation of the hashfull info by looping over exact 1,000 entries,
and then divide the result by ClusterSize. Somewhat memory accesses, somewhat more accurate.

Passed non-regression LTC
https://tests.stockfishchess.org/tests/view/5e30079dab2d69d58394fd5d
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 30125 W: 3987 L: 3926 D: 22212
Ptnml(0-2): 177, 2504, 9558, 2642, 141

closes https://github.com/official-stockfish/Stockfish/pull/2523

No functional change.

6 years agoMore bonus for bestMoves on past PV nodes
Guenther Demetz [Tue, 28 Jan 2020 12:38:03 +0000]
More bonus for bestMoves on past PV nodes

It looks like it is important to keep past PV (ttPv) nodes as close as possible to current PV nodes.
Credits to Mark Tenzer (31m059) & Stefan Geschwentner who first tried ideas on ttPv nodes.

STC:
https://tests.stockfishchess.org/tests/view/5e2ff5efab2d69d58394fd52
LLR: 2.95 (-2.94,2.94) {-1.00,3.00}
Total: 13302 W: 2647 L: 2507 D: 8148
Ptnml(0-2): 237, 1540, 2956, 1632, 260

LTC:
https://tests.stockfishchess.org/tests/view/5e2fff38ab2d69d58394fd55
LLR: 2.95 (-2.94,2.94) {0.00,2.00}
Total: 15797 W: 2137 L: 1960 D: 11700
Ptnml(0-2): 96, 1443, 4628, 1547, 130

closes https://github.com/official-stockfish/Stockfish/pull/2529

bench: 5545845

6 years agoLess NMP if the position was previously in PV.
31m059 [Tue, 28 Jan 2020 01:48:01 +0000]
Less NMP if the position was previously in PV.

The intention of the patch is to avoid aggressive null move pruning (NMP)
in positions that have previously been found to be important (PV nodes).
If we already do not apply NMP for current PV nodes, it makes sense to apply
it less often for positions that have previously been PV nodes too.

STC:
LLR: 2.96 (-2.94,2.94) {-1.00,3.00}
Total: 14959 W: 2921 L: 2782 D: 9256
Ptnml(0-2): 254, 1679, 3493, 1762, 282
http://tests.stockfishchess.org/tests/view/5e2f6637ab2d69d58394fcfd

LTC:
LLR: 2.95 (-2.94,2.94) {0.00,2.00}
Total: 6442 W: 899 L: 753 D: 4790
Ptnml(0-2): 42, 549, 1885, 659, 61
http://tests.stockfishchess.org/tests/view/5e2f767bab2d69d58394fd04

closes https://github.com/official-stockfish/Stockfish/pull/2525

Bench: 4725546

6 years agoDynamic Complexity based on psqt
Alain SAVARD [Mon, 27 Jan 2020 14:25:41 +0000]
Dynamic Complexity based on psqt

Adjust initiative score by psqt/2 instead of materialScore/2 which simplifies #2516

Passed STC
http://tests.stockfishchess.org/tests/view/5e2e667dab2d69d58394fc73
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 23198 W: 4506 L: 4353 D: 14339
Ptnml(0-2): 396, 2615, 5380, 2728, 418

Passed LTC
http://tests.stockfishchess.org/tests/view/5e2ed75cab2d69d58394fcbf
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 8519 W: 1179 L: 1062 D: 6278
Ptnml(0-2): 50, 775, 2472, 843, 74

closes https://github.com/official-stockfish/Stockfish/pull/2522

Bench:  4684459

6 years agoAdvise the kernel to use huge pages (Linux)
Sami Kiminki [Sat, 21 Dec 2019 19:41:42 +0000]
Advise the kernel to use huge pages (Linux)

Align the TT allocation by 2M to make it huge page friendly and advise the
kernel to use huge pages.

Benchmarks on my i7-8700K (6C/12T) box: (3 runs per bench per config)

                    vanilla (nps)               hugepages (nps)              avg
==================================================================================
bench             | 3012490  3024364  3036331   3071052  3067544  3071052    +1.5%
bench 16 12 20    | 19237932 19050166 19085315  19266346 19207025 19548758   +1.1%
bench 16384 12 20 | 18182313 18371581 18336838  19381275 19738012 19620225   +7.0%

On my box, huge pages have a significant perf impact when using a big
hash size. They also speed up TT initialization big time:

                                  vanilla (s)  huge pages (s)  speed-up
=======================================================================
time stockfish bench 16384 1 1  | 5.37         1.48            3.6x

In practice, huge pages with auto-defrag may always be enabled in the
system, in which case this patch has no effect. This
depends on the values in /sys/kernel/mm/transparent_hugepage/enabled
and /sys/kernel/mm/transparent_hugepage/defrag.

closes https://github.com/official-stockfish/Stockfish/pull/2463

No functional change

6 years agoDynamic complexity
Alain SAVARD [Sat, 25 Jan 2020 12:59:42 +0000]
Dynamic complexity

Instead of computing the initiative bonus on the material score + dynamic score
compute it on (material score/2) + dynamic score,

Passed STC
http://tests.stockfishchess.org/tests/view/5e2c4945ab2d69d58394fa8f
LLR: 2.94 (-2.94,2.94) {-1.00,3.00}
Total: 39387 W: 7594 L: 7386 D: 24407
Ptnml(0-2): 658, 4519, 9165, 4649, 697

Passed LTC
http://tests.stockfishchess.org/tests/view/5e2c85ccab2d69d58394faa7
LLR: 2.95 (-2.94,2.94) {0.00,2.00}
Total: 32588 W: 4206 L: 3986 D: 24396
Ptnml(0-2): 244, 2909, 9738, 3111, 253

closes https://github.com/official-stockfish/Stockfish/pull/2516

Bench: 4765486

6 years agoMerge official-stockfish/master
Fabian Fichter [Sun, 26 Jan 2020 18:39:38 +0000]
Merge official-stockfish/master

bench: 4794966

6 years agoMerge official-stockfish/master
Fabian Fichter [Sun, 26 Jan 2020 16:12:57 +0000]
Merge official-stockfish/master

6 years agoFix slider blockers for banner
Fabian Fichter [Sun, 26 Jan 2020 12:07:16 +0000]
Fix slider blockers for banner

No functional change for all variants except manchu.

6 years agoFix Betza notation for royal fairy pieces
Fabian Fichter [Sat, 25 Jan 2020 22:49:56 +0000]
Fix Betza notation for royal fairy pieces

6 years agoMerge official-stockfish/master
Fabian Fichter [Sat, 25 Jan 2020 21:37:28 +0000]
Merge official-stockfish/master

bench: 5115004

6 years agoGeneralize check for fairy riders
Fabian Fichter [Sat, 25 Jan 2020 11:05:49 +0000]
Generalize check for fairy riders

No functional change.

6 years agoTweak RestrictedPiece bonus
Lolligerhans [Fri, 24 Jan 2020 22:04:35 +0000]
Tweak RestrictedPiece bonus

Double the "RestrictedPiece" bonus for restricted moves targeting
occupied squares.

STC LLR: 3.58 (-2.94,2.94) {-1.00,3.00}
    Total: 25504 W: 4887 L: 4697 D: 15920
    Ptnml(0-2): 387, 2935, 5947, 3051, 422
    https://tests.stockfishchess.org/tests/view/5e2aa15dab2d69d58394f94d

LTC LLR: 2.94 (-2.94,2.94) {0.00,2.00}
    Total: 28572 W: 3826 L: 3621 D: 21125
    Ptnml(0-2): 224, 2609, 8403, 2791, 239
    https://tests.stockfishchess.org/tests/view/5e2ae7f4ab2d69d58394f9a6

Bench: 4719086

6 years agoConsider attacks to CTF square in Jeson Mor
Fabian Fichter [Fri, 24 Jan 2020 15:16:51 +0000]
Consider attacks to CTF square in Jeson Mor

jesonmor STC
LLR: 4.87 (-2.94,2.94) [0.00,10.00]
Total: 765 W: 472 L: 292 D: 1
http://www.variantfishtest.org:6543/tests/view/5e29ec386e23db46beba4cd4

jesonmor LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 3514 W: 1832 L: 1679 D: 3
http://www.variantfishtest.org:6543/tests/view/5e29eebb6e23db46beba4cd7

6 years agoSpeed-up for CTF variants
Fabian Fichter [Thu, 23 Jan 2020 18:25:59 +0000]
Speed-up for CTF variants

racingkings STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 576 W: 235 L: 151 D: 190
http://www.variantfishtest.org:6543/tests/view/5e28c2806e23db46beba4cc8

kingofthehill STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 842 W: 410 L: 309 D: 123
http://www.variantfishtest.org:6543/tests/view/5e28c2726e23db46beba4cc5

6 years agoHistory update for pruned captures
Stefan Geschwentner [Thu, 23 Jan 2020 14:41:03 +0000]
History update for pruned captures

Use a SEE pruned capture move for history updates: this patch collects
pruned capture moves also in the failed captures list, so that they get
an update in capture history.

STC:
LLR: 2.95 (-2.94,2.94) {-1.00,3.00}
Total: 11124 W: 2222 L: 2089 D: 6813
Ptnml(0-2): 186, 1280, 2506, 1381, 200
http://tests.stockfishchess.org/tests/view/5e28995fc3b97aa0d75bc294

LTC:
LLR: 2.94 (-2.94,2.94) {0.00,2.00}
Total: 25552 W: 3418 L: 3211 D: 18923
Ptnml(0-2): 168, 2354, 7538, 2490, 200
http://tests.stockfishchess.org/tests/view/5e2943734744cfa4d6af415b

Closes https://github.com/official-stockfish/Stockfish/pull/2511

Bench: 4810202

6 years agoTweak trapped rook penalty
Vizvezdenec [Wed, 22 Jan 2020 00:54:44 +0000]
Tweak trapped rook penalty

This patch greatly increases the endgame penalty for having a trapped rook.
Idea was a result of witnessing Stockfish losing some games at CCCC exchanging
pieces in the position with a trapped rook which directly lead to a lost endgame.
This patch should partially fix such behavior making this penalty high even in
deep endgames.

Passed STC
http://tests.stockfishchess.org/tests/view/5e279d7cc3b97aa0d75bc1c4
LLR: 2.94 (-2.94,2.94) {-1.00,3.00}
Total: 8528 W: 1706 L: 1588 D: 5234
Ptnml(0-2): 133, 957, 1985, 1024, 159

Passed LTC
http://tests.stockfishchess.org/tests/view/5e27aee4c3b97aa0d75bc1e1
LLR: 2.95 (-2.94,2.94) {0.00,2.00}
Total: 88713 W: 11520 L: 11130 D: 66063
Ptnml(0-2): 646, 8170, 26342, 8492, 676

Closes https://github.com/official-stockfish/Stockfish/pull/2510

Bench: 4964462

----------------------

Comment by Malcolm Campbell:

Congrats! I think this might be a common pattern - scores that seem to mainly apply
to the midgame are often better with a similar (or at least fairly big) endgame value
as well. Maybe there are others eval parameters we can tweak like this...

6 years agoLess reduction for escape moves at ttPv nodes
Stefan Geschwentner [Tue, 21 Jan 2020 08:28:58 +0000]
Less reduction for escape moves at ttPv nodes

At expected PV nodes or nodes which marked as PV node in the hash table,
reduce escape moves even one ply less.

STC:
LLR: 2.94 (-2.94,2.94) {-1.00,3.00}
Total: 31795 W: 6140 L: 5953 D: 19702
Ptnml(0-2): 525, 3625, 7455, 3695, 583
http://tests.stockfishchess.org/tests/view/5e25d77fc3b97aa0d75bc013

LTC:
LLR: 2.94 (-2.94,2.94) {0.00,2.00}
Total: 43975 W: 5708 L: 5454 D: 32813
Ptnml(0-2): 314, 4012, 13070, 4242, 325
http://tests.stockfishchess.org/tests/view/5e2618c1c3b97aa0d75bc03c

Closes https://github.com/official-stockfish/Stockfish/pull/2505

Bench: 4475583

6 years agoUse (strict) greater-than-operator for 'improving'
Guenther Demetz [Thu, 16 Jan 2020 07:39:20 +0000]
Use (strict) greater-than-operator for 'improving'

Currently on a normal bench run in ~0,7% of cases 'improving' is set to
true although the static eval isn't improving at all, just keeping
equal. It looks like the strict gt-operator is more appropriate here,
since it returns to 'improving' its literal meaning without sideffects.

STC {-1.00,3.00} failed yellow:
https://tests.stockfishchess.org/tests/view/5e1ec38c8fd5f550e4ae1c28
LLR: -2.93 (-2.94,2.94) {-1.00,3.00}
Total: 53155 W: 10170 L: 10109 D: 32876
Ptnml(0-2): 863, 6282, 12251, 6283, 892

non-regression LTC passed:
https://tests.stockfishchess.org/tests/view/5e1f1c0d8fd5f550e4ae1c41
LLR: 2.98 (-2.94,2.94) {-1.50,0.50}
Total: 23961 W: 3114 L: 3018 D: 17829
Ptnml(0-2): 163, 2220, 7114, 2298, 170

CLoses https://github.com/official-stockfish/Stockfish/pull/2496

bench: 4561386

6 years agoMinor fixes for misc.cpp
Chess13234 [Tue, 21 Jan 2020 16:20:00 +0000]
Minor fixes for misc.cpp

Fixes conflict with tune.h STRINGIFY macro.

No functional change

6 years agoUse a std::bitset for KPKBitbase
protonspring [Thu, 23 Jan 2020 17:18:58 +0000]
Use a std::bitset for KPKBitbase

This is a non-functional simplification. Looks like std::bitset works good
for the KPKBitbase. Thanks for Jorg Oster for helping get the speed up
(the [] accessor is faster than test()).

Speed testing: 10k calls to probe:
  master 9.8 sec
  patch 9.8 sec.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 100154 W: 19025 L: 18992 D: 62137
Ptnml(0-2): 1397, 11376, 24572, 11254, 1473
http://tests.stockfishchess.org/tests/view/5e21e601346e35ac603b7d2b

Closes https://github.com/official-stockfish/Stockfish/pull/2502

No functional change

6 years agoDetermine opposite colors mathematically
protonspring [Mon, 23 Dec 2019 17:58:30 +0000]
Determine opposite colors mathematically

This is a non-functional speed-up: master has to access SquareBB twice while this patch
determines opposite_colors just using the values of the squares. It doesn't seem to change
the overall speed of bench, but calling opposite_colors(...) 10 Million times:

master: 39.4 seconds
patch: 11.4 seconds.

The only data point I have (other than my own tests), is a quite old failed STC test:
LLR: -2.93 (-2.94,2.94) [-1.50,4.50]
Total: 24308 W: 5331 L: 5330 D: 13647
Ptnml(0-2): 315, 2577, 6326, 2623, 289
http://tests.stockfishchess.org/tests/view/5e010256c13ac2425c4a9a67

Closes https://github.com/official-stockfish/Stockfish/pull/2498

No functional change

6 years agoSimplify KPK classify
protonspring [Fri, 10 Jan 2020 22:08:47 +0000]
Simplify KPK classify

This is a non-functional simplification. If we use the "side to move" of the entry
instead of the template, one of the classify methods goes away. Furthermore, I've
resolved  the colors in some of the statements (we're already assuming direction
using NORTH), and used stm (side to move) instead of "us," since this is much clearer
to me.

This is not tested because it is non-functional, only applies building the bitbase
and there are no changes to the binary (on my machine).

Closes https://github.com/official-stockfish/Stockfish/pull/2485

No functional change

6 years agoSimplify signature of remove_piece()
protonspring [Sat, 21 Dec 2019 22:36:29 +0000]
Simplify signature of remove_piece()

This is a non-functional simplification. Instead of passing the piece type
for remove_piece, we can rely on the board. The only exception is en-passant
which must be explicitly set because the destination square for the capture
is not the same as the piece to remove.

Verified also in the Chess960 castling case by running a couple of perft, see
the pull request discussion: https://github.com/official-stockfish/Stockfish/pull/2460

STC
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 18624 W: 4147 L: 4070 D: 10407
Ptnml(0-2): 223, 1933, 4945, 1938, 260
http://tests.stockfishchess.org/tests/view/5dfeaa93e70446e17e451163

No functional change

6 years agoRestore development version
Stéphane Nicolet [Thu, 23 Jan 2020 16:17:26 +0000]
Restore development version

No functional change

6 years agoSupport resetting of piece types in configuration
Fabian Fichter [Sat, 18 Jan 2020 12:30:07 +0000]
Support resetting of piece types in configuration

6 years agoStockfish 11
Stéphane Nicolet [Wed, 15 Jan 2020 21:39:27 +0000]
Stockfish 11

Official release version of Stockfish 11.

Bench: 5156767

-----------------------

It is our pleasure to release Stockfish 11 to our fans and supporters.

Downloads are freely available at http://stockfishchess.org/download/

This version 11 of Stockfish is 50 Elo stronger than the last version, and
150 Elo stronger than the version which famously lost a match to AlphaZero
two years ago. This makes Stockfish the strongest chess engine running on
your smartphone or normal desktop PC, and we estimate that on a modern four
cores CPU, Stockfish 11 could give 1:1000 time odds to the human chess champion
having classical time control, and be on par with him. More specific data,
including nice cumulative curves for the progression of Stockfish strength
over the last seven years, can be found on [our progression page][1], at
[Stefan Pohl site][2] or at [NextChessMove][3].

In October 2019 Stockfish has regained its crown in the TCEC competition,
beating in the superfinal of season 16 an evolution of the neural-network
engine Leela that had won the previous season. This clash of style between an
alpha-beta and an neural-network engine produced spectacular chess as always,
with Stockfish [emerging victorious this time][0].

Compared to Stockfish 10, we have made hundreds of improvements to the
[codebase][4], from the evaluation function (improvements in king attacks,
middlegame/endgame transitions, and many more) to the search algorithm (some
innovative coordination methods for the searching threads, better pruning of
unsound tactical lines, etc), and fixed a couple of bugs en passant.

Our testing framework [Fishtest][5] has also seen its share of improvements
to continue propelling Stockfish forward. Along with a lot of small enhancements,
Fishtest has switched to new SPRT bounds to increase the chance of catching Elo
gainers, along with a new testing book and the use of pentanomial statistics to
be more resource-efficient.

Overall the Stockfish project is an example of open-source at its best, as
its buzzing community of programmers sharing ideas and daily reviewing their
colleagues' patches proves to be an ideal form to develop innovative ideas for
chess programming, while the mathematical accuracy of the testing framework
allows us an unparalleled level of quality control for each patch we put in
the engine. If you wish, you too can help our ongoing efforts to keep improving
it, just [get involved][6] :-)

Stockfish is also special in that every chess fan, even if not a programmer,
[can easily help][7] the team to improve the engine by connecting their PC to
Fishtest and let it play some games in the background to test new patches.
Individual contributions vary from 1 to 32 cores, but this year Bojun Guo
made it a little bit special by plugging a whole data center during the whole
year: it was a vertiginous experience to see Fishtest spikes with 17466 cores
connected playing [25600 games/minute][8]. Thanks Guo!

The Stockfish team

[0]: <http://mytcecexperience.blogspot.com/2019/10/season-16-superfinal-games-91-100.html>
[1]: <https://github.com/glinscott/fishtest/wiki/Regression-Tests>
[2]: <https://www.sp-cc.de/index.htm>
[3]: <https://nextchessmove.com/dev-builds>
[4]: <https://github.com/official-stockfish/Stockfish>
[5]: <https://tests.stockfishchess.org/tests>
[6]: <https://stockfishchess.org/get-involved/>
[7]: <https://github.com/glinscott/fishtest/wiki>
[8]: <https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/lebEmG5vgng%5B1-25%5D>

6 years agoReadjust piece values for New Zealand chess
Fabian Fichter [Fri, 17 Jan 2020 15:47:22 +0000]
Readjust piece values for New Zealand chess

newzealand STC
LLR: 2.98 (-2.94,2.94) [0.00,10.00]
Total: 1748 W: 472 L: 385 D: 891
http://www.variantfishtest.org:6543/tests/view/5e2187a86e23db46beba4c74

newzealand LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 1443 W: 371 L: 290 D: 782
http://www.variantfishtest.org:6543/tests/view/5e218c0b6e23db46beba4c77