1
0
Fork 0
Commit Graph

883 Commits (406979ea12ee7828e079871b0f9f3dc8f127a741)

Author SHA1 Message Date
Stéphane Nicolet 7b06475294 Scale down endgame factor when shuffling
This patch decreases the endgame scale factor using the 50 moves counter.
Looking at some games with this patch, it seems to have two effects on
the playing style:

1) when no progress can be made in late endgames (for instance in fortresses
   or opposite bishops endgames) the evaluation will be largely tamed down
   towards a draw value.

2) more interestingly, there is also a small effect in the midgame play because
   Stockfish will panic a little bit if there are more than four consecutive
   shuffling moves with an advantage: the engine will try to move a pawn or to
   exchange a piece to keep the advantage, so the follow-ups of the position
   will be discovered earlier by the alpha-beta search.

passed STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 23017 W: 5080 L: 4805 D: 13132
http://tests.stockfishchess.org/tests/view/5d7e4aef0ebc59069c36fc74

passed LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 30746 W: 5171 L: 4911 D: 20664
http://tests.stockfishchess.org/tests/view/5d7e513d0ebc59069c36ff26

Pull request: https://github.com/official-stockfish/Stockfish/pull/2304

Bench: 4272173
2019-09-16 01:37:39 +02:00
Vizvezdenec 843a6c4305 Introduce midgame initiative
This patch finally introduces something that was tried for years: midgame score
dependance on complexity of position. More precisely, if the position is very
simplified and the complexity measure calculated in the initiative() function
is inferior to -50 by an amount d, then we add this value d to the midgame score.

One example of play of this patch will be (again!) 4 vs 3 etc same flank endgames
where sides have a lot of non-pawn material: 4 vs 3 draw mostly remains the same
draw even if we add a lot of equal material to both sides.

STC run was stopped after 200k games (and not converging):
LLR: -1.75 (-2.94,2.94) [0.50,4.50]
Total: 200319 W: 44197 L: 43310 D: 112812
http://tests.stockfishchess.org/tests/view/5d7cfdb10ebc5902d386572c

passed LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 41051 W: 6858 L: 6570 D: 27623
http://tests.stockfishchess.org/tests/view/5d7d14680ebc5902d3866196

This is the first and not really precise version, a lot of other stuff can be
tried on top of it (separate complexity for middlegame, some more terms, even
simple retuning of values).

Bench: 4248476
2019-09-15 00:32:54 +02:00
31m059 a83d1a0e80 Use queens of either color in RookOnQueenFile
The recently-added RookOnQueenFile evaluation term (36e4a86) provided a bonus
for placing our rook on the same file as an enemy queen.

Here, we relax a condition in this bonus, broadening its effect to any queen.
It is also strategically desirable to place the rook on the same file as a friendly
queen, so the restriction on the queen's color is removed.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 66856 W: 14847 L: 14815 D: 37194
http://tests.stockfishchess.org/tests/view/5d7b3c6a0ebc5902d385bcf5

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 86786 W: 14264 L: 14248 D: 58274
http://tests.stockfishchess.org/tests/view/5d7b4e9b0ebc5902d385c178

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

Bench: 3703909
2019-09-14 07:47:05 +02:00
Vizvezdenec 8aecf26981 Scale down complexity for almost unwinnable endgames
This patch greatly scales down complexity of endgames when the
following conditions are all true together:

- pawns are all on one flank
- stronger side king is not outflanking weaker side
- no passed pawns are present

This should improve stockfish evaluation of obvious draws 4 vs 3, 3 vs 2
and 2 vs 1 pawns in rook/queen/knight/bishop single flank endgames where
strong side can not make progress.

passed STC
LLR: 2.94 (-2.94,2.94) [0.50,4.50]
Total: 15843 W: 3601 L: 3359 D: 8883

passed LTC
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 121275 W: 20107 L: 19597 D: 81571

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

Bench: 3954190

==========================

How to continue from there?

a) This could be a powerful idea for refining some parts of the evaluation
   function, a bit like when we try quadratics or other equations to emphasize
   certain situations (xoto10).

b) Some other combinaison values for this bonus can be done further, or
   overall retuning of weight and offset while keeping the formula simple.
2019-09-12 10:33:18 +02:00
xoto10 36e4a86c08 Bonus for rook on same file as their queen
This patch creates a simple bonus for a rook that is on the same file as the
opponent's queen.

STC 10+0.1 th 1 :
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 45609 W: 10120 L: 9733 D: 25756
http://tests.stockfishchess.org/tests/view/5d79895a0ebc5902d385484a

LTC 60+0.6 th 1 :
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 51651 W: 8606 L: 8288 D: 34757
http://tests.stockfishchess.org/tests/view/5d79a0850ebc5902d3854d27

Many thanks to @noobpwnftw for providing the extra cpu resources for fishtest,
which led to me doing these tests.

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

Bench: 4024461
2019-09-12 10:05:35 +02:00
Alain SAVARD 7efc39d683 Assorted trivial cleanups (July 2019)
No functional change
2019-08-14 22:15:48 +02:00
Stefan Geschwentner 66a3c2968b Tweak unsafe checks
Remove mobility area for unsafe checks. Also separate the evaluation terms
for unsafe checks and blockers for king with adjusted weights.

STC:
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 124526 W: 28292 L: 27504 D: 68730
http://tests.stockfishchess.org/tests/view/5d5138290ebc5925cf1070c3

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 84968 W: 14499 L: 14083 D: 56386
http://tests.stockfishchess.org/tests/view/5d527cfa0ebc5925cf107f93

Bench: 4139590
2019-08-14 20:59:04 +02:00
Alain SAVARD 9dc57b660e Passed file cleanup
Protonspring had a successful functional simplification that removes the
PassedFile array using a simple linear equation.

