stockfish
3 years agoMerge branch 'master' of /srv/git.sesse.net/www/stockfish
Steinar H. Gunderson [Fri, 12 Apr 2019 20:33:19 +0000 (22:33 +0200)]
Merge branch 'master' of /srv/git.sesse.net/www/stockfish

3 years agoAdjust paths for buster.
Steinar H. Gunderson [Thu, 20 Dec 2018 22:32:47 +0000 (23:32 +0100)]
Adjust paths for buster.

3 years agoMark that we are using a patched version.
Steinar H. Gunderson [Sun, 6 May 2018 10:39:04 +0000 (12:39 +0200)]
Mark that we are using a patched version.

3 years agoAdd support for 7-man Syzygy tablebases.
Steinar H. Gunderson [Tue, 1 May 2018 11:44:33 +0000 (13:44 +0200)]
Add support for 7-man Syzygy tablebases.

3 years agoUpdates for newer protobuf and Stockfish.
Steinar H. Gunderson [Tue, 27 Jun 2017 21:26:08 +0000 (23:26 +0200)]
Updates for newer protobuf and Stockfish.

3 years agoRemove the non-pretty moves from the protobuf, as it takes up a little CPU time for...
Steinar H. Gunderson [Sun, 20 Nov 2016 22:07:51 +0000 (23:07 +0100)]
Remove the non-pretty moves from the protobuf, as it takes up a little CPU time for the JavaScript to decode.

3 years agoSimplify a bit.
Steinar H. Gunderson [Sat, 19 Nov 2016 13:44:50 +0000 (14:44 +0100)]
Simplify a bit.

3 years agoMore build tweaks.
Steinar H. Gunderson [Sat, 19 Nov 2016 13:42:02 +0000 (14:42 +0100)]
More build tweaks.

3 years agoSend back a prettyprinted version of the move on hash probe.
Steinar H. Gunderson [Sat, 19 Nov 2016 11:04:21 +0000 (12:04 +0100)]
Send back a prettyprinted version of the move on hash probe.

3 years agoFix a crash issue when traversing PVs.
Steinar H. Gunderson [Tue, 15 Nov 2016 21:03:15 +0000 (22:03 +0100)]
Fix a crash issue when traversing PVs.

3 years agoLink the protobuf stuff statically.
Steinar H. Gunderson [Mon, 29 Aug 2016 22:08:50 +0000 (00:08 +0200)]
Link the protobuf stuff statically.

3 years agoDeal with Stockfish internal API changes.
Steinar H. Gunderson [Mon, 29 Aug 2016 21:57:02 +0000 (23:57 +0200)]
Deal with Stockfish internal API changes.

3 years agoMake server address into an UCI option.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:48:48 +0000 (00:48 +0100)]
Make server address into an UCI option.

3 years agoMove the hash probe class definition into a header file.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:41:52 +0000 (00:41 +0100)]
Move the hash probe class definition into a header file.

3 years agoDo not fill value if we have no search info.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:23:44 +0000 (00:23 +0100)]
Do not fill value if we have no search info.

3 years agoRefactor the RPC thread into a shutdown-able class.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:21:45 +0000 (00:21 +0100)]
Refactor the RPC thread into a shutdown-able class.

3 years agoAdd a SCORE_NONE.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:13:09 +0000 (00:13 +0100)]
Add a SCORE_NONE.

3 years agoDecode the score into the protobuf.
Steinar H. Gunderson [Sat, 19 Mar 2016 21:36:16 +0000 (22:36 +0100)]
Decode the score into the protobuf.

3 years agoPut the root into a separate place.
Steinar H. Gunderson [Sat, 19 Mar 2016 21:22:57 +0000 (22:22 +0100)]
Put the root into a separate place.

3 years agoPrevent infinite loops on repetitions.
Steinar H. Gunderson [Sat, 19 Mar 2016 21:22:40 +0000 (22:22 +0100)]
Prevent infinite loops on repetitions.

3 years agoReturn the entire PV, and in slightly more parseable form.
Steinar H. Gunderson [Sat, 19 Mar 2016 19:08:53 +0000 (20:08 +0100)]
Return the entire PV, and in slightly more parseable form.

3 years agoGive the proto a package name.
Steinar H. Gunderson [Sat, 19 Mar 2016 15:50:10 +0000 (16:50 +0100)]
Give the proto a package name.

3 years agoReturn all candidate moves from the probe.
Steinar H. Gunderson [Fri, 18 Mar 2016 00:51:35 +0000 (01:51 +0100)]
Return all candidate moves from the probe.

