1
0
Fork 0
Commit Graph

4550 Commits (tune)

Author SHA1 Message Date
Marco Costalba 4a7bdac73f Fishtest Tuning Framework
The purpose of the code is to allow developers to easily and flexibly
setup SF for a tuning session. Mainly you have just to remove 'const'
qualifiers from the variables you want to tune and flag them for
tuning, so if you have:

int myKing = 10;
Score myBonus = S(5, 15);
Value myValue[][2] = { { V(100), V(20) }, { V(7), V(78) } };

and at the end of the update you may want to call
a post update function:

void my_post_update();

If instead of default Option's min-max values,
you prefer your custom ones, returned by:

std::pair<int, int> my_range(int value)

Or you jus want to set the range directly, you can
simply add below:

TUNE(SetRange(my_range), myKing, SetRange(-200, 200), myBonus, myValue, my_post_update);

And all the magic happens :-)

At startup all the parameters are printed in a
format suitable to be copy-pasted in fishtest.

In case the post update function is slow and you have many
parameters to tune, you can add:

UPDATE_ON_LAST();

And the values update, including post update function call, will
be done only once, after the engine receives the last UCI option.
The last option is the one defined and created as the last one, so
this assumes that the GUI sends the options in the same order in
which have been defined.

No functional change.
2019-03-10 11:02:17 +01:00
protonspring b8efa0daac Remove popcount16() (#2038)
This is a non-functional simplification / code-style change.

This popcount16 method does nothing but initialize the PopCnt16 arrays.

This can be done in a single bitset line, which is less lines and more clear. Performance for this code is moot.

No functional change.
2019-03-10 10:53:39 +01:00
xoto10 acc47e8b79 Simplify failedLow away #1986
FailedLow doesn't seem to add any value so remove it.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 43915 W: 9682 L: 9604 D: 24629
http://tests.stockfishchess.org/tests/view/5c5339770ebc592fc7baef74

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 58515 W: 9670 L: 9609 D: 39236
http://tests.stockfishchess.org/tests/view/5c53cc840ebc592fc7baf6c1

Ideas for further work:

    Tune the values in the revised fallingEval calculation
    Consider adding a term using delta, e.g. c * (delta - 20) as an indicator of eval instability

Bench: 3318033
2019-03-10 10:47:42 +01:00
Marco Costalba 4d0981fef3 Revert "Allowing singular extension in mate positions"
It was causing an assert: value > -VALUE_INFINITE
under some conditions.

See https://github.com/official-stockfish/Stockfish/issues/2036

Bench: 3318033
2019-03-09 13:28:11 +01:00
protonspring 1aab5b4b05 Remove FutilityMoveCounts array. (#2024)
This is a functional simplification that removes the FutilityMoveCounts array with a simple equation using only ints.

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 14175 W: 3123 L: 2987 D: 8065

LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 9900 W: 1735 L: 1597 D: 6568

Bench: 3380343
2019-03-05 20:48:29 +01:00
protonspring 714e857c24 Shrink Reductions[] array to one dimension
This is a non-functional patch which shrinks the reductions array.
This saves about 8Kb of memory.

The only slow part of master's reductions array is the calculation
of the log values, so using a separate array for those values and
calculating the rest real-time appears to be just as fast as master.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 63245 W: 13906 L: 13866 D: 35473
http://tests.stockfishchess.org/tests/view/5c7b571f0ebc5925cffdc104

No funcional change.
2019-03-05 19:02:04 +01:00
SFisGOD 58bbbd176b Pawn value tweak
STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 47166 W: 10664 L: 10311 D: 26191
http://tests.stockfishchess.org/tests/view/5c7dfc370ebc5925cffdf830

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 35439 W: 6034 L: 5767 D: 23638
http://tests.stockfishchess.org/tests/view/5c7e41020ebc5925cffdfe9b

Bench: 3470519
2019-03-05 14:54:25 +01:00
Marco Costalba 2bceba7f51 Assorted trivial cleanups 2/2019
No functional change.
2019-03-05 11:13:02 +01:00
Vizvezdenec c2fb0ff720 Add continuation history 5
Original patch passed STC:
http://tests.stockfishchess.org/tests/view/5c7439ff0ebc5925cffd3e64
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 26348 W: 5926 L: 5632 D: 14790

and LTC:
http://tests.stockfishchess.org/tests/view/5c745a8b0ebc5925cffd41a8
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 198411 W: 33238 L: 32510 D: 132663

But had undefined behavior.
After fixing (thx to @vondele )

passed LTC:
http://tests.stockfishchess.org/tests/view/5c763c7c0ebc5925cffd5de2
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 112253 W: 18711 L: 18225 D: 75317

bench 3049229
2019-03-05 11:10:10 +01:00
Joost VandeVondele 82ff04b992 Remove skipQuiets with mate fix. (#2021)
This removes the skipQuiets variable, as was done in an earlier round by
@protonspring, but fixes an oversight which led to wrong mate
announcements. Quiets can only be pruned when there is no mate score, so
set moveCountPruning at the right spot.

tested as a fix at STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 66321 W: 14690 L: 14657 D: 36974
http://tests.stockfishchess.org/tests/view/5c74f3170ebc5925cffd4b3c

and as the full patch at LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 25903 W: 4341 L: 4228 D: 17334
http://tests.stockfishchess.org/tests/view/5c7540030ebc5925cffd506f

Bench: 3292342
2019-02-27 13:36:48 +01:00
Marco Costalba 7c5f5fbada Revert "Remove skipQuiets variable in search()"
This reverts commit 76d2f5b94a.

Due to a bug, see https://github.com/official-stockfish/Stockfish/issues/2019

Bench: 3516616
2019-02-26 13:23:09 +01:00
Kurtbusch badb2aca44 Add KNNvKP Endgame Heuristic
This is a somewhat different patch. It fixes blindspots for
 two knights vs pawn endgame.

With local testing starting from random KNNvKP positions where the
pawn has not advanced beyond the 4th rank (thanks @protonspring !)
at 15+0.15 (4 cores), this went +105=868-27 against master. All except
two losses were won in reverse.

The heuristic is simple but effective - the strategy in these endgames
is to push the opposing king to the corner, then move the knight that's
blocking the pawn in for the checkmate while the pawn is free to move
and prevents stalemate. This patch gives SF the little boost it needs
to search the relevant king-cornering mating lines.

See the discussion in pull request 1939 for some more good results for
this test in independant tests:
https://github.com/official-stockfish/Stockfish/pull/1939

Bench: 3310239
2019-02-21 19:53:03 +01:00
MJZ1977 e51244cb27 ProbCutCount limit dependancy to cutNode
Use the ProbCutCount limit `2 + 2 * cutNode` instead of constant 3.

STC
LLR: -2.95 (-2.94,2.94) [0.50,4.50]
Total: 61812 W: 13599 L: 13459 D: 34754
http://tests.stockfishchess.org/tests/view/5c6d19240ebc5925cffca07a

LTC
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 27549 W: 4614 L: 4363 D: 18572
http://tests.stockfishchess.org/tests/view/5c6d45c10ebc5925cffca7a6

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

Bench: 3368889
2019-02-21 19:36:48 +01:00
protonspring 22ef36803e Remove PvNode dimension from Reductions array
This is a functional simplification: if we simply subtract one to Reductions[]
when PvNode is set, we can remove this dimension of the multidimensional array.
I think this saves about 8K of memory.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 10118 W: 2282 L: 2138 D: 5698
http://tests.stockfishchess.org/tests/view/5c6332b60ebc5925cffbdfed

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 70765 W: 11617 L: 11575 D: 47573
http://tests.stockfishchess.org/tests/view/5c63379e0ebc5925cffbe0de

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

Bench 3261078
2019-02-21 19:24:02 +01:00
protonspring 76d2f5b94a Remove skipQuiets variable in search()
This is a functional simplification. The moveCountPruning variable and the
skipQuiets variable are similar enough in function that they can be combined.
This removes the skipQuiets variable in search.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 23278 W: 5210 L: 5091 D: 12977
http://tests.stockfishchess.org/tests/view/5c65dc490ebc5925cffc12e9

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 77107 W: 12792 L: 12761 D: 51554
http://tests.stockfishchess.org/tests/view/5c65e4360ebc5925cffc1490

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

bench 3640330
2019-02-21 19:18:02 +01:00
protonspring 3c92f849ab Change outposts to single value #1946
This is a functional simplification of the Outposts array
moving it to a single value. This is a duplicate PR because
I couldn't figure out how to fix the original one.

The idea is from @31m059 with formatting recommendations by @snicolet.

See #1940 for additional information.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 23933 W: 5279 L: 5162 D: 13492
http://tests.stockfishchess.org/tests/view/5c3575800ebc596a450c5ecb

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 41718 W: 6919 L: 6831 D: 27968
http://tests.stockfishchess.org/tests/view/5c358c440ebc596a450c6117

bench 3783543
2019-02-08 10:31:28 +01:00
Marco Costalba 05f7d59a9a Assorted trivial cleanups 1/2019
To address #1862

No functional change.
2019-02-08 10:20:43 +01:00
Marco Costalba 332b90455b Log message of: Less king danger...
The commit:

Less king danger if we have a knight near by to defend it

went in withouth proper commit message, here below we add it:

STC: LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 113106 W: 25087 L: 24367 D: 63652
http://tests.stockfishchess.org/tests/view/5c5517540ebc592fc7bb0eb4

LTC: LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 96669 W: 16318 L: 15872 D: 64479
http://tests.stockfishchess.org/tests/view/5c55352b0ebc592fc7bb11c8

bench: 3653942
2019-02-08 10:19:00 +01:00
protonspring dd4796fcd5 Remove Some Bitboard Arrays (#1963)
This is non-functional. These 5 arrays are simple enough to calculate real-time and maintaining an array for them does not help. Decreases the memory footprint.

This seems a tiny bit slower on my machine, but passed STC well enough. Could someone verify speed?

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 44745 W: 9780 L: 9704 D: 25261
http://tests.stockfishchess.org/tests/view/5c47aa2d0ebc5902bca13fc4

The slowdown is minimal even in 32 bit case (thanks to @mstembera for testing):

Compiled using make build ARCH=x86-32 CXX=i686-w64-mingw32-c++ and benched
This patch only:

```
Results for 40 tests for each version:

            Base      Test      Diff      
    Mean    1455204   1450033   5171      
    StDev   49452     34533     59621     

p-value: 0.465
speedup: -0.004
```

No functional change.
2019-02-08 09:54:38 +01:00
mstembera 6514500236 Less king danger if we have a knight near by to defend it. (#1987)
bench: 3653942
2019-02-03 14:16:34 +01:00
Miguel Lahoz 9050eac595 Extend discovered checks regardless of SEE
A simple idea, but it makes sense: in current master the search is extended
for checks that are considered somewhat safe, and for for this we use the
static exchange evaluation which only considers the `to_sq` of a move.
This is not reliable for discovered checks, where another piece is giving
the check and is arguably a more dangerous type of check. Thus, if the check
is a discovered check, the result of SEE is not relevant and can be ignored.

STC:
LLR: 2.96 (-2.94,2.94) [0.50,4.50]
Total: 29370 W: 6583 L: 6274 D: 16513
http://tests.stockfishchess.org/tests/view/5c5062950ebc593af5d4d9b5

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 227341 W: 37972 L: 37165 D: 152204
http://tests.stockfishchess.org/tests/view/5c5094fb0ebc593af5d4dc2c

Bench: 3611854
2019-02-01 16:27:21 +01:00
Stéphane Nicolet ff97a9fdb9 Tweak tropism weight in king danger
There was a simplification attempt last week for the tropism
term in king danger, which passed STC but failed LTC. This
was an indirect sign that maybe the tropism factor was sightly
untuned in current master, so we tried to change it from 1/4
to 5/16.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 28098 W: 6264 L: 5990 D: 15844
http://tests.stockfishchess.org/tests/view/5c518db60ebc593af5d4e306

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 103709 W: 17387 L: 16923 D: 69399
http://tests.stockfishchess.org/tests/view/5c52a5510ebc592fc7baea8b

Bench: 4016000
2019-02-01 15:34:46 +01:00
Vizvezdenec 3f7ec977cd More precise checks evaluation in king danger
Remove overlapping safe checks from kingdanger:
- rook and queen checks from the same square: rook check is preferred
- bishop and queen checks form the same square: queen check is preferred

Increase bishop and rook check values as a compensation.

STC
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 27480 W: 6111 L: 5813 D: 15556
http://tests.stockfishchess.org/tests/view/5c521d050ebc593af5d4e66a

LTC
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 78500 W: 13145 L: 12752 D: 52603
http://tests.stockfishchess.org/tests/view/5c52b9460ebc592fc7baecc5

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

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

I have quite a few ideas of how to improve this patch.

- actually rethinking it now it will maybe be useful to discount
  queen/bishop checks if there is only one square that they can
  give check from and it's "occupied" by more valuable check. Right
  now count of this squares does not really matter.

- maybe some small extra bonus can be given for overlapping checks.

- some ideas about using popcount() on safechecks can be retried.

- tune this safecheck values since they were more or less randomly handcrafted in this patch.

Bench: 3216489
2019-02-01 12:43:33 +01:00
protonspring d1fd1a96bc Simplify Stat Score bonus
This is a functional simplification of this statScore bonus.
There seems to be little risk of regression with this one.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 26829 W: 5892 L: 5781 D: 15156
http://tests.stockfishchess.org/tests/view/5c5086bb0ebc593af5d4db75

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 28232 W: 4684 L: 4575 D: 18973
http://tests.stockfishchess.org/tests/view/5c50d7690ebc593af5d4dec9

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

Bench: 4001014
2019-01-31 15:21:24 +01:00
DU-jdto 3302349662 Don't update pvHit after IID
This patch removes line 875 of search.cpp, which was updating pvHit after IID.
Bench testing at depth 22 shows that line 875 of search.cpp never changes the
value of pvHit at NonPV nodes, while at PV nodes it often changes the value
from true to false (and never the reverse). This is because the definition of
pvHit at line 642 is :

```
pvHit = (ttHit && tte->pv_hit()) || (PvNode && depth > 4 * ONE_PLY);
```

while the assignment after IID omits the ` (PvNode && depth > 4 * ONE_PLY) `
condition. As such, unlike the other two post-IID tte reads, this line of code
does not make SF's state more consistent, but rather introduces an inconsistency
in the definition of pvHit. Indeed, changing line 875 read

```
pvHit = (ttHit && tte->pv_hit()) || (PvNode && depth > 4 * ONE_PLY);
```

to match line 642 is functionally equivalent to removing the line entirely, as
this patch does.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 62756 W: 13787 L: 13746 D: 35223
http://tests.stockfishchess.org/tests/view/5c446c850ebc5902bb5d4b75

LTC
LLR: 3.19 (-2.94,2.94) [-3.00,1.00]
Total: 61900 W: 10179 L: 10111 D: 41610
http://tests.stockfishchess.org/tests/view/5c45bf610ebc5902bb5d5d62

Bench: 3796134
2019-01-29 17:40:00 +01:00
Miguel Lahoz 242c566c1a Change pinning logic in Static Exchange Evaluation (SEE)
This changes 2 parts with regards to static exchange evaluation.

Currently, we do not allow pinned pieces to recapture if *all* opponent
pinners are still in their starting squares. This changes that to having
a less strict requirement, checking if *any* pinners are still in their
starting square. This makes our SEE give more respect to the pinning
side with regards to exchanges, which makes sense because it helps our
search explore more tactical options.

Furthermore, we change the logic for saving pinners into our state
variable when computing slider_blockers. We will include double pinners,
where two sliders may be looking at the same blocker, a similar concept
to our mobility calculation for sliders in our evaluation section.
Interestingly, I think SEE is the only place where the pinners bitboard
is actually used, so as far as I know there are no other side effects
to this change.

An example and some insights:

White Bf2, Kg1
Black Qe3, Bc5

The move Qg3 will be given the correct value of 0. (Previously < 0)
The move Qd4 will be incorrectly given a value of 0. (Previously < 0)

It seems the tradeoff in search is worth it. Qd4 will likely be pruned
soon by something like probcut anyway, while Qg3 could help us spot
tactics at an earlier depth.

STC:
LLR: 2.96 (-2.94,2.94) [0.50,4.50]
Total: 62162 W: 13879 L: 13408 D: 34875
http://tests.stockfishchess.org/tests/view/5c4ba1a70ebc593af5d49c55

LTC: (Thanks to @alayant)
LLR: 3.40 (-2.94,2.94) [0.00,3.50]
Total: 140285 W: 23416 L: 22825 D: 94044
http://tests.stockfishchess.org/tests/view/5c4bcfba0ebc593af5d49ea8

Bench: 3937213
2019-01-29 17:32:41 +01:00
Maciej Żenczykowski 8df1cd10df Use int8_t instead of int for SquareDistance[]
This patch saves (4-1) * 64 * 64 = 12KiB of cache.

STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 176120 W: 38944 L: 38087 D: 99089
http://tests.stockfishchess.org/tests/view/5c4c9f840ebc593af5d4a7ce

LTC
As a pure speed up, I've been informed it should not require LTC.

No functional change
2019-01-29 17:26:24 +01:00
protonspring 2d0af36753 Simplify TrappedRook
Simplified TrappedRook to a single penalty removing the dependency on mobility.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 106718 W: 23530 L: 23577 D: 59611
http://tests.stockfishchess.org/tests/view/5c43f6bd0ebc5902bb5d4131

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 54053 W: 8890 L: 8822 D: 36341
http://tests.stockfishchess.org/tests/view/5c44932a0ebc5902bb5d4d59

bench 3665090
2019-01-22 09:54:10 +01:00
Joost VandeVondele 58d3ee6175 Simplify pondering time management (#1899)
stopOnPonderhit is used to stop search quickly on a ponderhit. It is set by mainThread as part of its time management. However, master employs it as a signal between mainThread and the UCI thread. This is not necessary, it is sufficient for the UCI thread to signal that pondering finished, and mainThread should do its usual time-keeping job, and in this case stop immediately.

This patch implements this, removing stopOnPonderHit as an atomic variable from the ThreadPool,
and moving it as a normal variable to mainThread, reducing its scope. In MainThread::check_time() the search is stopped immediately if ponder switches to false, and the variable stopOnPonderHit is set.

Furthermore, ponder has been moved to mainThread, as the variable is only used to exchange signals between the UCI thread and mainThread.

The version has been tested locally (as fishtest doesn't support ponder):

Score of ponderSimp vs master: 2616 - 2528 - 8630 [0.503] 13774
Elo difference: 2.22 +/- 3.54

which indicates no regression.

No functional change.
2019-01-20 19:14:24 +01:00
marotear 59b2486bc3 Simplify pvHit (#1953)
Removing unnecessary excludedMove condition (there is not excluded move for PvNodes) and re-ordering computation.

Non functional change.
2019-01-20 12:24:03 +01:00
protonspring 691a287bfe Clean-up some shifting in space calculation (#1955)
No functional change.
2019-01-20 12:21:16 +01:00
Jonathan D 3acacf8471 Tweak initiative and Pawn PSQT (#1957)
Small changes in initiative(). For Pawn PSQT, endgame values for d6-e6 and d7-e7 are now symmetric. The MG value of d2 is now smaller than e2 (d2=13, e2=21 now compared to d2=19, e2=16 before). The MG values of h5-h6-h7 also increased so this might encourage stockfish for more h-pawn pushes.

STC
LLR: -2.96 (-2.94,2.94) [0.00,4.00]
Total: 81141 W: 17933 L: 17777 D: 45431
http://tests.stockfishchess.org/tests/view/5c4017350ebc5902bb5cf237

LTC
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 83078 W: 13883 L: 13466 D: 55729
http://tests.stockfishchess.org/tests/view/5c40763f0ebc5902bb5cff09

Bench: 3266398
2019-01-20 12:20:21 +01:00
protonspring 3300517ecb Remove AdjacentFiles
This is a non-functional simplification that removes the AdjacentFiles array.
This array is simple enough to calculate that the pre-calculated array provides
no benefit. Reduces the memory footprint.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 74839 W: 16390 L: 16373 D: 42076
http://tests.stockfishchess.org/tests/view/5c3d75920ebc596a450cfb67

No functionnal change
2019-01-17 08:11:09 +01:00
protonspring 3732c55c18 Simplify pawn moves (#1900)
If we define dcCandidates with & pawnsNotOn7, 
we don't have to & it both times.

This seems more clear to me as well.

Tested for no regression.
STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 44042 W: 9663 L: 9585 D: 24794
http://tests.stockfishchess.org/tests/view/5c21d9120ebc5902ba12e84d

No functional change.
2019-01-14 15:03:31 +01:00
Joost VandeVondele 230fb6e9ad Simplify time management a bit
The new form is likely to trigger a bit more at LTC. Given that LTC
appears to be an improvement, I think that is fine.

The change is not very invasive: it does the same as before, use
potentially less time for moves that are very stable. Most of the
time, the full bonus was given if the bonus was given, so the gradual
part {3, 4, 5} didn't matter much. Whereas previously 'stable' was
expressed as the last 80% of iterations are the same, now I use a
fixed depth (10 iterations). For TCEC style TC, it will presumably
imply some more moves that are played quicker (and thus more time
on the clock when it potentially matters). Note that 10 iterations
of stability means we've been proposing that move for 99.9% of search
time.

passed STC
http://tests.stockfishchess.org/tests/view/5c30d2290ebc596a450c055b
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 70921 W: 15403 L: 15378 D: 40140

passed LTC
http://tests.stockfishchess.org/tests/view/5c31ae240ebc596a450c1881
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17422 W: 2968 L: 2842 D: 11612

No functional change.
2019-01-14 09:25:22 +01:00
Joost VandeVondele 5446e6f408 Remove pvExact
The variable pvExact now overlaps with the pvHit concept. So you simplify
the logic with small code tweaks to have pvHit trigger where pvExact
previously triggered.

passed STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20558 W: 4497 L: 4373 D: 11688
http://tests.stockfishchess.org/tests/view/5c36e9fd0ebc596a450c7885

passed LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 23482 W: 3888 L: 3772 D: 15822
http://tests.stockfishchess.org/tests/view/5c37072d0ebc596a450c7a52

Bench: 3739723
2019-01-10 16:46:04 +01:00
mstembera d07e782e22 Minor cleanup to recent 'Flag critical search tree in hash table' patch
No functional change
2019-01-10 16:36:59 +01:00
Joost VandeVondele d2acdac101 Small improvements to the CI infrastructure
- avoid inlining for the debug testing so that suppressions work
- provide more output for triggered errors

No functional change.
2019-01-09 16:57:24 +01:00
MJZ1977 70880b8e24 Flag critical search tree in hash table
Introducing new concept, saving principal lines into the transposition table
to generate a "critical search tree" which we can reuse later for intelligent
pruning/extension decisions.

For instance in this patch we just reduce reduction for these lines. But a lot
of other ideas are possible.

To go further : tune some parameters, how to add or remove lines from the
critical search tree, how to use these lines in search choices, etc.

STC :
LLR: 2.94 (-2.94,2.94) [0.50,4.50]
Total: 59761 W: 13321 L: 12863 D: 33577 +2.23 ELO
http://tests.stockfishchess.org/tests/view/5c34da5d0ebc596a450c53d3

LTC :
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 26826 W: 4439 L: 4191 D: 18196 +2.9 ELO
http://tests.stockfishchess.org/tests/view/5c35ceb00ebc596a450c65b2

Special thanks to Miguel Lahoz for his help in transposition table in/out.

Bench: 3399866
2019-01-09 15:05:33 +01:00
Miguel Lahoz f69106f7bb Introduce Multi-Cut
This was inspired after reading about
[Multi-Cut](https://www.chessprogramming.org/Multi-Cut).

We now do non-singular cut node pruning. The idea is to prune when we
have a "backup plan" in case our expected fail high node does not fail
high on the ttMove.

For singular extensions, we do a search on all other moves but the
ttMove. If this fails high on our original beta, this means that both
the ttMove, as well as at least one other move was proven to fail high
on a lower depth search. We then assume that one of these moves will
work on a higher depth and prune.

STC:
LLR: 2.96 (-2.94,2.94) [0.50,4.50]
Total: 72952 W: 16104 L: 15583 D: 41265
http://tests.stockfishchess.org/tests/view/5c3119640ebc596a450c0be5

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 27103 W: 4564 L: 4314 D: 18225
http://tests.stockfishchess.org/tests/view/5c3184c00ebc596a450c1662

Bench: 3145487
2019-01-06 16:02:31 +01:00
Joost VandeVondele bb843a00c1 Check tablebase files
This addresses partially issue #1911 in that it documents in our
Readme the command that users can use to verifying the md5sum of
their downloaded tablebase files.

Additionally, a quick check of the file size (the size of each
tablebase file modulo 64 is 16 as pointed out by @syzygy1) has been
implemented at launch time in Stockfish.

Closes https://github.com/official-stockfish/Stockfish/pull/1927
and https://github.com/official-stockfish/Stockfish/issues/1911

No functional change.
2019-01-04 15:36:39 +01:00
Marco Costalba 3c576efa77 Delay castling legality check
Delay legality check of castling moves at search time,
just before making the move, as is the standard with all
the other move types.

This should avoid an useless and not trivial legality check
when the castling is then not tried later. For instance due
to a previous cut-off.

The patch is also a big simplification and allows to entirely
remove generate_castling()

Bench changes due to a different move sequence out of MovePicker.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 45073 W: 9918 L: 9843 D: 25312
http://tests.stockfishchess.org/tests/view/5c2f176f0ebc596a450bdfb3

LTC:
LLR: 3.15 (-2.94,2.94) [-3.00,1.00]
Total: 10156 W: 1707 L: 1560 D: 6889
http://tests.stockfishchess.org/tests/view/5c2e7dfd0ebc596a450bcdf4

Verified with perft both in standard and Chess960 cases.

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

Bench: 3559104
2019-01-04 14:23:14 +01:00
Marco Costalba eb6d7f537d
Assorted trivial cleanups (#1894)
To address https://github.com/official-stockfish/Stockfish/issues/1862

No functional change.
2019-01-01 14:10:26 +01:00
protonspring 79c97625a4 Remove openFiles in pawns. (#1917)
A single popcount in evaluate.cpp replaces all openFiles stuff in pawns. It doesn't seem to affect performance at all.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 28103 W: 6134 L: 6025 D: 15944
http://tests.stockfishchess.org/tests/view/5b7d70a20ebc5902bdbb1999

No functional change.
2019-01-01 13:38:09 +01:00
protonspring 7accf07c0b Remove "Any" predicate filter (#1914)
This custom predicate filter creates an unnecessary abstraction layer, but doesn't make the code any more readable. The code is clear enough without it.

No functional change.
2019-01-01 13:36:56 +01:00
protonspring e2d3c163cb Remove as useless micro-optimization in pawns generation (#1915)
The extra condition is used as a shortcut to skip the following 3 assignments:

```C++
        Bitboard b1 = shift<UpRight>(pawnsOn7) & enemies;
        Bitboard b2 = shift<UpLeft >(pawnsOn7) & enemies;
        Bitboard b3 = shift<Up     >(pawnsOn7) & emptySquares;
```

In case of EVASION with no target on 8th rank (the common case), we end up performing the 3 statements for nothing because b1 = b2 = b3 = 0.

But this is just a small micro-optimization and the condition is quite confusing, so just remove it and prefer a readable code instead.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 78020 W: 16978 L: 16967 D: 44075
http://tests.stockfishchess.org/tests/view/5c27b4fe0ebc5902ba135bb0

No functional change.
2019-01-01 13:35:53 +01:00
erbsenzaehler 800031c94c Improve the Readme
I tried to improve the Readme because many people in my local
chess club do not understand some of the UCO options properly.
Starting point of this was Cfish's Readme by Ronald de Man,
some internet resources and the Stockfish code itself.

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

Initial commit by user @erbsenzaehler, with help from users
Adrian Petrescu, @alayan-stk-2 and Elvin Liu.

No functional change

Co-Authored-By: Alayan-stk-2 <alayan-stk-2@users.noreply.github.com>
Co-Authored-By: Adrian Petrescu <apetresc@gmail.com>
Co-Authored-By: Elvin Liu <solarlight2@users.noreply.github.com>
2018-12-29 11:49:16 +01:00
31m059 69dc5568b3 Always initialize and evaluate king safety
Recent tests by @xoto10, @Vizvezdenec, and myself seemed to hint that Elo could
be gained by expanding the number of cases where king safety is applied. Several
users (@Spliffjiffer, @Vizvezdenec) have anticipated benefits specifically in
evaluation of tactics. It appears that we actually do not need to restrict the
cases in which we initialize and evaluate king safety at all: initializing and
evaluating it in every position appears roughly Elo-neutral at STC and possibly
a substantial Elo gain at LTC.

Any explanation for this scaling is, at this point, conjecture. Assuming it is
not due to chance, my hypothesis is that initialization of king safety in all
positions is a mild slowdown, offset by an Elo gain of evaluating king safety
in all positions. At STC this produces Elo gains and losses that offset each
other, while at longer time control the slowdown is much less important, leaving
only the Elo gain. It probably helps SF to explore king attacks much earlier in
search with high numbers of enemy pieces concentrating but not essentially attacking
king ring.

Thanks to @xoto10 and @Vizvezdenec for helping run my LTC!

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

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 35432 W: 7815 L: 7721 D: 19896
http://tests.stockfishchess.org/tests/view/5c24779d0ebc5902ba131b26

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 12887 W: 2217 L: 2084 D: 8586
http://tests.stockfishchess.org/tests/view/5c25049a0ebc5902ba132586

Bench: 3163951

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

How to continue from there?

* Next step will be to tune all the king danger terms once more after that :-)
2018-12-27 21:38:31 +01:00
noobpwnftw 14c4a40dc7 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.
2018-12-24 11:24:29 +01:00
noobpwnftw 0194da0d80 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.
2018-12-24 11:20:14 +01:00