Merge the additive term S(5, 10) of protonspring passed file simplification
(pull request https://github.com/official-stockfish/Stockfish/pull/2250)
into the PassedRank array. This harmless change has a different bench because
the candidate passer evaluation will always get less compared to #2250,
as we apply bonus = bonus /2.

Tested as a non-regression against #2250

Passed STC
http://tests.stockfishchess.org/tests/view/5d33427e0ebc5925cf0e6fa2
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 81459 W: 18174 L: 18171 D: 45114

Passed LTC
http://tests.stockfishchess.org/tests/view/5d335c8d0ebc5925cf0e731e
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 18525 W: 3176 L: 3052 D: 12297

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

Bench: 3859856
2019-07-25 08:32:49 +02:00
Lolligerhans fd96cba676 No influence on unsafeSquares of passers by pieces
Remove their pieces from influencing 'unsafeSquares' in passer
evaluation.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 36421 W: 8170 L: 8078 D: 20173
http://tests.stockfishchess.org/tests/view/5d22fc8e0ebc5925cf0cb26e

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 18927 W: 3253 L: 3129 D: 12545
http://tests.stockfishchess.org/tests/view/5d26e2b20ebc5925cf0d3218

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

Bench: 3285659
2019-07-25 08:23:43 +02:00
Alain SAVARD 3ec362e4b2 Space Invaders
Try a more ambitius simplification of the space bonus

STC http://tests.stockfishchess.org/tests/view/5d2b62c90ebc5925cf0da2a4
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 51299 W: 11320 L: 11257 D: 28722

LTC http://tests.stockfishchess.org/tests/view/5d2bac270ebc5925cf0db215
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 49761 W: 8409 L: 8335 D: 33017

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

bench: 3395999
2019-07-25 08:07:55 +02:00
31m059 13ba67801f Just blockSq, not forward file. Bench: 3377831 (#2240)
This is another functional simplification to Stockfish passed pawn evaluation.

Stockfish evaluates some pawns which are not yet passed as "candidate" passed pawns, which are given half the bonus of fully passed ones. Prior to this commit, Stockfish considered a passed pawn to be a "candidate" if (a) it would not be a passed pawn if moved one square forward (the blocking square), or (b) there were other pawns (of either color) in front of it on the file. This latter condition used a fairly complicated method, forward_file_bb; here, rather than inspect the entire forward file, we simply re-use the blocking square. As a result, some pawns previously considered "candidates", but which are able to push forward, no longer have their bonus halved.

Simplification tests passed quickly at both STC and LTC. The results from both tests imply that this simplification is, most likely, additionally a small Elo gain, with a LTC likelihood of superiority of 87 percent.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 12908 W: 2909 L: 2770 D: 7229
http://tests.stockfishchess.org/tests/view/5d2a1c880ebc5925cf0d9006

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20723 W: 3591 L: 3470 D: 13662
http://tests.stockfishchess.org/tests/view/5d2a21fd0ebc5925cf0d9118

Bench: 3377831
2019-07-14 14:42:30 +02:00
Michael Chaly 0a8a3b8d9c tviigg. (#2238)
Current master code made sence when we had 2 types of bonuses for protected path to queen. But it was simplified so we have only one bonus now and code was never cleaned.
This non-functional simplification removes useless defendedsquares bitboard and removes one bitboard assignment (defendedSquares &= attackedBy[Us][ALL_PIECES] + defendedSquares & blockSq becomes just attackedBy[Us][ALL_PIECES] & blockSq also we never assign defendedSquares = squaresToQueen because we don't need it).
So should be small non-functional speedup.
Passed simplification SPRT.
http://tests.stockfishchess.org/tests/view/5d2966ef0ebc5925cf0d7659
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 23319 W: 5152 L: 5034 D: 13133

bench 3361902
2019-07-14 14:41:28 +02:00
31m059 a0360cc2d4 Linear formula for w. Bench: 3328507 (#2239)
In Stockfish, both the middlegame and endgame bonus for a passed pawn are calculated as a product of two factors. The first is k, chosen based on the presence of defended and unsafe squares. The second is w, a quadratic function of the pawn's rank. Both are only applied if the pawn's relative rank is at least RANK_4.

It does not appear that the complexity of a quadratic function is necessary for w. Here, we replace it with a simpler linear one, which performs equally at both STC and LTC.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 46814 W: 10386 L: 10314 D: 26114
http://tests.stockfishchess.org/tests/view/5d29686e0ebc5925cf0d76a1

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 82372 W: 13845 L: 13823 D: 54704
http://tests.stockfishchess.org/tests/view/5d2980650ebc5925cf0d7bfd

Bench: 3328507
2019-07-14 14:40:45 +02:00
31m059 82d66f6b72 Exclude passed pawns from Attacked2Unsupported
We recently added a bonus for double pawn attacks on unsupported enemy pawns,
on June 27. However, it is possible that the unsupported pawn may become a passer
by simply pushing forward out of the double attack. By rewarding double attacks,
we may inadvertently reward the creation of enemy passers, by encouraging both of
our would-be stoppers to attack the enemy pawn even if there is no opposing
friendly pawn on the same file.

Here, we revise this term to exclude passed pawns. In order to simplify the code
with this change included, we non-functionally rewrite Attacked2Unsupported to
be a penalty for enemy attacks on friendly pawns, rather than a bonus for our
attacks on enemy pawns. This allows us to exclude passed pawns with a simple
& ~e->passedPawns[Us], while passedPawns[Them] is not yet defined in this part
of the code.

This dramatically reduces the proportion of positions in which Attacked2Unsupported
is applied, to about a third of the original. To compensate, maintaining the same
average effect across our bench positions, we nearly triple Attacked2Unsupported
from S(0, 20) to S(0, 56). Although this pawn formation is rare, it is worth more
than half a pawn in the endgame!

STC: (stopped automatically by fishtest after 250,000 games)
LLR: -0.87 (-2.94,2.94) [0.50,4.50]
Total: 250000 W: 56585 L: 55383 D: 138032
http://tests.stockfishchess.org/tests/view/5d25795e0ebc5925cf0cfb51

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 81038 W: 13965 L: 13558 D: 53515
http://tests.stockfishchess.org/tests/view/5d25f3920ebc5925cf0d10dd

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

Bench: 3765158
2019-07-11 23:05:28 +02:00
Marco Costalba 4ae5a7b45a Assorted trivial cleanups June 2019
No functional change.
2019-07-11 12:22:20 +02:00
Vizvezdenec dab66631e8 Introduce attacks on space area
This patch introduces a small malus for every square in our space mask
that is attacked by enemy. The value of the malus is completely arbitrary
and is something we can tweak, also maybe we can gain some elo with tweaking
space threshold after this addition.

Passed STC
http://tests.stockfishchess.org/tests/view/5d10ce590ebc5925cf0af30b
LLR: 2.96 (-2.94,2.94) [0.50,4.50]
Total: 7082 W: 1648 L: 1449 D: 3985

Passed LTC
http://tests.stockfishchess.org/tests/view/5d10d2d80ebc5925cf0af3fd
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 79494 W: 13727 L: 13324 D: 52443

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

bench 3516460
2019-06-27 09:26:08 +02:00
Vizvezdenec 7cb8817ef2 Rewrite "More bonus for free passed pawn"
-removes wideUnsafeSquares bitboard
-removes a couple of bitboard operations
-removes one if operator
-updates comments so they actually represent what this part of code is doing now.

passed non-regression STC
http://tests.stockfishchess.org/tests/view/5d0c1ae50ebc5925cf0aa8db
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 16892 W: 3865 L: 3733 D: 9294

No functional change
2019-06-21 10:05:50 +02:00
Vizvezdenec 37ffacf209 More bonus for free passed pawn
Give even more bonus to passed pawn if adjacent squares to its path
are not attacked.

passed STC
http://tests.stockfishchess.org/tests/view/5d08c9b10ebc5925cf0a6630
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 175197 W: 39859 L: 38816 D: 96522

passed LTC
http://tests.stockfishchess.org/tests/view/5d0ab8240ebc5925cf0a8fe4
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 92928 W: 16124 L: 15682 D: 61122

Bench: 3398333
2019-06-20 16:52:02 +02:00
Marco Costalba d39bc2efa1 Assorted trivial cleanups 5/2019
No functional change.

bench: 4178282
2019-06-09 14:57:08 +02:00
protonspring 5935daf8a5 Simplify WeakUnopposedPawn #2181
This is a functional simplification.

Moves WeakUnopposedPawn to pawns.cpp and remove piece dependency.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 8699 W: 2000 L: 1853 D: 4846
http://tests.stockfishchess.org/tests/view/5cf7721b0ebc5925cf08ee79

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 46605 W: 7969 L: 7890 D: 30746
http://tests.stockfishchess.org/tests/view/5cf7d5f70ebc5925cf08fa96
2019-06-09 14:28:42 +02:00
protonspring 09caea5cab Simplify Outposts #2176
This is a functional simplification. This is NOT the exact version that was tested. Beyond the testing, an assignment was removed and a piece changes for consistency.

Instead of rewarding ANY square past an opponent pawn as an "outpost," only use squares that are protected by our pawn. I believe this is more consistent with what the chess world calls an "outpost."

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 23540 W: 5387 L: 5269 D: 12884
http://tests.stockfishchess.org/tests/view/5cf51e6d0ebc5925cf08b823

LTC
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 53085 W: 9271 L: 9204 D: 34610
http://tests.stockfishchess.org/tests/view/5cf5279e0ebc5925cf08b992

bench 3424592
2019-06-09 14:24:06 +02:00
31m059 434b2c72a4 Simplify k-value for passers. Bench: 3854907 (#2182)
Stockfish evaluates passed pawns in part based on a variable k, which shapes the passed pawn bonus based on the number of squares between the current square and promotion square that are attacked by enemy pieces, and the number defended by friendly ones. Prior to this commit, we gave a large bonus when all squares between the pawn and the promotion square were defended, and if they were not, a somewhat smaller bonus if at least the pawn's next square was. However, this distinction does not appear to provide any Elo at STC or LTC.

Where do we go from here? Many promising Elo-gaining patches were attempted in the past few months to refine passed pawn calculation, by altering the definitions of unsafe and defended squares. Stockfish uses these definitions to choose the value of k, so those tests interact with this PR. Therefore, it may be worthwhile to retest previously promising but not-quite-passing tests in the vicinity of this patch.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 42344 W: 9455 L: 9374 D: 23515
http://tests.stockfishchess.org/tests/view/5cf83ede0ebc5925cf0904fb

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 69548 W: 11855 L: 11813 D: 45880
http://tests.stockfishchess.org/tests/view/5cf8698f0ebc5925cf0908c8

Bench: 3854907
2019-06-09 14:19:07 +02:00
protonspring 3edf0e6b37 Scale lazy threshold according to material. (#2170)
STC
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 58543 W: 13238 L: 12782 D: 32523
http://tests.stockfishchess.org/tests/view/5cef3efa0ebc5925cf081f07

LTC
LLR: 3.70 (-2.94,2.94) [0.00,3.50]
Total: 82232 W: 14281 L: 13825 D: 54126
http://tests.stockfishchess.org/tests/view/5cef595d0ebc5925cf082441

bench 3807737
2019-05-31 14:35:39 +02:00
protonspring c645587270 Simplify semiopen_file (#2165)
This is a non-functional simplification. Since our file_bb handles either Files or Squares, using Square here removes some code. Not likely any performance difference despite the test.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 6081 W: 1444 L: 1291 D: 3346
http://tests.stockfishchess.org/tests/view/5ceb3e2e0ebc5925cf07ab03

Non functional change.
2019-05-29 10:00:32 +02:00
31m059 bf6b647a1a Allow RQ through pieces. Bench: 3415326 (#2153)
We evaluate defended and unsafe squares for a passed pawn push based on friendly and enemy rooks and queens on the passed pawn's file. Prior to this patch, we further required that these rooks and queens be able to directly attack the passed pawn. However, this restriction appears unnecessary and worth almost exactly 0 Elo at LTC.

The simplified code allows rooks and queens to attack/defend the passed pawn through other pieces of either color.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 29019 W: 6488 L: 6381 D: 16150
http://tests.stockfishchess.org/tests/view/5cdcf7270ebc5925cf05d30c

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 54224 W: 9200 L: 9133 D: 35891
http://tests.stockfishchess.org/tests/view/5cddc6210ebc5925cf05eca3

Bench: 3415326
2019-05-17 13:38:23 +02:00
xoto10 a8abba0b4d Remove pawn count in space() calculation #2139
Simplification. Various attempts to optimise the pawn
count bonus showed little effect, so remove pawn count
altogether and compensate by subtracting 1 instead of 4.

STC 10+0.1 th 1:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 152244 W: 33709 L: 33847 D: 84688
http://tests.stockfishchess.org/tests/view/5cceed330ebc5925cf04170e

LTC 60+0.6 th 1:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 24100 W: 4079 L: 3964 D: 16057
http://tests.stockfishchess.org/tests/view/5cd5b6b80ebc5925cf04e889

Bench: 3648841
2019-05-15 10:18:49 +02:00
Marco Costalba 4e72e2a964 Assorted trivial cleanups 4/2019
No functional change.
2019-05-02 19:30:26 +02:00
Michael Chaly 9a11a29194 Include bishop protection in king Danger evaluation. #2118
Same idea as fisherman's knight protection.

passed STC
LLR: 2.96 (-2.94,2.94) [0.50,4.50]
Total: 17133 W: 3952 L: 3701 D: 9480 
http://tests.stockfishchess.org/tests/view/5cc3550b0ebc5925cf02dada

passed LTC
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 37316 W: 6470 L: 6188 D: 24658 
http://tests.stockfishchess.org/tests/view/5cc3721d0ebc5925cf02dc90

Looking at this 2 ideas being recent clean elo gainers I have a feeling that we can add also rook and queen protection bonuses or overall move this stuff in pieces loop in the same way as we do pieces attacking bonuses on their kingring... :) Thx fisherman for original idea.

Bench 3429173
2019-04-27 11:31:55 +02:00
protonspring 3b46df546d Move pawnsOnSquares to Position (#2100)
We can remove the values in Pawns if we just use the piece arrays in Position. This reduces the size of a pawn entry. This simplification passed individually, and in concert with ps_passedcount100 (removes passedCount storage in pawns.).

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 19957 W: 4529 L: 4404 D: 11024
http://tests.stockfishchess.org/tests/view/5cb3c2d00ebc5925cf016f0d

Combo STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17368 W: 3925 L: 3795 D: 9648
http://tests.stockfishchess.org/tests/view/5cb3d3510ebc5925cf01709a

This is a non-functional simplification.
2019-04-16 23:10:53 +02:00
protonspring eb07775583 Remove semiopenFiles in pawns and simplify space #2102
This is a functional simplification.

    1. semiopenFiles is removed in pawns and uses the piece arrays in position instead.

    2. popcount is removed in space calculations and uses pawn piece count instead.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 33327 W: 7423 L: 7324 D: 18580
http://tests.stockfishchess.org/tests/view/5cb4be090ebc5925cf018511

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 10173 W: 1774 L: 1636 D: 6763
http://tests.stockfishchess.org/tests/view/5cb4c5920ebc5925cf018696

bench 3402947
2019-04-16 16:09:36 +02:00
31m059 ab4b94e173 Raise kingDanger threshold and adjust constant term #2087
The kingDanger term is intended to give a penalty which increases rapidly in the middlegame but less so in the endgame. To this end, the middlegame component is quadratic, and the endgame component is linear. However, this produces unintended consequences for relatively small values of kingDanger: the endgame penalty will exceed the middlegame penalty. This remains true up to kingDanger = 256 (a S(16, 16) penalty), so some of these inaccurate penalties are actually rather large.

In this patch, we increase the threshold for applying the kingDanger penalty to eliminate some of this unintended behavior. This was very nearly, but not quite, sufficient to pass on its own. The patch was finally successful by integrating a second kingDanger tweak by @Vizvezdenec, increasing the kingDanger constant term slightly and improving both STC and LTC performance.

Where do we go from here? I propose that in the future, any attempts to tune kingDanger coefficients should also consider tuning the kingDanger threshold. The evidence shows clearly that it should not be automatically taken to be zero.

Special thanks to @Vizvezdenec for the kingDanger constant tweak. Thanks also to all the approvers and CPU donors who made this possible!

STC:
LLR: -2.96 (-2.94,2.94) [0.00,4.00]
Total: 141225 W: 31239 L: 30846 D: 79140
http://tests.stockfishchess.org/tests/view/5cabbdb20ebc5925cf00b86c

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 30708 W: 5296 L: 5043 D: 20369
http://tests.stockfishchess.org/tests/view/5cabff760ebc5925cf00c22d

Bench: 3445945
2019-04-09 19:35:17 +02:00
Moez Jellouli aa0166fba6 Add attacked by 2 pawns to attackedBy2 (#2074)
Add squares attacked by 2 pawns to the attackedBy2 array

STC :
LLR: -2.95 (-2.94,2.94) [0.50,4.50]
Total: 132722 W: 29583 L: 29090 D: 74049
http://tests.stockfishchess.org/tests/view/5ca231ba0ebc5925cf000794

LTC :
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 94589 W: 16161 L: 15718 D: 62710
http://tests.stockfishchess.org/tests/view/5ca25d180ebc5925cf000ba4

Bench: 3337864
2019-04-04 08:49:35 +02:00
protonspring c858990377 Replace std::mins/max with clamp function (#2062)
Adding a clamp function makes some of these range limitations a bit prettier and removes some #include's.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 28117 W: 6300 L: 6191 D: 15626
http://tests.stockfishchess.org/tests/view/5c9aa1df0ebc5925cfff8fcc

Non functional change.
2019-03-31 10:48:27 +02:00
protonspring 7133598a98 Simplify pawn asymmetry (remove use of semiopen files). (#2054)
This is a functional simplification.

To me, the exclusive OR of semiopenFiles here is quite convoluted. Looks like it can be removed.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 43885 W: 9731 L: 9653 D: 24501
http://tests.stockfishchess.org/tests/view/5c9041680ebc5925cfff10ea

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 68437 W: 11577 L: 11533 D: 45327
http://tests.stockfishchess.org/tests/view/5c9101740ebc5925cfff1cbf

bench 3575627
2019-03-24 17:41:25 +01:00
Marco Costalba 2bceba7f51 Assorted trivial cleanups 2/2019
No functional change.
2019-03-05 11:13: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
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
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 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
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
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
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
31m059 7240a90bf9 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
2018-12-16 10:04:49 +01:00
Alain SAVARD 64a6138d37 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.
2018-12-16 09:57:43 +01:00
SFisGOD 31ac538f96 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
2018-12-13 13:35:35 +01:00
protonspring e917bd59b1 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.
2018-12-11 13:47:56 +01:00
Vizvezdenec 9dc6d270fc 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
2018-12-02 20:18:51 +01:00
ElbertoOne 79e3710fd2 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
2018-12-01 10:29:10 +01:00
Vizvezdenec bb58bc215c Reintroduce tropism to kingdanger
Tropism in kingdanger was simplified away in this pull request #1821.
This patch reintroduces tropism in kingdanger with using quadratic scaling.

Passed STC http://tests.stockfishchess.org/tests/view/5bf7c1b10ebc5902bced1f8f
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 52803 W: 11835 L: 11442 D: 29526

Passed LTC http://tests.stockfishchess.org/tests/view/5bf816e90ebc5902bced24f1
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 17204 W: 2988 L: 2795 D: 11421

How do we continue from there?

I've recently tried to introduce tropism difference term in kingdanger which
passed STC 6 times but failed LTC all the time. Maybe using quadratic scaling
for it will also be helpful.

Bench 4041387
2018-11-24 02:14:18 +01:00
31m059 6e66e7aae2 Remove the tropism term from kingDanger
A recent LTC tuning session by @candirufish showed this term decreasing significantly. It appears that it can be removed altogether without significant Elo loss.

I also thank @GuardianRM, whose attempt to remove tropism from king danger inspired this one.

After this PR is merged, my next step will be to attempt to tune the coefficients of this new, simplified kingDanger calculation.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 12518 W: 2795 L: 2656 D: 7067
http://tests.stockfishchess.org/tests/view/5befadda0ebc595e0ae3a289

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 164771 W: 26463 L: 26566 D: 111742
http://tests.stockfishchess.org/tests/view/5befcca70ebc595e0ae3a343

LTC 2, rebased on Stockfish 10 beta:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 75226 W: 12563 L: 12529 D: 50134
http://tests.stockfishchess.org/tests/view/5bf2e8910ebc5902bcecb919

Bench: 3412071
2018-11-24 02:09:35 +01:00
xoto10 3925750945 Bonus for restricting opponent's piece moves
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 51883 W: 11297 L: 10915 D: 29671
http://tests.stockfishchess.org/tests/view/5bf1e2ee0ebc595e0ae3cacd

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 15859 W: 2752 L: 2565 D: 10542
http://tests.stockfishchess.org/tests/view/5bf337980ebc5902bcecbf62

Notes:

(1) The bonus value has not been carefully tested, so it may be possible
to find slightly better values.

(2) Plan is to now try adding similar restriction for pawns. I wanted to
include that as part of this pull request, but I was advised to do it as
two separate pull requests. STC is currently running here, but may not add
enough value to pass green.

Bench: 3679086
2018-11-20 07:50:12 +01:00
Stéphane Nicolet cf5d683408 Stockfish 10-beta
Preparation commit for the upcoming Stockfish 10 version, giving a chance to catch last minute feature bugs and evaluation regression during the one-week code freeze period. Also changing the copyright dates to include 2019.

No functional change
2018-11-19 11:18:21 +01:00
Kurt b92206305f Tune evaluation scores
STC:
LLR: -2.96 (-2.94,2.94) [0.00,4.00]
Total: 84697 W: 18173 L: 18009 D: 48515
http://tests.stockfishchess.org/tests/view/5bea366f0ebc595e0ae34793

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 157625 W: 25533 L: 24893 D: 107199
http://tests.stockfishchess.org/tests/view/5be8b69e0ebc595e0ae33024

Personally, I feel like SF has been tuned to death recently and that we
need to step away from existing-parameter tunes for a bit and focus more
on new ideas. I don't really think there's much more ELO in these tunes
(for now). For me at least, this was the last existing-parameter tune I'll
be running for quite a while. Cheers!

Bench: 3572567
2018-11-19 10:42:46 +01:00
VoyagerOne 4111f36f45 Simplify Castle Extension
Remove depth condition in castle extension, also don't extend if
Singular Extension and Check Extansion fail to extend.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 42070 W: 9118 L: 9036 D: 23916
http://tests.stockfishchess.org/tests/view/5be899cc0ebc595e0ae32f07

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 78278 W: 12490 L: 12458 D: 53330
http://tests.stockfishchess.org/tests/view/5be8ac420ebc595e0ae33010

Bench: 3611041
2018-11-19 10:28:55 +01:00
protonspring 0e508f30bb Code style in search.cpp
It does not appear to be not necessary or advantageous to
conditionally initialize kingRing[Us] or kingAttackersCount[Them],
so the 'else' can be removed.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 22873 W: 4923 L: 4804 D: 13146
http://tests.stockfishchess.org/tests/view/5be9a8270ebc595e0ae33c7e

No functional change
2018-11-19 10:16:07 +01:00
Nikolay Kostov 4350a66ffa Update a comment in the evaluate.cpp file to reflect recent change
No functional change
2018-11-19 10:10:47 +01:00
protonspring 3cbb05b1b8 Replace the PassedDanger array by an equation
This equation seems to do as well as the current PassedDanger array.

Master values were: 3, 7, 11, 20
The new values given by the equation are: 3, 6, 11, 18

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 84301 W: 18155 L: 18156 D: 47990
http://tests.stockfishchess.org/tests/view/5bda03180ebc595e0ae2518e

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 7940 W: 1358 L: 1217 D: 5365
http://tests.stockfishchess.org/tests/view/5bdc69880ebc595e0ae27d28

We stopped a LTC run after 70000 games:
LLR: 0.74 (-2.94,2.94) [0.00,4.00]
Total: 70257 W: 11319 L: 11064 D: 47874
http://tests.stockfishchess.org/tests/view/5bdca8420ebc595e0ae281a9

Bench: 3913185
2018-11-12 20:33:07 +01:00
mstembera 68209c9121 Remove redundant king square parameter
We don't need to pass the king square as an explicit parameter to the functions
king_safety() and do_king_safety() since we already pass in the position.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 69686 W: 14894 L: 14866 D: 39926
http://tests.stockfishchess.org/tests/view/5be84ac20ebc595e0ae3283c

No functional change.
2018-11-12 19:45:05 +01:00
31m059 30a905c95d Simplify tropism. (#1807)
We calculate tropism as a sum of two factors. The first is the number of squares in our kingFlank and Camp that are attacked by the enemy; the second is number of these squares that are attacked twice. Prior to this commit, we excluded squares we defended with pawns from this second value, but this appears unnecessary. (Doubly-attacked squares near our king are still dangerous.) The removal of this exclusion is a possible small Elo gain at STC (estimated +1.59) and almost exactly neutral at LTC (estimated +0.04).

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20942 W: 4550 L: 4427 D: 11965
http://tests.stockfishchess.org/tests/view/5be4e0ae0ebc595e0ae308a0

LTC:
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 56941 W: 9172 L: 9108 D: 38661
http://tests.stockfishchess.org/tests/view/5be4ec340ebc595e0ae30938

Bench: 3813986
2018-11-11 22:14:28 +01:00
Fabian Fichter a6fe035977 Simplify mobility danger
Check sign only after adding mobility danger term.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 9090 W: 2001 L: 1856 D: 5233
http://tests.stockfishchess.org/tests/view/5bdc5ee10ebc595e0ae27bc2

LTC
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 123466 W: 19766 L: 19805 D: 83895
http://tests.stockfishchess.org/tests/view/5bdc678e0ebc595e0ae27cf3

bench: 3630207
2018-11-04 21:30:35 +01:00
Stéphane Nicolet 8bb7a73708 Rook tweaks in evaluation
Some small changes in evaluation to try to convince Stockfish to centralize
her rooks more in middle game and avoid trapping them in the corners. Joint
work by SFisGOD and snicolet.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 99826 W: 21895 L: 21341 D: 56590
http://tests.stockfishchess.org/tests/view/5bdc3e280ebc595e0ae277df

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 21467 W: 3541 L: 3322 D: 14604
http://tests.stockfishchess.org/tests/view/5bdc9ff30ebc595e0ae28119

Bench: 3631608
2018-11-02 22:08:26 +01:00
SFisGOD 4a0db9ea3c Combo
Combo of two parameter tweaks and tuned values for Queen and ThreatByKing.

STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 20180 W: 4439 L: 4198 D: 11543
http://tests.stockfishchess.org/tests/view/5bd7b8250ebc595e0ae22e97

LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 86312 W: 14106 L: 13685 D: 58521
http://tests.stockfishchess.org/tests/view/5bd803560ebc595e0ae23213

This combo consists of the following:

Queen Value (tuned values)
Iter: 72056, A: 5000, alpha 0.602000, gamma 0.101000, clipping old, rounding deterministic
param: QueenValueMg, best: 2528.91, start: 2528.00
param: QueenValueEg, best: 2687.12, start: 2698.00

ThreatByKing (tuned values)
Green STC (50.8k games)
http://tests.stockfishchess.org/tests/view/5bd1d5a00ebc595e0ae1cbec
LTC (I stopped this test at 71.2k games. It's likely yellow.)
http://tests.stockfishchess.org/tests/view/5bd263e70ebc595e0ae1d77e

WeakUnopposedPawn (tweak) by xoto (https://github.com/xoto10)
Green STC (102.8k games)
http://tests.stockfishchess.org/tests/view/5bd306bb0ebc595e0ae1e146
Yellow LTC (90.8k games)
http://tests.stockfishchess.org/tests/view/5bd3ea660ebc595e0ae1f16b

aspiTune1 (tweak) by vondele (https://github.com/vondele)
Green STC (125.9k games)
http://tests.stockfishchess.org/tests/view/5bd2ae100ebc595e0ae1dab0
Yellow LTC (107.9k games)
http://tests.stockfishchess.org/tests/view/5bd3eb700ebc595e0ae1f16f

Thank you @31m059 (Mark Tenzer) for helping me! Also, thank you very much
for recognizing my efforts. I genuinely appreciate it.

Bench: 3556672
2018-11-01 15:39:19 +01:00
Vizvezdenec 7a61368971 Tweak of knight PSQT and mobility bonuses
STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 16906 W: 3745 L: 3516 D: 9645
http://tests.stockfishchess.org/tests/view/5bd306a40ebc595e0ae1e144

LTC
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 62779 W: 10249 L: 9901 D: 42629
http://tests.stockfishchess.org/tests/view/5bd3188f0ebc595e0ae1e296

Bench 3166402
2018-10-27 09:23:11 +02:00
Miguel Lahoz 0370077c37 Simplify evaluation of blockers_for_king
Currently, we have two evaluation terms which account for pinned pieces.
One is for all pinned pieces in kingDanger computation and another for
just pinned pawns in ThreatByRank. We can increase the relevant bonus
for kingDanger calculation and do away with the ThreatByRank, which
seems to just add more complexity.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 113353 W: 24299 L: 24356 D: 64698
http://tests.stockfishchess.org/tests/view/5ba348c20ebc592cf2766e61

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 96458 W: 15514 L: 15511 D: 65433
http://tests.stockfishchess.org/tests/view/5ba398830ebc592cf2767563

At 100k games, I thought it struggles a bit, but some related [0,4]
tests attempting individual tweaks seem to fail:

I tried directly tweaking ThreatByRank:
http://tests.stockfishchess.org/tests/view/5ba3c6300ebc592cf276791c
http://tests.stockfishchess.org/tests/view/5ba3c6190ebc592cf2767917

@Vizveznedec was also recently trying to tweak the same coeffecients
for kingDanger calculation:
http://tests.stockfishchess.org/tests/view/5ba2c7320ebc592cf27664b2
http://tests.stockfishchess.org/tests/view/5ba2c8220ebc592cf27664b8
http://tests.stockfishchess.org/tests/view/5ba2c7880ebc592cf27664b4
http://tests.stockfishchess.org/tests/view/5ba2c7ce0ebc592cf27664b6

Bench: 4648095
2018-10-14 20:15:16 +02:00
31m059 489357d7b2 Combo
This PR is a combination of two unrelated [0, 4] patches that appeared promising
but not quite strong enough to pass on their own. The combination initially failed
STC with a positive score after a long run, and the subsequent speculative LTC test
passed.

* tweak_threatOnQueen4 :

Increase the middlegame components of ThreatByMinor[QUEEN]
and ThreatByRook[QUEEN] by 15 each. Bryan's (@crossbr) analysis of CCC Bonus Game 10
inspired several tests on penalizing a queen with limited safe mobility. While
attempting to implement this idea, I noticed that when I did not include the queen's
current square in the calculations, the Elo gains seemed to vanish--and only then did
I have the idea to revisit ThreatByMinor[QUEEN] and ThreatByRook[QUEEN], adding a
corresponding value to each. Without Bryan's work, this test would never have been
submitted. I would also like to recognize the efforts and contributions of @SFisGOD,
who also vigorously worked on this idea.

* Use pure static eval for null move pruning :

This idea was directly re-purposed from a promising test by Jerry Donald Watson
(@jerrydonaldwatson) in August. It was also independently developed and tested by
Stefan Geschwentner (@locutus2) previously.
Thank you all!

STC (failed yellow):
LLR: -2.96 (-2.94,2.94) [0.00,4.00]
Total: 83913 W: 17986 L: 17825 D: 48102
http://tests.stockfishchess.org/tests/view/5bbc59300ebc592439f76aa5

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 137198 W: 22351 L: 21772 D: 93075
http://tests.stockfishchess.org/tests/view/5bbce35f0ebc592439f77639

Bench: 4312846
2018-10-14 20:02:31 +02:00
protonspring 13d06edb84 Two simplifications in passed pawns evaluation
These two simplifications appear to be affecting and/or offsetting each other.
Neither can be removed independently, but in combination they pass -3,1.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 36391 W: 7888 L: 7795 D: 20708
http://tests.stockfishchess.org/tests/view/5b9bce410ebc592cf275f1b2

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 19513 W: 3237 L: 3114 D: 13162
http://tests.stockfishchess.org/tests/view/5b9c0edf0ebc592cf275f80e

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

bench 4059356
2018-09-27 21:18:18 +02:00
Vizvezdenec 0fa957cf66 Tweak opposite colord bishops endgame scaling.
Make scale factor dependant on asymmetry of pawn structure.

STC http://tests.stockfishchess.org/tests/view/5b92a2a80ebc592cf2753dd4
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 31490 W: 6870 L: 6587 D: 18033

LTC http://tests.stockfishchess.org/tests/view/5b92f8170ebc592cf2754438
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 54928 W: 8988 L: 8653 D: 37287

This patch shows that SF can use some more complicated endgame heuristics to evaluate endgames better from the distance.

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

Bench: 4248710
2018-09-10 12:22:44 +02:00
Stéphane Nicolet 767c4ad1fc Update list of authors
And also fix some spaces and formatting oddities in the code.

No functional change
2018-09-03 22:11:30 +02:00
Stéphane Nicolet 2bfaf45455 Re-introduce "keep pawns on both flanks"
Re-introduce the "keep pawns on both flanks" idea.

STC yellow:
LLR: -2.95 (-2.94,2.94) [0.00,5.00]
Total: 93279 W: 20175 L: 19853 D: 53251
http://tests.stockfishchess.org/tests/view/5b8a00370ebc592cf274916a

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 11440 W: 1960 L: 1792 D: 7688
http://tests.stockfishchess.org/tests/view/5b8a329f0ebc592cf2749615

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

Bench: 4609645
2018-09-01 11:30:38 +02:00
Rocky640 f923dc0fe5 Long Diagonal Tweaks
a) Reduce PSQT values along the long diagonals on non-central squares
and increase the LongDiagonal bonus accordingly. The effect is to penalise
bishops on the long diagonal which can not "see" the 2 central squares.
The "good" bishops still have more or less the same bonus as current master.

b) For a bishop on a central square, because of the "| s" term in the code,
the LongDiagonalBonus was always given. So while being there, remove the "| s"
and compensate the central Bishop PSQT accordingly.

Passed STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 44498 W: 9658 L: 9323 D: 25517
http://tests.stockfishchess.org/tests/view/5b8992770ebc592cf2748942

Passed LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 63092 W: 10324 L: 9975 D: 42793
http://tests.stockfishchess.org/tests/view/5b89a17a0ebc592cf2748b59

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

bench: 4693901
2018-09-01 04:33:17 +02:00
protonspring e846a9306d Remove PawnsOnBothFlanks
It looks like PawnsOnBothFlanks can be removed from initiative().
A barrage of tests seem to confirm that the adjustment to -110
does not gain elo to offset any potential loss by removing
PawnsOnBothFlanks.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 22014 W: 4760 L: 4639 D: 12615
http://tests.stockfishchess.org/tests/view/5b7f50cc0ebc5902bdbb3a3e

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 40561 W: 6667 L: 6577 D: 27317
http://tests.stockfishchess.org/tests/view/5b801f9f0ebc5902bdbb4467

The barrage of 0,4 tests on the -136 value are in my ps_tunetests branch.
http://tests.stockfishchess.org/tests/user/protonspring

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

Bench: 4413173

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

How to continue from there?

The fact that endgames with all the pawns on only one flank are
drawish is a well-known chess idea, so it seems quite strange that
this can be removed so easily without losing Elo.

In the past there had been attempts to improve on PawnsOnBothFlanks
with similar concepts (for instance using the pawn span value), but
the tests were at best neutral. Maybe Stockfish is now mature enough
that these refined ideas would work to replace PawnsOnBothFlanks?
2018-08-29 02:49:10 +02:00
Stefano Cardanobile b5581b7779 Combo of several promising parameter tweaks
Combo of several tuning patches which finished yellow at LTC.

[STC](http://tests.stockfishchess.org/tests/view/5b6ead340ebc5902bdba14ce)
LR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 10668 W: 2445 L: 2239 D: 5984
Elo: 6.25 [1.76,10.69] (95%)

[LTC](http://tests.stockfishchess.org/tests/view/5b6eb50e0ebc5902bdba151f)
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 23761 W: 4155 L: 3923 D: 15683
Elo: 3.02 [0.29,5.67] (95%)

Original patches:
- [Piece values](http://tests.stockfishchess.org/tests/view/5b6d2cc00ebc5902bdba02d5) by Stefano Cardanobile
- [Stat bonus](http://tests.stockfishchess.org/tests/view/5b6adbc90ebc5902bdb9da73) by Stefan Geschwentner
- [Rook on pawn](http://tests.stockfishchess.org/tests/view/5b62a95b0ebc5902bdb961c0) by Mark Tenzer
- [Hanging bonus](http://tests.stockfishchess.org/tests/view/5b5d2fa00ebc5902bdb90855) by Ivan Ilvec
- [ss tweak](http://tests.stockfishchess.org/tests/view/5b58b7240ebc5902bdb89025) by miguel-l

Bench: 4694813
2018-08-12 10:09:30 +02:00
Stefano Cardanobile bd4d2b0576 First check threshold in space evaluation
Currently, we first calculate some bitboards at the top of Evaluation::space()
and then check whether we actually need them. Invert the ordering. Of course this
does not make a difference in current master because the constexpr bitboard
calculations are in fact done at compile time by any decent compiler, but I find
my version a bit healthier since it will always meet or exceed current implementation
even if we eventually change the spaceMask to something not contsexpr.

No functional change.
2018-08-08 17:58:41 +02:00
Stéphane Nicolet ba2a2c34bb Introduce tropism measure in king danger
This patch adds the tropism measure as a new term in the king danger variable.
Since we then trasform this variable as a Score via a quadratic formula, the
main effect of the patch is the positive correlation of the tropism measure
with some checks and pins information already present in the king danger code.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 6805 W: 1597 L: 1431 D: 3777
http://tests.stockfishchess.org/tests/view/5b5df8d10ebc5902bdb91699

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 32872 W: 5782 L: 5523 D: 21567
http://tests.stockfishchess.org/tests/view/5b5e08d80ebc5902bdb917ee

How to continue from there?

• it may be possible to use CloseEnemies=S(7,0)
• we may want to try incorporating other strategic features in the quadratic
  king danger.

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

Bench: 5591925
2018-07-30 08:26:48 +02:00
Miguel Lahoz c08e05b494 Increase the mg->eg gradient for the PawnlessFlank malus
Just a change of value to S(19, 84). Also somewhat of a follow up
to the recent tweak in definition of KingFlank.

I tried a lot of other values before this, increasing and decreasing
but with little success, and before giving up I wanted to try tweaking
the middlegame and endgame values in the opposite directions. I guess
this is somewhat lucky.

STC:
LLR: 2.94 (-2.94,2.94) [0.00,4.00]
Total: 67685 W: 15399 L: 14963 D: 37323
http://tests.stockfishchess.org/tests/view/5b5b5ae80ebc5902bdb8e4f8

LTC: (Also thanks to Stephane Nicolet)
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 54635 W: 9505 L: 9172 D: 35958
http://tests.stockfishchess.org/tests/view/5b5b78f20ebc5902bdb8ece5

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

Bench: 4883742
2018-07-28 07:34:37 +02:00
Stéphane Nicolet 9ca014df49 Fix a compilation error for MSVC
The previous commit wouldn't compile on the Microsoft Virtual Studio C++ compiler. So use a more compatible style for the same idea (which we already use in numerous places of evaluate.cpp, for instance in line 563).

Under the Clang compiler, both versions generate exactly the same machine code (same md5 signatures for the two binaries).

No functional change.
2018-07-27 15:46:13 +02:00
Stéphane Nicolet e12fc10b5c Remove a popcount for HinderPassedPawn
Remove a popcount for HinderPassedPawn, and compensate by doubling
 the bonus from S(4,0) to to S(8,0).

Maybe it was pure luck, but we got the idea of this Elo gaining patch by
seing the simplification attempt by Mike Whiteley in pull request #1703.
This suggests that whenever we have a passed evaluation simplification,
we should consider the possibility that the master bonus has become
slightly out of tune with time, and we should try a few Elo gaining [0..4]
tests by hand-tuning the master bonus.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 19136 W: 4388 L: 4147 D: 10601
http://tests.stockfishchess.org/tests/view/5b59be6f0ebc5902bdb8ac06

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 99382 W: 17324 L: 16843 D: 65215
http://tests.stockfishchess.org/tests/view/5b59d2410ebc5902bdb8afa8

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

Bench: 4688817
2018-07-27 15:23:57 +02:00
Miguel Lahoz 313f403733 Tweak KingFlank when king is on edge files
This tweak excludes files D and E from the KingFlank bitboard when our
king is on the A or H files respectively. As far as I can tell, this
affects two things: the calculation for CloseEnemies and PawnlessFlank.
Aside from filtering out slightly less relevant attacks in the flank,
I suspect this helps with king prophylaxis, avoiding attacks and moving
towards the center when the pawns start to come off.

STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 56755 W: 12881 L: 12489 D: 31385
http://tests.stockfishchess.org/tests/view/5b58a94c0ebc5902bdb88c72

LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 130205 W: 22536 L: 21957 D: 85712
http://tests.stockfishchess.org/tests/view/5b58b7580ebc5902bdb89029

How to continue: Tweaking the two bonuses mentioned might give some
gain, although as far as I can tell, CloseEnemies is very sensitive to
even small changes.

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

Bench: 5026009
2018-07-27 10:38:20 +02:00
Jekaa c9f80660a6 Small reformat in evaluate threats (non functional)
When evaluating threat by safe pawn and pawn push the same expression is used.

STC
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 19444 W: 4540 L: 4309 D: 10595
http://tests.stockfishchess.org/tests/view/5b5a6e150ebc5902bdb8c5c0

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

No functional change.

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

Comments by Stéphane Nicolet:

I don't measure any speed-up on my system, with two parallel benches at depth 22:

Total time (ms) : 74989
Nodes searched : 144830258
Nodes/second : 1931353
master

Total time (ms) : 75341
Nodes searched : 144830258
Nodes/second : 1922329
testedpatch

And anyway, like Stefan Geschwentner, I don't think that a 0.3% speed-up would
be enough to pass a [0..5] LTC test -- as a first approximation, we have this
rule of thumb that 1% speed-up gives about 1 Elo point.

However, considering the facts that the reformatting by itself is interesting,
that this is your first green test and that you played by the rules by running
the SPRT[0..5] test before opening the pull request, I will commit the change.
I will only take the liberty to change the occurrences of safe in lines 590 and
591 to b, to make the code more similar to lines 584 and 585.

So approved, and congrats :-)
2018-07-27 10:30:53 +02:00
protonspring 2660a9145e Remove condition for pawn threats
It appears as though removing squares that are already attacked
by our pawns can be removed.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 51242 W: 11503 L: 11440 D: 28299
http://tests.stockfishchess.org/tests/view/5b58b5a40ebc5902bdb88f52

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 35246 W: 6063 L: 5966 D: 23217
http://tests.stockfishchess.org/tests/view/5b58f8e20ebc5902bdb8959b

How to continue after this patch: there is now a slight semantic
overlap between the ThreatByPawnPush and the ThreatBySafePawn bonuses,
so hand-tuning either of these, or both at the same time, is natural.

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

Bench 4734881
2018-07-26 09:34:22 +02:00
Stefan Geschwentner a4eda3056e Rank threats on pinned pawns
Add for pinned pawns half of the standard rank based threat bonus.

STC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 44010 W: 9987 L: 9635 D: 24388
http://tests.stockfishchess.org/tests/view/5b58aa780ebc5902bdb88c7a

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 29475 W: 5089 L: 4847 D: 19539
http://tests.stockfishchess.org/tests/view/5b58b56c0ebc5902bdb88f37

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

Bench: 4503866
2018-07-26 01:29:12 +02:00
Stéphane Nicolet ae98927885 Code clean-up
This patch implements some idea by Alain Savard and Mike Whiteley taken from the perpertual renaming/reformatting thread.

This is a pure code cleaning patch (so no change in functionality), but I use it as a pretext to correct the bogus bench number that I introduced in the previous commit.

Bench: 4413383
2018-07-25 18:31:02 +02:00
double-beep 38471697b7 Slight decrease of overload value
Set overload value to S(13,6)

STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 27606 W: 6371 L: 6094 D: 15141
http://tests.stockfishchess.org/tests/view/5b5455840ebc5902bdb82425

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 112435 W: 19442 L: 18921 D: 74072
http://tests.stockfishchess.org/tests/view/5b546d4a0ebc5902bdb82741

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

Bench: 4937000
2018-07-24 08:39:08 +02:00
Goodkov Vasiliy Aleksandrovich 0d5fe2f156 Simplify condition for ThreatByRook
Remove stronglyProtected Queen for ThreatByRook. Idea is that in the
current master the  SliderOnQueen bonus and the see_ge() function do
something similar as ThreatByRook for Queen, so this patch removes
some redundancy, in that sense.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 21878 W: 4939 L: 4818 D: 12121
http://tests.stockfishchess.org/tests/view/5b53a83b0ebc5902bdb815d1

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 35307 W: 5979 L: 5882 D: 23446
http://tests.stockfishchess.org/tests/view/5b53b60b0ebc5902bdb8174c

Close https://github.com/official-stockfish/Stockfish/pull/1690

Bench: 4834554
2018-07-23 00:03:05 +02:00
Alain SAVARD 0365b08601 Simplify the "overload" condition
This is a follow-up of the previous pull request (#1686) by Miguel.
We simplify the "Overload" bonus condition by re-using the "weak"
variable, which captures well the essence of the overload condition.
This may also be a small speed optimization because the weak variable
is in a register at this point of the code.

http://tests.stockfishchess.org/tests/view/5b527b440ebc5902bdb7f7db
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 10925 W: 2517 L: 2374 D: 6034

http://tests.stockfishchess.org/tests/view/5b527f930ebc5902bdb7f883
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 15569 W: 2697 L: 2568 D: 10304

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

Bench: 5010472
2018-07-21 07:05:50 +02:00
Miguel Lahoz 41bc0d5660 Remove connectivity.
There seems to be some strange interaction between Overload and Connectivity.
Overload encourages us to not have too many defended and attacked pieces,
as this may expose us to various tactics. This feels somewhat like it is in
conflict with Connectivity, where pieces are defended preemptively.

Here I take the "pick one or the other" approach and just remove connectivity,
while strengthening the effect of Overload to compensate. The reasoning is that
if we defend our pieces preemptively, then it does get attacked, we want to do
something about it so we don't get penalized by Overload. On the other
hand, if it doesn't get attacked, then there's no need to defend it.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 27734 W: 6174 L: 6064 D: 15496
http://tests.stockfishchess.org/tests/view/5b5073bd0ebc5902bdb7ba5c

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 51606 W: 8897 L: 8827 D: 33882
http://tests.stockfishchess.org/tests/view/5b50aa900ebc5902bdb7bf29

Bench: 4658006
2018-07-21 06:56:48 +02:00
Miguel Lahoz 3913726d1c Use single value for KingProtector.
After some recent big tuning session, the values for King Protector were
simplified to only be used on minor pieces. This patch tries to further
simplify by just using a single value, since current S(6,5) and S(5,6)
are close to each other. The value S(6,6) ended up passing, although
S(5,5) was also tried and failed STC.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 14261 W: 3288 L: 3151 D: 7822
http://tests.stockfishchess.org/tests/view/5b4ccdf50ebc5902bdb77f65

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 19606 W: 3396 L: 3273 D: 12937
http://tests.stockfishchess.org/tests/view/5b4ce4280ebc5902bdb7803b

Bench: 5448998
2018-07-18 08:44:45 +02:00
ElbertoOne 2ac35027d5 Simplify Overload condition
Extend the bonus for Overload to cases where our side
 has more than one attacker to a non pawn piece.
Based on an idea by Bryan in the forum. For instance,
 now black gets the overload bonus in this position:
 8/5R1k/6pb/p6p/P1N4P/1Pp5/2K3P1/2N4r b - - 6 46
 because two black pieces are attacking the knight on c1
 that is defended only by the king.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 57446 W: 12762 L: 12711 D: 31973
http://tests.stockfishchess.org/tests/view/5b4ca9970ebc5902bdb77a88

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 42113 W: 7295 L: 7209 D: 27609
http://tests.stockfishchess.org/tests/view/5b4ccea00ebc5902bdb77f69

Bench: 4667263
2018-07-18 08:37:13 +02:00
protonspring a6fa6a9e92 Remove rank limitation for MinorBehindPawn
This is a functional simplification.  It seems like the rank restriction
for MinorBehindPawn can be removed.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 61195 W: 13404 L: 13360 D: 34431
http://tests.stockfishchess.org/tests/view/5b47e6f00ebc5978f4be3fc0

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 31701 W: 5367 L: 5264 D: 21070
http://tests.stockfishchess.org/tests/view/5b48a2cb0ebc5978f4be4769

Bench: 4938702
2018-07-14 08:27:33 +02:00
candirufish d2d4e85f25 Tuned Values after 2 million spsa games
Various king and pawn eval values tuned after 2 million games. Rounding
slightly adjusted.

LTC: http://tests.stockfishchess.org/tests/view/5b477a260ebc5978f4be3ed4
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 32783 W: 5852 L: 5588 D: 21343

STC: http://tests.stockfishchess.org/tests/view/5b472d420ebc5978f4be3e4d
LLR: 3.23 (-2.94,2.94) [0.00,4.00]
Total: 44380 W: 10201 L: 9841 D: 24338

I think I reached the limit of the fishtest framework. It frequently
crashed at 2 million games already. The small values also moved a lot
throughout the entire tuning session though with smaller margin. The
passed danger and close enemies values seems the most sensitive (changing
close enemies alone to 6 failed before but now it passes), whether or not
they are close to optimal I don't know, but it seems some parameters are
also correlated to others.

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

bench: 5103722
2018-07-14 08:13:15 +02:00
31m059 0f48095759 Simplify ThreatByKing to be a single Score.
In the current master, ThreatByKing is an array of two Scores, one for
when we have a single attack and one for when we have many. The latter
case is very rarely called during bench and was recently given a strange
negative value during a tuning run, as pointed out by @candirufish on
commit efd4ca2.  Here, we simplify away this second case entirely, and
increase the remaining ThreatByKing to compensate.

Although I derived the parameter tweak independently, with the goal of
preserving the same average bonus, I later noticed that a very similar
Score had already been derived by an ongoing SPSA tuning session.
I therefore recognize @candirufish for first discovering these values.

I would also like to thank @Rocky640 for valuable feedback that pointed
me in the direction of ThreatByKing.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 7677 W: 1772 L: 1623 D: 4282
http://tests.stockfishchess.org/tests/view/5b3db0320ebc5902b9ffe97a

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 108031 W: 18329 L: 18350 D: 71352
http://tests.stockfishchess.org/tests/view/5b3dbf4b0ebc5902b9ffe9db

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

Bench: 4678861
2018-07-06 01:34:01 +02:00
joergoster 1e9397a2df Simplify KingProtector penalty.
Recent tuning results implied this penalty is more important for knights
and bishops, and almost negligible for rooks and queen.

Passed as simplification both
STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 20873 W: 4592 L: 4469 D: 11812
http://tests.stockfishchess.org/tests/view/5b2fb4d00ebc5902b2e57e84

and LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 46069 W: 7949 L: 7870 D: 30250
http://tests.stockfishchess.org/tests/view/5b2fcc4b0ebc5902b2e580c5

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

Bench: 5487679
2018-06-26 08:55:35 +02:00
Alain SAVARD f0a7bed6fb Simplify HinderPassedPawn bonus
Make sure each piece is not scored more than once as a passed pawn "hinderer",
by scoring only the blockers along the passed pawn path. Inspired by TCEC Game 29.

Passed STC as a simplification
http://tests.stockfishchess.org/tests/view/5b3016d00ebc5902b2e58552
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 75388 W: 16656 L: 16641 D: 42091

Passed LTC as a simplification
http://tests.stockfishchess.org/tests/view/5b302ed90ebc5902b2e587fc
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 49157 W: 8460 L: 8386 D: 32311

Current master was also counting the number of attacks along a passed pawn path,
which might be misleading:

a) a defender might be counted many times for the same pawn path. For example a
   White rook on a1 attacking a black pawn on a7 would score the bonus * 6 but
   would be probably better placed on a8

b) a defender might be counted on different pawn paths and might be overloaded. For
   example a Ke4 or Qe4 against pawns on d6  and f6 would score the bonus * 6.

Counting each blocker or attacker only once is more complicated, and does not help
either: http://tests.stockfishchess.org/tests/view/5b2ff1cb0ebc5902b2e582b2

After this small simplification, there might be ways to increase the HinderPassedPawn
penalty.

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

Bench: 4520519
2018-06-26 08:16:37 +02:00
candirufish efd4ca27c4 Another set of tuned values after one million games
Another set of tuned values, obtained by a long session of one million games.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 15810 W: 3687 L: 3458 D: 8665
http://tests.stockfishchess.org/tests/view/5b2d32f60ebc5902b2e55d9e

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 102118 W: 18146 L: 17651 D: 66321
http://tests.stockfishchess.org/tests/view/5b2d372c0ebc5902b2e55e0a

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

Bench: 4557946
2018-06-23 09:03:58 +02:00
Stéphane Nicolet 34321fcc2d Increase outflanking weight to 12
Give more incentive to king activity in the endgame by increasing the weight
of the "outflanking" variable from 8 to 12 in the function evaluate_initiative().

Finished yellow after 133102 games at STC:

LLR: -3.07 (-2.94,2.94) [0.00,4.00]
Total: 133102 W: 29535 L: 29179 D: 74388
http://tests.stockfishchess.org/tests/view/5b2b63fe0ebc5902b2e54475

Passed LTC:

LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 28027 W: 4918 L: 4672 D: 18437
http://tests.stockfishchess.org/tests/view/5b2ba39e0ebc5902b2e54a64

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

Bench: 4721753
2018-06-22 01:29:25 +02:00
candirufish 062eb074c8 Tuned values after 505k games
Various king and pawn tuned eval values after 505k 60 sec 600 nodes time
SPSA games. Adjusted passed rank and file values to be symmetrical.

Passed LTC (after passed rank/file adjustment):
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 37906 W: 6953 L: 6668 D: 24285
http://tests.stockfishchess.org/tests/view/5b2790960ebc5902b8d17ba1

A previous, very similar version with raw tuned values passed STC and LTC:

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 39515 W: 9227 L: 8900 D: 21388
http://tests.stockfishchess.org/tests/view/5b277e3e0ebc5902b8d17ac9

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 14618 W: 2743 L: 2537 D: 9338
http://tests.stockfishchess.org/tests/view/5b2785020ebc5902b8d17b98

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

bench: 4777396
2018-06-21 10:23:05 +02:00
Stefano80 9d219c07e4 Slight simplification in scale factor computation
[STC](http://tests.stockfishchess.org/tests/view/5b2614000ebc5902b8d17193)
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 17733 W: 3996 L: 3866 D: 9871

[LTC](http://tests.stockfishchess.org/tests/view/5b264d0f0ebc5902b8d17206)
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 55524 W: 9535 L: 9471 D: 36518

Use pawn count scaling also for opposite bishops endings with additional material, with a slope of 2 instead of 7. This simplifies slightly the code.

This PR is a functionally equivalent refactoring of the version which was submitted.

Four versions tried, 2 passed both STC and LTC. I picked the one which seemed more promising at LTC.

Slope 4 passed STC (-0.54 Elo), LTC not attempted
Slope 3 passed STC (+2.51 Elo), LTC (-0.44 Elo)
Slope 2 passed STC (+2.09 Elo), LTC (+0.04 Elo)
Slope 1 passed STC (+0.90 Elo), failed LTC (-3.40 Elo)

Bench: 4761613
2018-06-20 05:27:24 +02:00
Stéphane Nicolet bf01bd0755 Tweak kingAttackersCount and KingAttackWeights
Use the whole kingRing for pawn attackers instead of only the squares directly
around the king. This tends to give quite a lot more kingAttackersCount, so to
compensate and to avoid raising the  king danger too fast we lower the values
in the KingAttackWeights array a little bit.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 51892 W: 10723 L: 10369 D: 30800
http://tests.stockfishchess.org/tests/view/5af6d4dd0ebc5968e652428e

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 24536 W: 3737 L: 3515 D: 17284
http://tests.stockfishchess.org/tests/view/5af709890ebc5968e65242ac

Credits to user @xoroshiro for the idea of using the kingRing for pawn attackers.

How to continue? It seems that the KingAttackWeights[] array stores values
which are quite Elo-sensitive, yet they have not been tuned with SPSA recently.
There might be easy Elo points to get there.

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

Bench: 5282815
2018-05-13 07:20:39 +02:00
mstembera c163c2fcb0 Include all blockers in king danger
Simplification: in king danger, include all blockers and not only pinned
pieces, since blockers enemy pieces can result in discovered checks which
are also bad.

STC  http://tests.stockfishchess.org/tests/view/5af35f9f0ebc5968e6523fe9
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 145781 W: 29368 L: 29478 D: 86935

LTC http://tests.stockfishchess.org/tests/view/5af3cb430ebc5968e652401f
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 76398 W: 11272 L: 11232 D: 53894

I also incorrectly scheduled STC with [0,5] which it failed.
http://tests.stockfishchess.org/tests/view/5af283c00ebc5968e6523f33
LLR: -2.94 (-2.94,2.94) [0.00,5.00]
Total: 12338 W: 2451 L: 2522 D: 7365

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

bench: 4698290

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

Thanks to @vondele and @Rocky640 for a cleaner version of the patch,
and the following comments!

> Most of the pinned, (or for this pull request, blocking) squares were
> already computed in the unsafeChecks, the only missing squares being:
>
> a) squares attacked by a Queen which are occupied by friendly piece
>    or "unsafe". Note that adding such squares never passed SPRT[0,5].
>
> b) squares not in mobilityArea[Us].
>
> There is a strong relationship between the blockers and the unsafeChecks,
> but the bitboard unsafeChecks is still useful when the checker is not
> aligned with the king, and the checking square is occupied by friendly
> piece or is "unsafe". This is always the case for the Knight.
2018-05-10 23:36:16 +02:00
candirufish fc0a1f37cf Tuned some pawns and evaluation constants
Tuned values in pawns.cpp and evaluate.cpp after a SPSA session:
419k games 60sec 600nodetime.  We have adjusted the PassedRank[]
output of the SPSA session to keep increasing values with rank,
and PassedFile[] output to keep the West <–> East symmetry of
the evaluation.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 58948 W: 12431 L: 12046 D: 34471
http://tests.stockfishchess.org/tests/view/5af2302f0ebc5968e6523f0a

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 22211 W: 3468 L: 3251 D: 15492
http://tests.stockfishchess.org/tests/view/5af264c80ebc5968e6523f1a

See https://github.com/official-stockfish/Stockfish/pull/1587
and https://github.com/official-stockfish/Stockfish/pull/1590

bench: 4437531
2018-05-09 09:22:11 +02:00
MJZ1977 5a7cdadfb3 Penalty for bad bishop with blocked central files
We increase the penalty for bad bishops by a factor proportional
to the number of our blocked pawns in the center files C, D, E or F.

STC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 8868 W: 1870 L: 1700 D: 5298
http://tests.stockfishchess.org/html/live_elo.html?5ae7674f0ebc590e39268b34

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 5813 W: 950 L: 808 D: 4055
http://tests.stockfishchess.org/html/live_elo.html?5ae77bae0ebc5926dba90dd9

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

Bench: 5364190
2018-05-01 07:12:27 +02:00
Stefano80 213166ba22 Always scale using pawn contribution
This is a further step in the long quest for a simple way of determining
scale factors for the endgame.

Here we remove the artificial restriction in evaluate_scale_factor()
based on endgame score. Also SCALE_FACTOR_ONEPAWN can be simplified
away. The latter is a small non functional simplification with respect
to the version that was testedin the framework, verified on bench with
depth 22 for good measure.

Passed STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 49438 W: 9999 L: 9930 D: 29509
http://tests.stockfishchess.org/tests/view/5ae20c8b0ebc5963175205c8

Passed LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 101445 W: 15113 L: 15110 D: 71222
http://tests.stockfishchess.org/tests/view/5ae2a0560ebc5902a1998986

How to continue from there?

Maybe the general case could be scaled with pawns from both colors
without losing Elo. If that is the case, then this could be merged
somehow with the scaling in evaluate_initiative(), which also uses
a additive malus down when the number of pawns in the position goes
down.

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

Bench: 5254862
2018-04-29 07:26:25 +02:00
Stéphane Nicolet 11967e89cd Update various comments
Spotted by Alain Savard, Joost VandeVondele, Ronald de Man, Fabian Fichter, Chris Cain, xoto10

No functional change
2018-04-29 06:48:18 +02:00
Alain SAVARD 45072612d4 No Queen in the MobilityArea
Queen was recently excluded from the mobility area of friendly minor
pieces. Exclude queen also from the mobility area of friendly majors too.

Run as a simplification:

STC
http://tests.stockfishchess.org/tests/view/5ade396f0ebc59602d053742
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 46972 W: 9511 L: 9437 D: 28024

LTC
http://tests.stockfishchess.org/tests/view/5ade64b50ebc5949f20a24d3
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 66855 W: 10157 L: 10105 D: 46593

How to continue from there?

The mobilityArea is used in various places of the evaluation as a
soft proxy for "not attacked by the opponent pawns". Now that the
mobility area is getting smaller and smaller, it may be worth to
hunt for Elo gains by trying the more direct ~attackedBy[Them][PAWN]
instead of mobilityArea[Us] in these places.

Bench: 4650572
2018-04-24 14:41:50 +02:00
Alain SAVARD 66af80972a Tidy up on Overload
Move new code in the if (defended | weak) {} section.

No functional change
2018-04-18 19:44:41 +02:00
Jerry Donald Watson 62619fa228 Simplify condition in space definition
We remove an unnecessary condition in the definition of safe squares
in the space evaluation. Only the squares which are occupied by our
pawns or attacked by our opponent's pawns are now excluded.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 21096 W: 4321 L: 4199 D: 12576
http://tests.stockfishchess.org/tests/view/5acbf7510ebc59547e537d4e

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 23437 W: 3577 L: 3460 D: 16400
http://tests.stockfishchess.org/tests/view/5acc0f750ebc59547e537d6a

It may be possible to further refine the definition of such safe squares.

Bench: 5351765
2018-04-10 17:47:55 +02:00
Mark Tenzer 759d129e47 Introduce Overload
This patch applies a S(10, 5) bonus for every square that is:

- Occupied by an enemy piece which is not a pawn
- Attacked exactly once by our pieces
- Defended exactly once by enemy pieces

The idea is that these pieces must be defended. Their defenders have
dramatically limited mobility, and they are vulnerable to our future
attack.

As with connectivity, there are probably many more tests to be run in
this area. In particular:

- I believe @snicolet's queen overload tests have demonstrated a potential
  need for a queen overload bonus above and beyond this one; however, the
  conditions for "overload" in this patch are different (excluding pieces
  we attack twice).  My next test after this is (hopefully) merged will be
  to intersect the Bitboard I define here with the enemy's queen attacks and
  attempt to give additional bonus.
- Perhaps we should exclude pieces attacked by pawns--can pawns really be
  overloaded? Should they have the same weight, or less?  This didn't work
  with a previous version, but it could work with this one.
- More generally, different pieces may need more or less bonus. We could
  change bonuses based on what type of enemy piece is being overloaded, what
  type of friendly piece is attacking, and/or what type of piece is being
  defended by the overloaded piece and attacked by us, or any intersection
  of these three.  For example, here attacked/defended pawns are excluded,
  but they're not totally worthless targets, and could be added again with
  a smaller bonus.
- This list is by no means exhaustive.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 17439 W: 3599 L: 3390 D: 10450
http://tests.stockfishchess.org/tests/view/5ac78a2e0ebc59435923735e

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 43304 W: 6533 L: 6256 D: 30515
http://tests.stockfishchess.org/tests/view/5ac7a1d80ebc59435923736f

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

Bench: 5248871

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

This is my first time opening a PR, so I apologize if there are errors.
There are too many people to thank since I submitted my first test just
over a month ago. Thank you all for the warm welcome and here is to more
green patches!

In particular, I would like to thank:
- @crossbr, whose comment in a FishCooking thread first inspired me to
            consider the overloading of pieces other than queens,
- @snicolet, whose queen overload tests inspired this one and served as
             the base of my first overload attempts,
- @protonspring, whose connectivity tests inspired this one and who provided
                 much of the feedback needed to take this from red to green,
- @vondele, who kindly corrected me when I submitted a bad LTC test,
- @Rocky640, who has helped me over and over again in the past month.

Thank you all!
2018-04-07 01:31:23 +02:00
Alain SAVARD 04a228f9c8 Remove the Queen from the mobility area of minor pieces
In master, we already remove the King from the mobility area of minor pieces
because the King simply stands in the way of other pieces, and since opponent
cannot capture the King, any piece which "protects" the King cannot recapture.

Similarly, this patch introduces the idea that it is rarely a need for a Queen
to be "protected" by a minor (unless it is attacked only by a Queen, in fact).
We used to have a LoosePiece bonus, and in a similar vein the Queen was excluded
from that penalty.

Idea came when reviewing an old game of Kholmov. He was a very good midgame
player, but in the opening his misplace his Queen (and won in the end :-) :
     http://www.chessgames.com/perl/chessgame?gid=1134645

Both white queen moves 10.Qd3 and 13.Qb3 are in the way of some minor piece.
I would prefer to not give a bishop mobility bonus at move 10 for the square d3,
or later a knight mobility bonus at move 13 for the square b3. And the textbook
move is 19.Qe3! which prepares 20.Nb3. This short game sample shows how much a
queen can be "in the way" of minor pieces.

STC
http://tests.stockfishchess.org/tests/view/5ac2c15f0ebc591746423fa3
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 22066 W: 4561 L: 4330 D: 13175

LTC
http://tests.stockfishchess.org/tests/view/5ac2d6500ebc591746423faf
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 25871 W: 3953 L: 3738 D: 18180

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

Ideas for future work in this area:

• tweak some more mobility areas for other piece type.
• construct a notion of global mobility for the whole piece set.
• bad bishops.

Bench: 4989125
2018-04-04 00:07:40 +02:00
Torsten Franz 06a8fd2154 Simplify ThreatBySafePawn evaluation
Simplify ThreatBySafePawn evaluation by removing the 'if (weak)' speed
optimization check from threats evaluation. This is a non functional
change as it removes just a speed optimization conditional which was
probably useful before but does no longer provide benefits. This section
section had a few more lines not long ago, with ThreatByHangingPawn and
a loop through the threatened pieces, but now there is not much left.

Passed STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 47775 W: 9696 L: 9624 D: 28455
http://tests.stockfishchess.org/tests/view/5ac298910ebc591746423f8b

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

Non functional change.
2018-04-03 23:34:10 +02:00
Joost VandeVondele e408fd7b10 Document Elo impact of various parts of search
In order to understand better the impact of various techniques used in search,
Elo estimates have been run at STC for 60000 games (statistical error ~1.8 Elo),
disabling each feature in turn. This should help future improvements and
simplifications to pick suitable targets.

The list of tests is:
step  7 : http://tests.stockfishchess.org/tests/view/5abcbb4b0ebc5902926cf1ca
step  8 : http://tests.stockfishchess.org/tests/view/5abcbb680ebc5902926cf1cc
step  9 : http://tests.stockfishchess.org/tests/view/5abcbb850ebc5902926cf1ce
step 10 : http://tests.stockfishchess.org/tests/view/5abcbbeb0ebc5902926cf1d2
step 11 : http://tests.stockfishchess.org/tests/view/5abcbbbf0ebc5902926cf1d0
step 13 : http://tests.stockfishchess.org/tests/view/5abd03680ebc5902926cf20b
step 13a: http://tests.stockfishchess.org/tests/view/5abd29660ebc5902926cf22a
step 13b: http://tests.stockfishchess.org/tests/view/5abd29820ebc5902926cf22c
step 14 : http://tests.stockfishchess.org/tests/view/5abd03860ebc5902926cf20f
step 14a: http://tests.stockfishchess.org/tests/view/5abd2b6c0ebc5902926cf230
step 14b: http://tests.stockfishchess.org/tests/view/5abd2b8d0ebc5902926cf232
step 14c: http://tests.stockfishchess.org/tests/view/5abd2bad0ebc5902926cf234
step 14d: http://tests.stockfishchess.org/tests/view/5abd2bcf0ebc5902926cf236
step 14e: http://tests.stockfishchess.org/tests/view/5abd2bf10ebc5902926cf238

This patch documents this in the code.

Note that it will be a waste to recompute these estimates often, even a couple
of [0,5] patches are unlikely to change them by more than the error bars. The
interest of the Elo annotations in the code is not in the details, but in high-
lighting trends such as razoring (2 Elo) and singular extensions (60 Elo). These
estimates should be recomputed at most once a year.

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

No functional change.
2018-04-01 03:21:45 +02:00
Stéphane Nicolet d9cac9a414 Simplify KBPKB endgame with opposite bishops
When we reach a position with only two opposite colored bishops and
one pawn on the board, current master would give it a scale factor
of 9/64=0.14 in about one position out of 7200, and a scale factor
of 0.0 in the 7199 others. The patch gives a scale factor of 0.0 in
100% of the cases.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 55845 W: 11467 L: 11410 D: 32968
http://tests.stockfishchess.org/tests/view/5abc585f0ebc5902926cf15e

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 11915 W: 1852 L: 1719 D: 8344
http://tests.stockfishchess.org/tests/view/5abc7f750ebc5902926cf18c

We also have exhaustive coverage analysis of this patch effect by
Alain Savard, comparing the perfect evaluation given by the Syzygy
tablebase with the heuristic play after this patch for the set of
all legal positions of the KBPKP endgame with opposite bishops, in
the comments thread for this pull request:
https://github.com/official-stockfish/Stockfish/pull/1520

Alain's conclusion:
> According to this definition and the data, I consider this PR is
> identical to master to "solve for draw" and slightly better than
> master to solve earlier for "wins".

Note: this patch is a side effect of an ongoing effort to improve
the evaluation of positions involving a pair of opposite bishops.
See the GitHub diff of this LTC test which almost passed at sprt[0..5]
for a discussion:
http://tests.stockfishchess.org/tests/view/5ab9030b0ebc5902932cbf93

No functional change (at small bench depths)
2018-04-01 02:19:42 +02:00
Ondrej Mosnáček c8ef80f466 Use per-thread dynamic contempt
We now use per-thread dynamic contempt. This patch has the following
effects:

 * for Threads=1: **non-functional**
 * for Threads>1:
   * with MultiPV=1: **no regression, little to no ELO gain**
   * with MultiPV>1: **clear improvement over master**

First, I tried testing at standard MultiPV=1 play with [0,5] bounds.
This yielded 2 yellow and 1 red test:

5+0.05, Threads=5:
LLR: -2.96 (-2.94,2.94) [0.00,5.00]
Total: 82689 W: 16439 L: 16190 D: 50060
http://tests.stockfishchess.org/tests/view/5aa93a5a0ebc5902952892e6

5+0.05, Threads=8:
LLR: -2.96 (-2.94,2.94) [0.00,5.00]
Total: 27164 W: 4974 L: 4983 D: 17207
http://tests.stockfishchess.org/tests/view/5ab2639b0ebc5902a6fbefd5

5+0.5, Threads=16:
LLR: -2.97 (-2.94,2.94) [0.00,5.00]
Total: 41396 W: 7127 L: 7082 D: 27187
http://tests.stockfishchess.org/tests/view/5ab124220ebc59029516cb62

Then, I tested with Skill Level=17 (implicitly MutliPV=4), showing
a clear improvement:

5+0.05, Threads=5:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 3498 W: 1316 L: 1135 D: 1047
http://tests.stockfishchess.org/tests/view/5ab4b6580ebc5902932aeca2

Next, I tested the patch with MultiPV=1 again, this time checking for
non-regression ([-3, 1]):

5+0.5, Threads=5:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 65575 W: 12786 L: 12745 D: 40044
http://tests.stockfishchess.org/tests/view/5ab4e8500ebc5902932aecb3

Finally, I ran some tests with fixed number of games, checking if
reverting dynamic contempt gains more elo with Skill Level=17 (i.e.
MultiPV) than applying the "prevScore" fix and this patch. These tests
showed, that this patch gains 15 ELO when playing with Skill Level=17:

5+0.05, Threads=3, "revert dynamic contempt" vs. "WITHOUT this patch":
ELO: -11.43 +-4.1 (95%) LOS: 0.0%
Total: 20000 W: 7085 L: 7743 D: 5172
http://tests.stockfishchess.org/tests/view/5ab636450ebc590295d88536

5+0.05, Threads=3, "revert dynamic contempt" vs. "WITH this patch":
ELO: -26.42 +-4.1 (95%) LOS: 0.0%
Total: 20000 W: 6661 L: 8179 D: 5160
http://tests.stockfishchess.org/tests/view/5ab62e680ebc590295d88524

---
***FAQ***

**Why should this be commited?**
I believe that the gain for multi-thread MultiPV search is a sufficient
justification for this otherwise neutral change. I also believe this
implementation of dynamic contempt is more logical, although this may
be just my opinion.

**Why is per-thread contempt better at MultiPV?**
A likely explanation for the gain in MultiPV mode is that during
search each thread independently switches between rootMoves and via
the shared contempt score skews each other's evaluation.

**Why were the tests done with Skill Level=17?**
This was originally suggested by @Hanamuke and the idea is that with
Skill Level Stockfish sometimes plays also moves it thinks are slightly
sub-optimal and thus the quality of all moves offered by the MultiPV
search is checked by the test.

**Why are the ELO differences so huge?**
This is most likely because of the nature of Skill Level mode --
since it slower and weaker than normal mode, bugs in evaluation have
much greater effect.

---

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

No functional change -- in single thread mode.
2018-03-30 10:48:57 +02:00
Marco Costalba 280022baf7 Fix indentation in movepicker.cpp
Fix indentation in movepicker.cpp and evaluate.cpp. Also move
the PickType enum out of global space.

No functional change
2018-03-27 16:45:12 +02:00
Jerry Donald Watson f0f6da2d30 Make kingRing always 8 squares
Make kingRing always eight squares, extending the bitboard to the
F file if the king is on the H file, and to the C file if the king
is on the A file. This may deal with cases where Stockfish (like
many other engines) would shift the king around on the back rank
like g1h1, not because there is some imminent threat, but because
it makes king safety look a little better just because the king ring
had a smaller area.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 34000 W: 7167 L: 6877 D: 19956
http://tests.stockfishchess.org/tests/view/5ab8216d0ebc5902932cbe64

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 22574 W: 3576 L: 3370 D: 15628
http://tests.stockfishchess.org/tests/view/5ab84e6a0ebc5902932cbe72

How to continue from there?

This patch probably makes it easier to tune the king safety evaluation,
because the new regularity of the king ring size will make the king
safety function more continuous.

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

Bench: 5934103
2018-03-26 09:28:37 +02:00
DU-jdto ed26d71354 Fix a few minor code style inconsistencies
No functional change.
2018-03-21 01:35:05 +01:00
Ronald de Man 759b3c79cf Mark all compile-time constants as constexpr.
To more clearly distinguish them from "const" local variables, this patch
defines compile-time local constants as constexpr. This is consistent with
the definition of PvNode as constexpr in search() and qsearch(). It also
makes the code more robust, since the compiler will now check that those
constants are indeed compile-time constants.

We can go even one step further and define all the evaluation and search
compile-time constants as constexpr.

In generate_castling() I replaced "K" with "step", since K was incorrectly
capitalised (in the Chess960 case).

In timeman.cpp I had to make the non-local constants MaxRatio and StealRatio
constepxr, since otherwise gcc would complain when calculating TMaxRatio and
TStealRatio. (Strangely, I did not have to make Is64Bit constexpr even though
it is used in ucioption.cpp in the calculation of constexpr MaxHashMB.)

I have renamed PieceCount to pieceCount in material.h, since the values of
the array are not compile-time constants.

Some compile-time constants in tbprobe.cpp were overlooked. Sides and MaxFile
are not compile-time constants, so were renamed to sides and maxFile.

Non-functional change.
2018-03-18 23:48:16 +01:00
mstembera 350dff4464 Fix an MSVC 2017 error and warnings.
Improved version by @mcostalba.

No functional change.
2018-03-16 22:37:03 +01:00
Stéphane Nicolet 96362fe3df Renaming some variables in code
Implements renaming suggestions by Marco Costalba, Günther Demetz,
Gontran Lemaire, Ronald de Man, Stéphane Nicolet, Alain Savard,
Joost VandeVondele, Jerry Donald Watson, Mike Whiteley, xoto10,
and I hope that I haven't forgotten anybody.

Perpetual renaming thread for suggestions:
https://github.com/official-stockfish/Stockfish/issues/1426

No functional change.
2018-03-15 10:44:26 +01:00
Jerry Donald Watson 840605c14e Adjust initiative in pure pawn endgames
King and pawn endgames are typically decisive, and a small
advantage is often sufficient to win. Therefore we now take
this into account when computing the initiative adjustment.

This idea came from a series of patches by Gian-Carlo Pascutto.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 48770 W: 10203 L: 9845 D: 28722
http://tests.stockfishchess.org/tests/view/5aa58cce0ebc59029780ff8d

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 22252 W: 3572 L: 3366 D: 15314
http://tests.stockfishchess.org/tests/view/5aa5b27c0ebc59029780ffad

Ideas for future developement:

- There have been a number of changes to the initiative
  calculation lately. Perhaps the coefficients could be
  tuned again.

- It may be possible to add special knowledge for other
  endgames in the initiative calculation.

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

Bench: 5750110
2018-03-12 22:57:21 +01:00
protonspring c3af52c43b Connectivity Score S(3,1) is stronger than S(2,2)
I believe my tests were conclusive enough to demonstrate
that a connectivity score of S(3,1) is stronger than S(2,2).

STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 16175 W: 3386 L: 3165 D: 9624
http://tests.stockfishchess.org/tests/view/5aa48b150ebc59029780fef6

LTC
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 98685 W: 15209 L: 14765 D: 68711
http://tests.stockfishchess.org/tests/view/5aa496f50ebc59029780fefa

Bench 5601228
2018-03-12 01:52:12 +01:00
protonspring 5dc381a566 Implement an old Russian proverb
"Loose pieces drop, in blitz keep everything protected"

Adding a small S(2,2) bonus for knights, bishops, rooks, and
queens that are "connected" to each other (in the sense that
they are under attack by our own pieces) apparently is a good
thing. It probably helps the pieces work together a bit better.

STC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 12317 W: 2655 L: 2467 D: 7195
http://tests.stockfishchess.org/tests/view/5aa2d86b0ebc590297cb6474

LTC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 35725 W: 5516 L: 5263 D: 24946
http://tests.stockfishchess.org/tests/view/5aa2fc6f0ebc590297cb64a8

How to continue from there (by Stefan Geschwentner)?

• First we should identify all other eval terms which have an overlap
  with new connectivity bonus (like the outpost bonus). A simple way
  would be subtract the connectivity bonus from them and look if this
  better, or use a SPSA session for these terms.

• Tuning Connectivity himself with SPSA seems not so promising because
  of the small range which is useful. Here manual testing changes of
  Connectivity like +-1 seems better.

• The eg value is more important because in endgame the position gets
  more open and so attacks on pieces are easier. Another important point
  is that when defending/fortress-like positions each defending piece
  needs a protection, otherwise attacks on them can break defense.

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

Bench: 5318575
2018-03-10 12:04:03 +01:00
Alain SAVARD 1093047e7d Two steps slider threats on queen
Allow a potential slider threat from a square currently occupied
by a harmless attacker, just as the recent "knight on queen" patch.
Also from not completely safe squares, use the mobilityArea instead
of excluding all pawns for both SlidersOnQueen and KnightOnQueen

We now compute the potential sliders threat on queen only if opponent
has one queen.

Run as SPRT [0,4] since it is some kind of simplification but maybe
not clearly one.

STC:
http://tests.stockfishchess.org/tests/view/5aa1ddf10ebc590297cb63d8
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 22997 W: 4817 L: 4570 D: 13610

LTC:
http://tests.stockfishchess.org/tests/view/5aa1fe6b0ebc590297cb63e5
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 11926 W: 1891 L: 1705 D: 8330

After this patch is committed, we may try to:

• re-introduce some "threat by queen" bonus to make Stockfish's queen
  more aggressive (attacking aspect)

• introduce a concept of "queen overload" to force the opponent queen
  into passivity and protecting duties (defensive aspect)

• more generally, re-tune the queen mobility array since patches in the
  last three months have affected a lot the location/activity of queens.

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

bench: 5788691
2018-03-09 21:47:44 +01:00
Stéphane Nicolet 6d8f583af2 Knight threats on Queen
We give a S(21,11) bonus for knight threats on the next moves
against enemy queen. The threats are from squares which are
"not strongly protected" and which may be empty, contain enemy
pieces or even one of our piece at the moment (N,B,Q,R) -- hence
be two-steps threats in the later case because we will have to
move our piece and *then* attack the enemy queen with the knight.

STC: http://tests.stockfishchess.org/tests/view/5a9e442e0ebc590297cb6162
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 35129 W: 7346 L: 7052 D: 20731

LTC: http://tests.stockfishchess.org/tests/view/5a9e6e620ebc590297cb617f
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 42442 W: 6695 L: 6414 D: 29333

How to continue from there?

• Trying to refine the threat condition ("not strongly protected")
• Trying the two-steps idea for bishops or rooks threats against queen

Bench: 6051247
2018-03-07 22:12:29 +01:00
Torsten Franz 56a104e2e0 Remove popcount trick from space evaluation
Similar removal of superposition code trick as in the
"Simplify tropism computation" patch. This simplification
of the space() function will allow us to specify space
masks which can reach into enemy territory.

passed STC:
LLR: 3.38 (-2.94,2.94) [-3.00,1.00]
Total: 184630 W: 40581 L: 40758 D: 103291
http://tests.stockfishchess.org/tests/view/5a8433360ebc590297cc80c5

passed LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 231799 W: 37647 L: 37858 D: 156294
http://tests.stockfishchess.org/tests/view/5a96a34a0ebc590297cc8cfd

No functional change.
2018-03-07 21:58:16 +01:00
Stéphane Nicolet de642f16db Simplify tropism computation
Simplification. Tests show that the "shift-and-superpose" trick is no longer
necessary. The speed benefit of avoiding a popcount is no longer relevant
on modern machines.

Passed STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 41675 W: 9168 L: 9086 D: 23421
http://tests.stockfishchess.org/tests/view/5a840bcc0ebc590297cc80b5

Passed LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 117728 W: 19875 L: 19911 D: 77942
http://tests.stockfishchess.org/tests/view/5a8444800ebc590297cc80ca

No functional change.
2018-02-27 19:10:40 +01:00
Stéphane Nicolet 29bc128384 No Tempo for draw scores given by heuristic functions
The current master applies Eval::Tempo even to leaves evaluated
as draw by some of the static evaluation functions of endgame.cpp
(for instance KNN vs K or stalemates in KP vs K). This results in
some lines being reported as +0.07 or -0.07 when the terminal
position has reached such endgames (0.07 being about the value
of a tempo for Stockfish).

This patch does not apply Eval::tempo to these positions. This leads
to more nodes being evaluated as VALUE_DRAW during search, giving more
opportunities for cut-offs in alpha-beta.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 52602 W: 11776 L: 11403 D: 29423
http://tests.stockfishchess.org/tests/view/5a8cb8f60ebc590297cc8546

LTC:
LLR: 2.97 (-2.94,2.94) [0.00,4.00]
Total: 156613 W: 26820 L: 26158 D: 103635
http://tests.stockfishchess.org/tests/view/5a8f452d0ebc590297cc865a

Bench: 4924749
2018-02-27 08:06:46 +01:00
Marco Costalba ad2a0e356e Speedup and simplify pinners and blockers
To compute dicovered check or pinned pieces we use some bitwise
operators that are not really needed because already accounted for
at the caller site.

For instance in evaluation we compute:

     pos.pinned_pieces(Us) & s

Where pinned_pieces() is:

     st->blockersForKing[c] & pieces(c)

So in this case the & operator with pieces(c) is useless,
given the outer '& s'.

There are many places where we can use the naked blockersForKing[]
instead of the full pinned_pieces() or discovered_check_candidates().

This path is simpler than original and gives around 1% speed up for me.
Also tested for speed by mstembera and snicolet (neutral in both cases).

No functional change.
2018-02-27 01:19:06 +01:00
Marco Costalba a09eee5798 Reformat SEE to better document the function
This is one of the most difficult to understand but also
most important and speed critical functions of SF.

This patch rewrites some part of it to hopefully
make it clearer and drop some redundant variables
in the process.

Same speed than master (or even a bit more).

Thanks to Chris Cain for useful feedback.

No functional change.
2018-02-23 22:02:44 +01:00
Stéphane Nicolet 52f92d05a9 Move pawn_attacks_bb() helper to bitboard.h
No functional change.
2018-02-21 22:31:38 +01:00
Mike Whiteley 820c5c25b6 rename shift variables.
Where variable names are explicitly incorrect, I feel morally obligated to at least
suggest an alternative. There are many, but these two are especially egregious.

No functional change.
2018-02-21 21:47:04 +01:00
Alain SAVARD 6c898a10be Avoid a compilation warning
Avoid a warning while compiling with gcc version 4.9.2

No functional change.
2018-02-21 00:52:59 +01:00
Marco Costalba 67f5f54a29 Code style in evaluate.cpp
Passed STC
LLR: 2.95 (-2.94,2.94) [-4.00,0.00]
Total: 75666 W: 16482 L: 16616 D: 42568
http://tests.stockfishchess.org/tests/view/5a8953af0ebc590297cc83ab

No functional change.
2018-02-20 17:11:18 +01:00
Mike Whiteley 80ea80e451 Simplify trapped rook
As far as can tell, semiopenFiles are set if there is a pawn anywhere on
the file. The removed condition would be true even if the pawns were very
advanced, which doesn't make sense if we're looking for a trapped rook.
Seems the engine fairs better with this removed. My guess s that the
condition that mobility is 3 or less does this well enough.

Begs the question whether this is a mobility issue alone... not sure.
Should I do LTC test?

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 13377 W: 3009 L: 2871 D: 7497
http://tests.stockfishchess.org/tests/view/5a855be40ebc590297cc8166

Passed LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 16288 W: 2813 L: 2685 D: 10790
http://tests.stockfishchess.org/tests/view/5a8575a80ebc590297cc817e

Bench: 5006365
2018-02-15 19:38:09 +01:00
Stefano Cardanobile cb1324312d Introduce dynamic contempt
Make contempt dependent on the current score of the root position.

The idea is that we now use a linear formula like the following to decide
on the contempt to use during a search :

    contempt = x + y * eval

where x is the base contempt set by the user in the "Contempt" UCI option,
and y * eval is the dynamic part which adapts itself to the estimation of
the evaluation of the root position returned by the search. In this patch,
we use x = 18 centipawns by default, and the y * eval correction can go
from -20 centipawns if the root eval is less than -2.0 pawns, up to +20
centipawns when the root eval is more than 2.0 pawns.

To summarize, the new contempt goes from -0.02 to 0.38 pawns, depending if
Stockfish is losing or winning, with an average value of 0.18 pawns by default.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 110052 W: 24614 L: 23938 D: 61500
http://tests.stockfishchess.org/tests/view/5a72e6020ebc590f2c86ea20

LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 16470 W: 2896 L: 2705 D: 10869
http://tests.stockfishchess.org/tests/view/5a76c5b90ebc5902971a9830

A second match at LTC was organised against the current master:

ELO: 1.45 +-2.9 (95%) LOS: 84.0%
Total: 19369 W: 3350 L: 3269 D: 12750
http://tests.stockfishchess.org/tests/view/5a7acf980ebc5902971a9a2e

Finally, we checked that there is no apparent problem with multithreading,
despite the fact that some threads might have a slightly different contempt
level that the main thread.

Match of this version against master, both using 5 threads, time control 30+0.3:
ELO: 2.18 +-3.2 (95%) LOS: 90.8%
Total: 14840 W: 2502 L: 2409 D: 9929
http://tests.stockfishchess.org/tests/view/5a7bf3e80ebc5902971a9aa2

Include suggestions from Marco Costalba, Aram Tumanian, Ronald de Man, etc.

Bench: 5207156
2018-02-09 19:07:19 +01:00
Stéphane Nicolet 211ebc5c7a Fix bug for 'eval' command in terminal
The 'eval' debugging command in Terminal did not initialize the Eval::Contempt
variable, leading to random output during debugging sessions (normal search
was unaffected by the bug).

Example of session where the two 'eval' commands should give the same output,
but did not:

./stockfish
position startpos
d
eval
go depth 20
d
eval

The bug is fixed by initializing Eval::Contempt to SCORE_ZERO in Eval::trace

No functional change.
2018-02-09 01:12:08 +01:00
FauziAkram 917fe69f84 A combo of 3 successful tuning patches
Shelter Weakness by Fauzi Akram Dabat
Threats by Alain Savard
Passed Pawns by Alain Savard

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 51378 W: 11592 L: 11223 D: 28563
http://tests.stockfishchess.org/tests/view/5a79e2fe0ebc5902971a99d1

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 21631 W: 3888 L: 3661 D: 14082
http://tests.stockfishchess.org/tests/view/5a7aefe80ebc5902971a9a39

Bench: 4983414
2018-02-08 15:14:02 +01:00
Stéphane Nicolet 0f6f42cd83 Improved spelling, grammar and comment
Author: Ben Koshy

No functional change
2018-02-04 00:13:56 +01:00
Rocky640 0a5b03af3f Limit the king distance factor when evaluating passed pawns (#1373)
Limit the king distance factor when evaluating passed pawns
Passed STC
http://tests.stockfishchess.org/tests/view/5a6bf7290ebc590d945d5a3a
LLR: 3.31 (-2.94,2.94) [0.00,5.00]
Total: 23987 W: 5550 L: 5281 D: 13156

and LTC
http://tests.stockfishchess.org/tests/view/5a6c57710ebc590297c36af2
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 16926 W: 3014 L: 2820 D: 11092

Bench: 5059457
2018-01-28 14:56:45 +01:00
Marco Costalba b508f9561c
Fix bench number
Incorrect bench number in master. Fix it.

bench: 4971497
2018-01-13 09:21:23 +01:00
mbootsector 33682bfb98 Use mobility in kingsafety (#1360)
Use mobility in kingsafety

STC: http://tests.stockfishchess.org/tests/view/5a55134d0ebc590296938a28
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 32651 W: 6057 L: 5792 D: 20802

LTC: http://tests.stockfishchess.org/tests/view/5a5618f40ebc590297da516f
LLR: 2.94 (-2.94,2.94) [0.00,5.00]
Total: 17875 W: 2421 L: 2245 D: 13209

bench: 5365777
2018-01-13 08:56:42 +01:00
hxim 66ce8ad5fd Remove ThreatByHangingPawn bonus (#1356)
* no ThreatByHangingPawn

* bench: 4919682
2018-01-04 22:31:30 +01:00
Joost VandeVondele 9afa1d7330 New Year 2018
Adjust copyright headers.

No functional change.
2018-01-01 13:18:10 +01:00
Guenther Demetz 7d4d3a2c3a Include x-ray attacks through all queens independently of the color.
When calculating attacks from rooks/bishops current master includes
x-rays through own queen. This patch includes also x-rays through
opponent queen.

Credits go to Brian who inspired for this idea
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/Z3APRYpQeMU

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 41549 W: 7544 L: 7244 D: 26761
Elo	2.05 [-0.29,4.19] (95%)
http://tests.stockfishchess.org/tests/view/5a3b5fe50ebc590ccbb8bf9a

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 110010 W: 14208 L: 13739 D: 82063
Elo	1.20 [-0.27,2.55] (95%)
http://tests.stockfishchess.org/tests/view/5a3b8e7c0ebc590ccbb8bfad

bench: 5544445
2017-12-26 10:42:24 +01:00
Joost VandeVondele f6981b1321 Make staticEval independent of the search path
Current master can yield different staticEvals depending on the path
used to reach the position. The reason for this is that the evaluation after a
null move is always computed subtracting 2 * Eval::Tempo, while this is not
the case for lazy or specialized evals. This patch always adds tempo to evals,
which doesn't affect playing strength:

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 59911 W: 7616 L: 7545 D: 44750

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 104947 W: 18897 L: 18919 D: 67131

Fixes issue #1335

Bench: 5208264
2017-12-17 09:11:55 +01:00
Rocky640 be6fafd079 Simplify other checks (#1337)
Replace an intricate definition with a more natural one.

Master was excluding squares occupied by a pawn which was blocked by a pawn.
This version excludes any squares occupied by a pawn which is blocked by "something"

Passed STC
http://tests.stockfishchess.org/tests/view/5a2f557b0ebc590ccbb8bc0d
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 44211 W: 8009 L: 7928 D: 28274

and LTC
http://tests.stockfishchess.org/tests/view/5a301d440ebc590ccbb8bc80
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 31958 W: 4108 L: 4002 D: 23848

Bench 5000136
2017-12-17 08:50:45 +01:00
Alain SAVARD 020dd69a35 Simplify other checks #1334
Simplify the other check penalty computation. Compared to current master,

a) it uses a 143 kingDanger penalty instead of S(10, 10) for the "otherCheck"
(credits to ElbertoOne for finding a suitable kingDanger range to replace the score
and to Guardian for showing this could also be a neutral change at LTC).
This makes our king safety model more consistent and simpler.

b) it might also score more than one "otherCheck" penalty for a given piece type instead of just one

c) it might score many pinned penalties instead of just one.

d) It also remove 3 conditionals and uses simpler expressions.
So it was tested as a SPRT[-3, 1]

Passed STC
http://tests.stockfishchess.org/tests/view/5a2b560b0ebc590ccbb8ba6b
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 11705 W: 2217 L: 2080 D: 7408

And LTC
http://tests.stockfishchess.org/tests/view/5a2bfd0d0ebc590ccbb8bab0
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 26812 W: 3575 L: 3463 D: 19774

Trying to improve on b) another attempt was made to score also the
"otherchecks" for piece types which had some safe checks, but this
failed STC http://tests.stockfishchess.org/tests/view/5a2c79e60ebc590ccbb8badd

bench: 5149133
2017-12-11 15:27:44 +01:00