3 years agoDo not use -Wshadow; it is incredibly noisy for protobuf code.
Steinar H. Gunderson [Fri, 18 Mar 2016 00:51:19 +0000 (01:51 +0100)]
Do not use -Wshadow; it is incredibly noisy for protobuf code.

3 years agoWhen returning gRPC probes, report scores from white's perspective.
Steinar H. Gunderson [Thu, 17 Mar 2016 09:45:38 +0000 (10:45 +0100)]
When returning gRPC probes, report scores from white's perspective.

3 years agoWrite out null-move and no move.
Steinar H. Gunderson [Thu, 17 Mar 2016 09:39:14 +0000 (10:39 +0100)]
Write out null-move and no move.

3 years agoMake the bound slightly easier to parse again.
Steinar H. Gunderson [Thu, 17 Mar 2016 01:25:35 +0000 (02:25 +0100)]
Make the bound slightly easier to parse again.

3 years agoMake the client prober output something a bit more easily parseable, and run in a...
Steinar H. Gunderson [Thu, 17 Mar 2016 01:12:13 +0000 (02:12 +0100)]
Make the client prober output something a bit more easily parseable, and run in a loop.

3 years agoRename client.cc to the right extension.
Steinar H. Gunderson [Thu, 17 Mar 2016 01:07:14 +0000 (02:07 +0100)]
Rename client.cc to the right extension.

3 years agoBetter comments and enums in the proto file.
Steinar H. Gunderson [Thu, 17 Mar 2016 01:05:59 +0000 (02:05 +0100)]
Better comments and enums in the proto file.

3 years agoFix a .depend dependency error.
Steinar H. Gunderson [Thu, 17 Mar 2016 00:56:41 +0000 (01:56 +0100)]
Fix a .depend dependency error.

3 years agoRemove some debugging.
Steinar H. Gunderson [Thu, 17 Mar 2016 00:56:14 +0000 (01:56 +0100)]
Remove some debugging.

3 years agoInitial commit for gRPC code.
Steinar H. Gunderson [Wed, 16 Mar 2016 23:18:37 +0000 (00:18 +0100)]
Initial commit for gRPC code.

3 years agoSimplify SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX loop (#1892)
noobpwnftw [Mon, 24 Dec 2018 10:24:29 +0000 (18:24 +0800)]
Simplify SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX loop (#1892)

When iterating through 'SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX' structure, do not use structure member beyond known size.

API is guaranteed to provide us at lease one element upon successful, and no element in the structure can have a zero size.

No functional change.

3 years agoFix crash in best_group() (#1891)
noobpwnftw [Sat, 22 Dec 2018 17:05:13 +0000 (01:05 +0800)]
Fix crash in best_group() (#1891)

This pull request fixes a rare crashing bug on Windows inside our NUMA code, first
reported by Dann Corbit in the following forum thread (thanks!):
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/gA6aoMEuOwg

The fix is to not use structure member beyond known size when iterating through
'SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX' structure. We note that the Microsoft
API is guaranteed to provide us at least one element upon successful, and no
element in the structure can have a zero size.

No functional change.

3 years agoExtend stack to ss-5, and remove conditions
Joost VandeVondele [Wed, 19 Dec 2018 20:04:36 +0000 (21:04 +0100)]
Extend stack to ss-5, and remove conditions

The `&& (ss-1)->killers[0] ` conditions are there seemingly to protect
accessing ss-5.

This is unneeded and not so intuitive (as the killer is checked for equality
with currentMove, and that one is non-zero once we're high enough in the stack,
this protects access to ss-5). We can just extend the stack from ss-4 to ss-5,
so we can call update_continuation_histories(ss-1, ..) always in search.

This goes a bit further than #1881 and addresses a comment in #1878.

passed STC:
http://tests.stockfishchess.org/tests/view/5c1aa8d50ebc5902ba127ad0
LLR: 3.12 (-2.94,2.94) [-3.00,1.00]
Total: 53515 W: 11734 L: 11666 D: 30115

passed LTC:
http://tests.stockfishchess.org/tests/view/5c1b272c0ebc5902ba12858d
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 140176 W: 23123 L: 23192 D: 93861

Bench: 3451321

3 years agoImprove endgame KBN vs K (#1877)
protonspring [Mon, 17 Dec 2018 17:25:25 +0000 (10:25 -0700)]
Improve endgame KBN vs K (#1877)

Even when playing without endgame table bases, this particular endgame should
be a win 100% of the time when Stockfish is given a KRBK position, assuming
there are enough moves remaining in the FEN to finish the game without hitting
the 50 move rule.

PROBLEM: The issue with master here is that the PushClose difference per square
is 20, however, the difference in squares for the PushToCorners array is usually
less. Thus, the engine prefers to move the kings closer together rather than pushing
the weak king to the correct corner.

What happens is if the weak king is in a safe corner, SF still prefers pushing the
kings together. Occasionally, the strong king traps the weak king in the safe corner.
It takes a while for SF to figure it out, but often draws the game by the 50 move rule
(on shorter time controls).

This patch increases the PushToCorners values to correct this problem. We also added
an assert to catch any overflow problem if anybody would want to increase the array
values again in the future.

It was tested in a couple of matches starting with random KRBK positions and showed
increased winning rates, see https://github.com/official-stockfish/Stockfish/pull/1877

No functional change

3 years agoUpdate our continuous integration machinery (#1889)
erbsenzaehler [Sun, 23 Dec 2018 17:17:44 +0000 (18:17 +0100)]
Update our continuous integration machinery (#1889)

* Update our continuous integration machinery

Ubuntu 16.04 can now be used with travis. Updating all the other stuff
when there.
Invoking the lld linker seems to save 5 minutes with clang on linux.

No functional change.

* fix

3 years agoUse a bit less code to calculate hashfull() (#1830)
mstembera [Sun, 23 Dec 2018 15:10:07 +0000 (07:10 -0800)]
Use a bit less code to calculate hashfull() (#1830)

* Use a bit less code to calculate hashfull(). Change post increment to preincrement as is more standard
in the rest of stockfish.  Scale result so we report 100% instead of 99.9% when completely full.

No functional change.

3 years agoTurn on random access for Syzygy files in Windows (#1840)
mstembera [Sun, 23 Dec 2018 15:09:03 +0000 (07:09 -0800)]
Turn on random access for Syzygy files in Windows (#1840)

* This is the Windows version of
https://github.com/official-stockfish/Stockfish/pull/1829

No functional change.

3 years agoSimplify generate_castling (#1885)
protonspring [Sun, 23 Dec 2018 15:05:24 +0000 (08:05 -0700)]
Simplify generate_castling (#1885)

Although this is a compile-time constant, we stick the castlingSide into a CastlingRight, then pull it out again. This seems unecessarily complex.

No functional change.

3 years agoSimplify KBNK endgame implementation
protonspring [Sat, 8 Dec 2018 17:08:59 +0000 (10:08 -0700)]
Simplify KBNK endgame implementation

We do not need to change the winnerKSq variable, so we can simplify
a little bit the logic of the code by changing only the loserKSq
variable when it is necessary. Also consolidate and clarify comments.

See the pull request thread for a proof that the code is correct:
https://github.com/official-stockfish/Stockfish/pull/1854

No functional change

3 years agoTweak main killer penalty
Guenther Demetz [Tue, 18 Dec 2018 07:05:09 +0000 (08:05 +0100)]
Tweak main killer penalty

Apply refuted main killer penalty also on early TT cut-offs. This
makes penalty logic more consistent with the logic at normal search.

Failed STC:
http://tests.stockfishchess.org/tests/view/5c121e730ebc5902ba11aad8
LLR: -2.95 (-2.94,2.94) [0.00,5.00]
Total: 72193 W: 15848 L: 15625 D: 40720 Elo +1.07

Passed LTC:
http://tests.stockfishchess.org/tests/view/5c17b1b10ebc5902ba123c24
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 35073 W: 5886 L: 5625 D: 23562 Elo +2.59

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

bench: 3393939

3 years agoNew voting formula for threads
mstembera [Tue, 18 Dec 2018 07:50:57 +0000 (08:50 +0100)]
New voting formula for threads

We now use a quadratic formula during the vote for threads
when deciding on which thread to pick a move from.

time control 5+0.05, with 8 threads:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 20202 W: 4031 L: 3813 D: 12358
http://tests.stockfishchess.org/tests/view/5c16c8e60ebc5902ba1223e2

time control 20+0.2, with 8 threads:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 14330 W: 2290 L: 2115 D: 9925
http://tests.stockfishchess.org/tests/view/5c16efca0ebc5902ba122993

20000 games match at time control 5+0.05, with 31 threads:
ELO: 5.63 +-2.8 (95%) LOS: 100.0%
Total: 20000 W: 3539 L: 3215 D: 13246
http://tests.stockfishchess.org/tests/view/5c16f07a0ebc5902ba122a20

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

No functional change (in simple thread mode)

3 years agoUse stronglyProtected
31m059 [Sat, 15 Dec 2018 06:55:25 +0000 (01:55 -0500)]
Use stronglyProtected

~stronglyProtected is quite similar to ~attackedBy[Them][PAWN] & ~attackedBy2[Them],
the only difference appears to be that the former includes squares attacked twice
by both sides. The resulting logic is simpler, and the change appears to be at least
Elo-neutral at both STC and LTC.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 35924 W: 7978 L: 7885 D: 20061
http://tests.stockfishchess.org/tests/view/5c14a5c00ebc5902ba11ed72

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 37078 W: 6125 L: 6030 D: 24923
http://tests.stockfishchess.org/tests/view/5c14ae880ebc5902ba11eed8

Bench: 3646542

3 years agoRefactor king ring calculation
Alain SAVARD [Sat, 15 Dec 2018 17:09:35 +0000 (12:09 -0500)]
Refactor king ring calculation

Compute the "double protection by pawns" expression only once
in initialize(), instead of once for each piece in the piece loop.

Passed STC
http://tests.stockfishchess.org/tests/view/5c1506380ebc5902ba11f3b4
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 9494 W: 2191 L: 2045 D: 5258

Inspired by Nick Pelling's test
   http://tests.stockfishchess.org/tests/view/5c144d110ebc5902ba11e4af
and an older test of mine
   http://tests.stockfishchess.org/tests/view/5c0402810ebc5902bcee1fc8

Non functional change.

3 years agoFix a segfault.
Joost VandeVondele [Sun, 16 Dec 2018 08:51:29 +0000 (09:51 +0100)]
Fix a segfault.

this patch fixes a rare but reproducible segfault observed playing a
multi-threaded match, it is discussed somewhat in fishcooking.

From the core file, it could be observed that the issue was in qsearch, namely:

````
   ss->pv[0] = MOVE_NONE;
````

and the backtrace shows the it arrives there via razoring, called from the rootNode:

````
    (gdb) bt
    alpha=-19, beta=682, depth=DEPTH_ZERO) at search.cpp:1247
````

Indeed, ss->pv can indeed by a nullptr at the rootNode. However, why is the
segfault so rare ?

The reason is that the condition that guards razoring:

````
   (depth < 2 * ONE_PLY &&  eval <= alpha - RazorMargin)
````

is almost never true, since at the root alpha for depth < 5 is -VALUE_INFINITE.

Nevertheless with the new failHigh scheme, this is not guaranteed, and rootDepth > 5,
can still result in a depth < 2 search at the rootNode. If now another thread,
via the hash, writes a new low eval to the rootPos qsearch can be entered.
Rare but not unseen... I assume that some of the crashes in fishtest recently
might be due to this.

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

No functional change

3 years agoStart a TT resize only after search finished.
Joost VandeVondele [Sat, 8 Dec 2018 22:03:42 +0000 (23:03 +0100)]
Start a TT resize only after search finished.

As noticed in the forum, a crash in extract_ponder_from_tt could result
if hash size is set before the ponder move is printed. While it is arguably
a GUI issue (but it got me on the cli), it is easy to avoid this issue.

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

No functional change.

3 years agoRemove Null Move Pruning material threshold
31m059 [Thu, 13 Dec 2018 05:35:00 +0000 (00:35 -0500)]
Remove Null Move Pruning material threshold

On November 30th, @xoto10 experimented with removing this threshold,
but the simplification barely failed LTC. I was inspired to try various
[0, 4] tweaks to increase its value, which would narrow the effects of
this threshold without removing it entirely. Various values repeatedly
led to Elo gains at both STC and LTC, most of which were insufficient
to pass.

After a couple of weeks, I tried again to find an Elo-gaining tweak
but noticed that I could raise the threshold higher and higher without
regression. I decided to try removing it entirely--forgetting that
@xoto10 had already attempted this. However, this now performs much
better at both STC and LTC, producing a STC Elo gain and also potentially
a smaller LTC one.

The reason appears to be a recent change in master (e8ffca3) near
this code, which interacts with this patch. This simplification
governs the conditions under which that patch's effects are applied.
Something non-obvious about that change has significantly improved
the performance of this simplification.

I recognize and thank @xoto10, who originally had this idea. Since
I ran several LTCs recently (to determine whether to open this PR,
or one for a related [0, 4]), I would also like to acknowledge the
other developers and CPU donors for their patience. Thank you all!

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 13445 W: 3000 L: 2862 D: 7583
http://tests.stockfishchess.org/tests/view/5c11f01b0ebc5902ba11a6b8

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 33868 W: 5663 L: 5563 D: 22642
http://tests.stockfishchess.org/tests/view/5c11ffe90ebc5902ba11a8a9

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

Bench: 3343286

3 years agoA combo of parameter tweaks
SFisGOD [Wed, 12 Dec 2018 19:34:17 +0000 (03:34 +0800)]
A combo of parameter tweaks

Joint work by SFisGOD, xoroshiro and Chess13234.

This combo consists of the following tweaks:
Assorted bonuses and penalties by SFisGOD
Bishop and Rook PSQT by SFisGOD
Tempo Value by xoroshiro
Futility pruning by Chess13234

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 9005 W: 2082 L: 1882 D: 5041
http://tests.stockfishchess.org/tests/view/5c11628c0ebc5902ba119e90

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 44207 W: 7451 L: 7157 D: 29599
http://tests.stockfishchess.org/tests/view/5c1172a40ebc5902ba119fa3

Bench: 3332460

3 years agoAsymmetrical 8x8 Pawn PSQT
Kurt [Thu, 13 Dec 2018 12:19:55 +0000 (13:19 +0100)]
Asymmetrical 8x8 Pawn PSQT

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 13323 W: 3015 L: 2818 D: 7490
http://tests.stockfishchess.org/tests/view/5c00a2520ebc5902bcedd41b

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 52294 W: 9093 L: 8756 D:34445
http://tests.stockfishchess.org/tests/view/5c00b2c40ebc5902bcedd596

Some obvious followups to this are to further tune this PSQT, or
try 8x8 for other pieces. As of now I don't plan on trying this
for other pieces as I think the majority of the ELO it brings is
for pawns and kings.

Looking at the new values, the differences between kingside and
queenside are quite significant. I am very hopeful that this a
llows SF to understand and plan pawn structures even better than
it already does. Cheers!

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

Bench: 3569243

3 years agoChanges identified in RENAME/REFORMATTING thread (#1861)
protonspring [Tue, 11 Dec 2018 12:47:56 +0000 (05:47 -0700)]
Changes identified in RENAME/REFORMATTING thread (#1861)

I've gone through the RENAME/REFORMATTING thread and changed everything I could find, plus a few more. With this, let's close the previous issue and open another.

No functional change.

3 years agoTweak CMH pruning
VoyagerOne [Thu, 6 Dec 2018 23:14:34 +0000 (18:14 -0500)]
Tweak CMH pruning

STC: (yellow)
LLR: -2.94 (-2.94,2.94) [0.00,5.00]
Total: 48919 W: 10625 L: 10517 D: 27777
http://tests.stockfishchess.org/tests/view/5c07e6a20ebc5902bcee7395

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 50360 W: 8424 L: 8102 D: 33834
http://tests.stockfishchess.org/tests/view/5c0812450ebc5902bcee76f4

Bench: 3775064

3 years agoremove extra line.
protonspring [Sun, 9 Dec 2018 00:21:22 +0000 (17:21 -0700)]
remove extra line.

3 years agoremove parenthesis.
protonspring [Sun, 9 Dec 2018 00:19:06 +0000 (17:19 -0700)]
remove parenthesis.

3 years agoadd paren.
protonspring [Sat, 8 Dec 2018 18:08:21 +0000 (11:08 -0700)]
add paren.

3 years agosimplify opposite_colors
protonspring [Sat, 8 Dec 2018 17:57:25 +0000 (10:57 -0700)]
simplify opposite_colors

3 years agoRevert "pseudo_legal() and MOVE_NONE"
Stéphane Nicolet [Thu, 6 Dec 2018 14:00:38 +0000 (15:00 +0100)]
Revert "pseudo_legal() and MOVE_NONE"

This reverts commit 33d95482182e459eb033de47a31f142880aa9afb ,
which crashed in DEBUG mode because of the following assert in position.h

````
Assertion failed: (is_ok(m)), function capture, file ./position.h, line 369.
````

No functional change

3 years agoSimplify Killer Move Penalty
VoyagerOne [Thu, 6 Dec 2018 13:39:41 +0000 (14:39 +0100)]
Simplify Killer Move Penalty

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20816 W: 4525 L: 4402 D: 11889
http://tests.stockfishchess.org/tests/view/5c017cb90ebc5902bcede5b4

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 39287 W: 6401 L: 6309 D: 26577
http://tests.stockfishchess.org/tests/view/5c01825e0ebc5902bcede686

Bench: 3773021

3 years agoSimplify time manager in search()
xoto10 [Sun, 2 Dec 2018 15:29:31 +0000 (15:29 +0000)]
Simplify time manager in search()

Remove the F[] array which I find unhelpful and rename `improvingFactor` to
`fallingEval` since larger values indicate a falling eval and more time use.

I realise a test was not strictly necessary, but I ran STC [-3,1] just to
check there are no foolish errors before creating the pull request:

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 35804 W: 7753 L: 7659 D: 20392
http://tests.stockfishchess.org/tests/view/5bef3a0c0ebc595e0ae39c19

It was then suggested to clean the constants around `fallingEval`
to make it more clear this is a factor around ~1 that adjusts time
up or downwards depending on some conditions. We then ran a double
test with this simplification suggestion:

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 68435 W: 14936 L: 14906 D: 38593
http://tests.stockfishchess.org/tests/view/5c02c56b0ebc5902bcee0184

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 37258 W: 6324 L: 6230 D: 24704
http://tests.stockfishchess.org/tests/view/5c030a520ebc5902bcee0a32

No functional change

3 years agopseudo_legal() and MOVE_NONE
protonspring [Thu, 6 Dec 2018 13:02:11 +0000 (14:02 +0100)]
pseudo_legal() and MOVE_NONE

MOVE_NONE is represented as SQ_A1 to SQ_A1 which is never pseudo_legal.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 38807 W: 8363 L: 8275 D: 22169
http://tests.stockfishchess.org/tests/view/5c05f11d0ebc5902bcee4c86

No functional change

3 years agoIntroduce concept of double pawn protection.
Vizvezdenec [Sun, 2 Dec 2018 19:18:14 +0000 (20:18 +0100)]
Introduce concept of double pawn protection.

Exclude doubly protected by pawns squares when calculating attackers on
king ring. Idea of this patch is not to count attackers if they attack
only squares that are protected by two pawns.

STC
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 70040 W: 15476 L: 15002 D: 39562
http://tests.stockfishchess.org/tests/view/5c0354860ebc5902bcee1106

LTC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 16530 W: 2795 L: 2607 D: 11128
http://tests.stockfishchess.org/tests/view/5c0385080ebc5902bcee14b5

This is third king safety patch in recent times so we probably need
retuning of king safety parameters.

Bench: 3057978

3 years agoPenalize refuted killers in continuation history
Miguel Lahoz [Fri, 30 Nov 2018 05:35:47 +0000 (13:35 +0800)]
Penalize refuted killers in continuation history

Currently we apply a penalty in continuation history for refuted TT moves.
We can use the same idea to also penalize refuted killer moves in continuation
history.

STC:
http://tests.stockfishchess.org/tests/view/5c00ccbd0ebc5902bcedd768
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 54366 W: 12086 L: 11687 D: 30593

LTC:
http://tests.stockfishchess.org/tests/view/5c0107880ebc5902bceddc9c
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 25457 W: 4302 L: 4078 D: 17077

Bench: 3419069

3 years agoRemove Overload bonus
ElbertoOne [Sat, 1 Dec 2018 09:28:10 +0000 (10:28 +0100)]
Remove Overload bonus

Compensate by giving the Hanging bonus to weak doubly-attacked
non pawn enemies pieces.

STC: http://tests.stockfishchess.org/tests/view/5bfd53c40ebc5902bced9237
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 62107 W: 13664 L: 13622 D: 34821

LTC: http://tests.stockfishchess.org/tests/view/5bfd74700ebc5902bced9618
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 86406 W: 14381 L: 14365 D: 57660

A possible follow up would be to tune the hanging bonus and/or try to
simplify the hanging bonus condition.

Bench: 3810849

3 years agoRestore development version
Stéphane Nicolet [Thu, 29 Nov 2018 15:17:23 +0000 (16:17 +0100)]
Restore development version

No functional change

3 years agoStockfish 10
Stéphane Nicolet [Thu, 29 Nov 2018 14:45:26 +0000 (15:45 +0100)]
Stockfish 10

Official release version of Stockfish 10.

This is also the 10th anniversary version of the Stockfish project, which
started exactly ten years ago! I wish to extend a huge thank you to
all contributors and authors in our amazing community :-)

Bench: 3939338

3 years agoUpdate list of authors
Stéphane Nicolet [Thu, 29 Nov 2018 14:15:43 +0000 (15:15 +0100)]
Update list of authors

No functional change

3 years agoUse emplace_back() in TB code
Sebastian Buchwald [Thu, 22 Nov 2018 22:50:03 +0000 (23:50 +0100)]
Use emplace_back() in TB code

The patch was tested for correctness by running bench with and
without the change against current master, and the tablebase hit
numbers were found to be identical in both cases. See the pull
request comments for details:
https://github.com/official-stockfish/Stockfish/pull/1826

No functional change.

3 years agoSimplify casting extension
31m059 [Sat, 24 Nov 2018 06:55:09 +0000 (01:55 -0500)]
Simplify casting extension

On November 16th, before the removal of the depth condition, I tried
revising castling extensions to only handle castling moves, rather than
moves that change castling rights generally. It appeared to be a slight
Elo gain at STC but insufficient to pass [0, 4] (+0.5 Elo), but what I
overlooked was that it made pos.can_castle(us) irrelevant and should
have been a simplification. Recent discussion with @Chess13234 and
Michael Chaly (@Vizvezdenec) inspired me to take a second look, and
the simplification continues to pass when rebased on the current master.

This replaces two conditions with one, because type_of(move) == CASTLING
implies pos.can_castle(Us), allowing us to remove the latter condition.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 110948 W: 24209 L: 24263 D: 62476
http://tests.stockfishchess.org/tests/view/5bf8f65c0ebc5902bced3a63

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 88283 W: 14681 L: 14668 D: 58934
http://tests.stockfishchess.org/tests/view/5bf994a60ebc5902bced4349

Bench: 3939338

3 years agoTurn on MADV_RANDOM for Syzygy mmaps (on Unix-like builds)
Steinar H. Gunderson [Sat, 24 Nov 2018 10:17:12 +0000 (11:17 +0100)]
Turn on MADV_RANDOM for Syzygy mmaps (on Unix-like builds)

When running on a cloud VM (n1-highcpu-96) with several NVMe SSDs and
some non-SSDs for tablebases, I noticed that the average SSD request size was
more than 256 kB. This doesn't make a lot of sense for Syzygy tablebases,
which have a block size of 32 bytes and very low locality.

Seemingly, the tablebase access patterns during probing make the OS,
at least Linux, think that readahead is advantageous; normally, it
gives up doing readahead if there are too many misses, but it doesn't,
perhaps due to the fairly high overall hit rates. (It seems the kernel cannot
distinguish between reading a block that was paged in because the userspace
wanted it explicitly, and one that was read as part of readahead.)

Setting MADV_RANDOM effectively turns off readahead, which causes
the request size to drop to 4 kB. In the aforemented cloud VM test,
this roughly tripled the amount of I/O requests that were able to go
through, while reducing the total traffic from 2.8 GB/sec to 56 MB/sec
(moving the bottleneck to the non-SSDs; it seems the SSDs could have
sustained many more requests).

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

No functional change.

3 years agoQsearch simplification. (#1828)
Jörg Oster [Sun, 25 Nov 2018 10:27:40 +0000 (11:27 +0100)]
Qsearch simplification. (#1828)

Don't do an extra TT update in case of a fail-high,
but simply break off the moves loop and let the TT update
at the end of qsearch do this job.
Same workflow/logic as in our main search function now.

Tested for no regression to be on the safe side.
STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 30237 W: 6665 L: 6560 D: 17012
http://tests.stockfishchess.org/tests/view/5bf928e80ebc5902bced3f3a

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 51067 W: 8625 L: 8553 D: 33889
http://tests.stockfishchess.org/tests/view/5bf937180ebc5902bced3fdc

No functional change.

3 years agoTurn on MADV_RANDOM for Syzygy mmaps, so that the kernel may know it can reduce the...
Steinar H. Gunderson [Sat, 24 Nov 2018 10:17:12 +0000 (11:17 +0100)]
Turn on MADV_RANDOM for Syzygy mmaps, so that the kernel may know it can reduce the readahead.

3 years agoMark that we are using a patched version.
Steinar H. Gunderson [Sun, 6 May 2018 10:39:04 +0000 (12:39 +0200)]
Mark that we are using a patched version.

3 years agoAdd support for 7-man Syzygy tablebases.
Steinar H. Gunderson [Tue, 1 May 2018 11:44:33 +0000 (13:44 +0200)]
Add support for 7-man Syzygy tablebases.

3 years agoUpdates for newer protobuf and Stockfish.
Steinar H. Gunderson [Tue, 27 Jun 2017 21:26:08 +0000 (23:26 +0200)]
Updates for newer protobuf and Stockfish.

3 years agoRemove the non-pretty moves from the protobuf, as it takes up a little CPU time for...
Steinar H. Gunderson [Sun, 20 Nov 2016 22:07:51 +0000 (23:07 +0100)]
Remove the non-pretty moves from the protobuf, as it takes up a little CPU time for the JavaScript to decode.

3 years agoSimplify a bit.
Steinar H. Gunderson [Sat, 19 Nov 2016 13:44:50 +0000 (14:44 +0100)]
Simplify a bit.

3 years agoMore build tweaks.
Steinar H. Gunderson [Sat, 19 Nov 2016 13:42:02 +0000 (14:42 +0100)]
More build tweaks.

3 years agoSend back a prettyprinted version of the move on hash probe.
Steinar H. Gunderson [Sat, 19 Nov 2016 11:04:21 +0000 (12:04 +0100)]
Send back a prettyprinted version of the move on hash probe.

3 years agoFix a crash issue when traversing PVs.
Steinar H. Gunderson [Tue, 15 Nov 2016 21:03:15 +0000 (22:03 +0100)]
Fix a crash issue when traversing PVs.

3 years agoLink the protobuf stuff statically.
Steinar H. Gunderson [Mon, 29 Aug 2016 22:08:50 +0000 (00:08 +0200)]
Link the protobuf stuff statically.

3 years agoDeal with Stockfish internal API changes.
Steinar H. Gunderson [Mon, 29 Aug 2016 21:57:02 +0000 (23:57 +0200)]
Deal with Stockfish internal API changes.

3 years agoMake server address into an UCI option.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:48:48 +0000 (00:48 +0100)]
Make server address into an UCI option.

3 years agoMove the hash probe class definition into a header file.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:41:52 +0000 (00:41 +0100)]
Move the hash probe class definition into a header file.

3 years agoDo not fill value if we have no search info.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:23:44 +0000 (00:23 +0100)]
Do not fill value if we have no search info.

3 years agoRefactor the RPC thread into a shutdown-able class.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:21:45 +0000 (00:21 +0100)]
Refactor the RPC thread into a shutdown-able class.

3 years agoAdd a SCORE_NONE.
Steinar H. Gunderson [Mon, 21 Mar 2016 23:13:09 +0000 (00:13 +0100)]
Add a SCORE_NONE.

3 years agoDecode the score into the protobuf.
Steinar H. Gunderson [Sat, 19 Mar 2016 21:36:16 +0000 (22:36 +0100)]
Decode the score into the protobuf.

3 years agoPut the root into a separate place.
Steinar H. Gunderson [Sat, 19 Mar 2016 21:22:57 +0000 (22:22 +0100)]
Put the root into a separate place.

3 years agoPrevent infinite loops on repetitions.
Steinar H. Gunderson [Sat, 19 Mar 2016 21:22:40 +0000 (22:22 +0100)]
Prevent infinite loops on repetitions.

3 years agoReturn the entire PV, and in slightly more parseable form.
Steinar H. Gunderson [Sat, 19 Mar 2016 19:08:53 +0000 (20:08 +0100)]
Return the entire PV, and in slightly more parseable form.

3 years agoGive the proto a package name.
Steinar H. Gunderson [Sat, 19 Mar 2016 15:50:10 +0000 (16:50 +0100)]
Give the proto a package name.

3 years agoReturn all candidate moves from the probe.
Steinar H. Gunderson [Fri, 18 Mar 2016 00:51:35 +0000 (01:51 +0100)]
Return all candidate moves from the probe.

3 years agoDo not use -Wshadow; it is incredibly noisy for protobuf code.
Steinar H. Gunderson [Fri, 18 Mar 2016 00:51:19 +0000 (01:51 +0100)]
Do not use -Wshadow; it is incredibly noisy for protobuf code.

3 years agoWhen returning gRPC probes, report scores from white's perspective.
Steinar H. Gunderson [Thu, 17 Mar 2016 09:45:38 +0000 (10:45 +0100)]
When returning gRPC probes, report scores from white's perspective.

3 years agoWrite out null-move and no move.
Steinar H. Gunderson [Thu, 17 Mar 2016 09:39:14 +0000 (10:39 +0100)]
Write out null-move and no move.

3 years agoMake the bound slightly easier to parse again.
Steinar H. Gunderson [Thu, 17 Mar 2016 01:25:35 +0000 (02:25 +0100)]
Make the bound slightly easier to parse again.

3 years agoMake the client prober output something a bit more easily parseable, and run in a...
Steinar H. Gunderson [Thu, 17 Mar 2016 01:12:13 +0000 (02:12 +0100)]
Make the client prober output something a bit more easily parseable, and run in a loop.

3 years agoRename client.cc to the right extension.
Steinar H. Gunderson [Thu, 17 Mar 2016 01:07:14 +0000 (02:07 +0100)]
Rename client.cc to the right extension.

3 years agoBetter comments and enums in the proto file.
Steinar H. Gunderson [Thu, 17 Mar 2016 01:05:59 +0000 (02:05 +0100)]
Better comments and enums in the proto file.