1
0
Fork 0
Commit Graph

5384 Commits (riscv64-cartesi)

Author SHA1 Message Date
Stéphane Nicolet b862c8d4be Small clean-up
Bench: 4321677
2021-03-31 08:12:25 +02:00
bmc4 c489df6f5b Simplify King Evasion
Simplify away the removal of some illegal `KING`-evasion moves during move
generation. Verified for correctness by running perft on the following positions:

```
./stockfish
bench 16 1 6 default perft
Nodes searched: 71608931810

./stockfish
position fen 4rrk1/1p1nq3/p7/2p1P1pp/3P2bp/3Q1Bn1/PPPB4/1K2R1NR w - - 40 21
go perft 6
Nodes searched: 6136386434
```

Passed STC:
LLR: 2.94 (-2.94,2.94) {-1.00,0.20}
Total: 16072 W: 1473 L: 1349 D: 13250
Ptnml(0-2): 57, 1047, 5710, 1159, 63
https://tests.stockfishchess.org/tests/view/60629e7ef183b42957b423b1

Passed LTC:
LLR: 2.94 (-2.94,2.94) {-0.70,0.20}
Total: 59064 W: 2214 L: 2177 D: 54673
Ptnml(0-2): 26, 1944, 25556, 1979, 27
https://tests.stockfishchess.org/tests/view/6062dce4f183b42957b423de

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

No functional change
2021-03-31 07:47:15 +02:00
mstembera 62a0b65ff8 Simplify and unify FRC cornered bishop.
tested locally as fishtest doesn't support FRC:

STC NNUE
9646 - 9647 - 20707 [0.500] 40000 -0.0 +/- 2.4, LOS: 49.7 %, DrawRatio: 51.8 %

STC classical
9678 - 9609 - 20713 [0.501] 40000 0.6 +/- 2.4, LOS: 69.0 %, DrawRatio: 51.8 %

and verified independently:

Score of master vs patch: 6463 - 6580 - 34957 [0.499] 48000

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

bench: 4321677
2021-03-27 17:03:10 +01:00
Tomasz Sobczyk f28303d214 Allow using Intel SDE for PGO builds.
The software development emulator (SDE) allows to run binaries compiled
for architectures not supported by the actual CPU. This is useful to
do PGO builds for newer architectures. The SDE can currently be obtained from
https://software.intel.com/content/www/us/en/develop/articles/intel-software-development-emulator.html

This patch introduces a new optional makefile argument SDE_PATH.
If not empty it should contain the path to the sde executable

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

No functional change.
2021-03-27 16:56:05 +01:00
Stéphane Nicolet 83eac08e75 Small cleanups (march 2021)
With help of @BM123499, @mstembera, @gvreuls, @noobpwnftw and @Fanael
Thanks!

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

No functional change
2021-03-24 17:11:06 +01:00
Guy Vreuls ec42154ef2 Use reference instead of pointer for pop_lsb() signature
This patch changes the pop_lsb() signature from Square pop_lsb(Bitboard*) to
Square pop_lsb(Bitboard&). This is more idomatic for C++ style signatures.

Passed a non-regression STC test:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 21280 W: 1928 L: 1847 D: 17505
Ptnml(0-2): 71, 1427, 7558, 1518, 66
https://tests.stockfishchess.org/tests/view/6053a1e22433018de7a38e2f

We have verified that the generated binary is identical on gcc-10.

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

No functional change.
2021-03-19 20:28:57 +01:00
Vizvezdenec ace9632c67 Add a specific FRC correction from classical to NNUE
our net currently is not trained on FRC games, and so doesn't know about the important pattern of a bishop that is cornered in FRC.
This patch introduces a term we have in the classical evaluation for this case, and adds it to the NNUE eval.

Since fishtest doesn't support FRC right now, the patch was tested locally at STC conditions,
starting from the book of FRC starting positions.

Score of master vs patch: 993 - 2226 - 6781  [0.438] 10000

Which corresponds to approximately 40 Elo

The patch passes non-regression testing for traditional chess (where it adds one branch).

passed STC:
https://tests.stockfishchess.org/tests/view/604fa2532433018de7a38b67
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 30560 W: 2701 L: 2636 D: 25223
Ptnml(0-2): 88, 2056, 10921, 2133, 82

passed STC also in an earlier version:
https://tests.stockfishchess.org/tests/view/604f61282433018de7a38b4d

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

No functional change
2021-03-19 11:58:17 +01:00
bmc4 5089061659 Change definition of between_bb()
We remark that in current master, most of our use cases for between_bb() can be
optimized if the second parameter of the function is added to the segment. So we
change the definition of between_bb(s1, s2) such that it excludes s1 but includes s2.

We also use a precomputed array for between_bb() for another small speed gain
(see https://tests.stockfishchess.org/tests/view/604d09f72433018de7a389fb).

Passed STC:
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 18736 W: 1746 L: 1607 D: 15383
Ptnml(0-2): 61, 1226, 6644, 1387, 50
https://tests.stockfishchess.org/tests/view/60428c84ddcba5f0627bb6e4

Yellow LTC:
LTC:
LLR: -3.00 (-2.94,2.94) {0.25,1.25}
Total: 39144 W: 1431 L: 1413 D: 36300
Ptnml(0-2): 13, 1176, 17184, 1178, 21
https://tests.stockfishchess.org/tests/view/605128702433018de7a38ca1

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

---------

Verified for correctness by running perft on the following position:

./stockfish
position fen 4rrk1/1p1nq3/p7/2p1P1pp/3P2bp/3Q1Bn1/PPPB4/1K2R1NR w - - 40 21
go perft 6

Nodes searched: 6136386434

--------

No functional change
2021-03-18 00:21:41 +01:00
Vizvezdenec d58e83695f Remove advanced_pawn_push()
Continuation of work by @topologist: we now do futility pruning and movecount
pruning in qsearch() for pawn pushes up to the 7th rank. So the condition to
avoid the pruning is if the move is a promotion or not. This allows to get rid
of the advanced_pawn_push() function in position.h alltogether.

Passed STC
https://tests.stockfishchess.org/tests/view/6048c5842433018de7a387e6
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 34424 W: 3081 L: 3015 D: 28328
Ptnml(0-2): 110, 2442, 12052, 2488, 120

Passed LTC
https://tests.stockfishchess.org/tests/view/6048f7d22433018de7a387f0
LLR: 2.94 (-2.94,2.94) {-0.75,0.25}
Total: 142024 W: 5170 L: 5202 D: 131652
Ptnml(0-2): 50, 4678, 61613, 4596, 75

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

Bench: 4339126
2021-03-17 10:34:02 +01:00
bmc4 830f597134 Simplify move generation (2/2)
STC:
LLR: 2.97 (-2.94,2.94) {-1.25,0.25}
Total: 39352 W: 3551 L: 3493 D: 32308
Ptnml(0-2): 143, 2695, 13928, 2781, 129
https://tests.stockfishchess.org/tests/view/6050007a2433018de7a38bbb

LTC:
LLR: 2.96 (-2.94,2.94) {-0.75,0.25}
Total: 44944 W: 1629 L: 1596 D: 41719
Ptnml(0-2): 22, 1319, 19762, 1342, 27
https://tests.stockfishchess.org/tests/view/60500e892433018de7a38bc4

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

No functional change
2021-03-16 22:34:23 +01:00
bmc4 4b509559fb Simplify move generation (1/2)
STC:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 29792 W: 2611 L: 2545 D: 24636
Ptnml(0-2): 94, 1982, 10659, 2086, 75
https://tests.stockfishchess.org/tests/view/604fe5b62433018de7a38ba8

LTC:
LLR: 2.92 (-2.94,2.94) {-0.75,0.25}
Total: 22040 W: 826 L: 777 D: 20437
Ptnml(0-2): 8, 646, 9664, 693, 9
https://tests.stockfishchess.org/tests/view/604fec892433018de7a38bac

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

No functional change
2021-03-16 22:32:53 +01:00
bmc4 939395729c Introduce least_significant_square_bb()
Introducing least_significant_square_bb(). It is a function that returns a value equal
to square_bb(lsb(bb)), but it uses fewer instruction. It should speed up more on older
processors like armv7-a Clang.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 213200 W: 19171 L: 18753 D: 175276
Ptnml(0-2): 680, 14513, 75831, 14861, 715
https://tests.stockfishchess.org/tests/view/604bc7632433018de7a38982

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

No functional change
2021-03-16 20:54:52 +01:00
Topologist f3b296c2e2 Change advanced pawn push threshold
A pawn push is now considered to be "advanced" if the relative destination
rank is > 6 (previously it was > 5). This affects the search heuristic.

Also remove an assert concerning en passant moves in qsearch().

STC:
LLR: 2.97 (-2.94,2.94) {-0.25,1.25}
Total: 46744 W: 4224 L: 4040 D: 38480
Ptnml(0-2): 165, 3206, 16451, 3380, 170
https://tests.stockfishchess.org/tests/view/604746082433018de7a3872e

LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 107840 W: 4198 L: 3892 D: 99750
Ptnml(0-2): 58, 3472, 46557, 3772, 61
https://tests.stockfishchess.org/tests/view/60475eae2433018de7a38737

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

Bench: 4796780
2021-03-10 12:32:53 +01:00
bmc4 b74274628c Use Bitboard over Square in movegen
It uses pos.checkers() on target when movegen is the type of EVASION.
It simplify the code. And it's also expected a slightly speed up,
because Bitboard is more direct when doing bitwise.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 28176 W: 2506 L: 2437 D: 23233
Ptnml(0-2): 80, 1904, 10063, 1949, 92
https://tests.stockfishchess.org/tests/view/60421d18ddcba5f0627bb6a9

Passed LTC:
LLR: 2.93 (-2.94,2.94) {-0.75,0.25}
Total: 9704 W: 402 L: 341 D: 8961
Ptnml(0-2): 3, 279, 4230, 334, 6
https://tests.stockfishchess.org/tests/view/60422823ddcba5f0627bb6ae

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

No functional change
2021-03-07 21:16:38 +01:00
mattginsberg 5346f1c6c7 Deal with commented lines in UCI input
commands starting with '#' as the first character will be ignored

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

No functional change
2021-03-07 21:10:04 +01:00
noobpwnftw d4b864ff12 Do not try to use large pages on 32 bit Windows.
verified to work on windows XP.

fixes  #3379

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

No functional change.
2021-03-07 20:02:11 +01:00
Dieter Dobbelaere 7ffae17f85 Add Stockfish namespace.
fixes #3350 and is a small cleanup that might make it easier to use SF
in separate projects, like a NNUE trainer or similar.

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

No functional change.
2021-03-07 14:26:54 +01:00
Antoine Champion 9b1274aba3 Clean functions returning by const values
The codebase contains multiple functions returning by const-value.
This patch is a small cleanup making those function returns
by value instead, removing the const specifier.

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

No functional change
2021-03-07 14:05:01 +01:00
Stéphane Nicolet 0f3f5d85fb Introduce DistanceFromPV
We introduce a metric for each internal node in search, called DistanceFromPV.
This distance indicated how far the current node is from the principal variation.

We then use this distance to search the nodes which are close to the PV a little
deeper (up to 4 plies deeper than the PV): this improves the quality of the search
at these nodes and bring better updates for the PV during search.

STC:
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 54936 W: 5047 L: 4850 D: 45039
Ptnml(0-2): 183, 3907, 19075, 4136, 167
https://tests.stockfishchess.org/tests/view/6037b88e7f517a561bc4a392

LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 49608 W: 1880 L: 1703 D: 46025
Ptnml(0-2): 22, 1514, 21555, 1691, 22
https://tests.stockfishchess.org/tests/view/6038271b7f517a561bc4a3cb

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

Bench: 5037279
2021-02-26 19:45:29 +01:00
Vizvezdenec 7c30091a92 Introduce ProbCut for check evasions
The idea of this patch can be described as follows: if we are in check
and the transposition table move is a capture that returns a value
far above beta, we can assume that the opponent just blundered a piece
by giving check, and we return the transposition table value. This is
similar to the usual probCut logic for quiet moves, but with a different
threshold.

Passed STC
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 33440 W: 3056 L: 2891 D: 27493
Ptnml(0-2): 110, 2338, 11672, 2477, 123
https://tests.stockfishchess.org/tests/view/602cd1087f517a561bc49bda

Passed LTC
LLR: 2.98 (-2.94,2.94) {0.25,1.25}
Total: 10072 W: 401 L: 309 D: 9362
Ptnml(0-2): 2, 288, 4365, 378, 3
https://tests.stockfishchess.org/tests/view/602ceea57f517a561bc49bf0

The committed version has an additional fix to never return unproven wins
in the tablebase range or the mate range. This fix passed tests for non-
regression at STC and LTC:

STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 26240 W: 2354 L: 2280 D: 21606
Ptnml(0-2): 85, 1763, 9372, 1793, 107
https://tests.stockfishchess.org/tests/view/602d86a87f517a561bc49c7a

LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 35304 W: 1299 L: 1256 D: 32749
Ptnml(0-2): 14, 1095, 15395, 1130, 18
https://tests.stockfishchess.org/tests/view/602d98d17f517a561bc49c83

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

Bench: 3830215
2021-02-20 22:49:39 +01:00
Vizvezdenec 6294db7514 Tune search parameters (with Unai Corzo)
The values used in this patch are taken from a SPSA parameter tuning session
originated by Unai Corzo (@unaiic), but the final difference of his tune was
multiplied x2 by hand. Most of the credits should go to him :-)

STC:
https://tests.stockfishchess.org/tests/view/602f03d07f517a561bc49d40
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 67664 W: 6252 L: 6035 D: 55377
Ptnml(0-2): 256, 4799, 23527, 4972, 278

LTC:
https://tests.stockfishchess.org/tests/view/602f41697f517a561bc49d5a
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 26256 W: 1034 L: 906 D: 24316
Ptnml(0-2): 10, 804, 11377, 922, 15

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

Bench: 3957653
2021-02-20 22:22:07 +01:00
Stéphane Nicolet a31007c9e7 Restore development version
No functional change
2021-02-20 22:19:14 +01:00
Joost VandeVondele 3597f1942e Stockfish 13
Official release version of Stockfish 13

Bench: 3766422

-----

It is our pleasure to release Stockfish 13 to chess fans worldwide.
As usual, downloads are freely available at

https://stockfishchess.org

The Stockfish project builds on a thriving community of enthusiasts
who contribute their expertise, time, and resources to build a free
and open-source chess engine that is robust, widely available, and
very strong. We would like to thank them all!

The good news first: from now on, our users can expect more frequent
high-quality releases of Stockfish! Sadly, this decision has been
triggered by the start of sales of the Fat Fritz 2 engine by ChessBase,
which is a copy of a very recent development version of Stockfish
with minor modifications. We refer to our statement on Fat Fritz 2[1]
and a community blog[2] for further information.

This version of Stockfish is significantly stronger than any of its
predecessors. Stockfish 13 outperforms Stockfish 12 by at least
35 Elo[3]. When playing against a one-year-old Stockfish, it wins 60
times more game pairs than it loses[4]. This release features an NNUE
network retrained on billions of positions, much faster network
evaluation code, and significantly improved search heuristics, as
well as additional evaluation tweaks. In the course of its development,
this version has won the superfinals of the TCEC Season 19 and
TCEC Season 20.

Going forward, the Leela Chess Zero and Stockfish teams will join
forces to demonstrate our commitment to open source chess engines and
training tools, and open data. We are convinced that our free and
open-source chess engines serve the chess community very well.

Stay safe and enjoy chess!

The Stockfish team
[1] https://blog.stockfishchess.org/post/643239805544792064/statement-on-fat-fritz-2
[2] https://lichess.org/blog/YCvy7xMAACIA8007/fat-fritz-2-is-a-rip-off
[3] https://tests.stockfishchess.org/tests/view/602bcccf7f517a561bc49b11
[4] https://tests.stockfishchess.org/tests/view/600fbb9c735dd7f0f0352d59
2021-02-18 22:14:55 +01:00
Stéphane Nicolet 9f6d69c544 Update README.md
• reorder some sections of the README file
• add reference to the AUTHORS file
• rename Syzygybases to Syzygy tablebases
• add pointer to the Discord channel
• more precise info about the GPLv3 licence

No functional change
2021-02-16 16:40:54 +01:00
Lolligerhans 40cb0f076a Small trivial clean-ups, February 2021
Closes https://github.com/official-stockfish/Stockfish/pull/3329

No functional change
2021-02-16 01:31:42 +01:00
Stéphane Nicolet b46813f9b7 Update Top CPU Contributors
No functional change
2021-02-15 23:58:03 +01:00
Vizvezdenec 76daa88cf8 PV-Nodes likely to fail low
Do not decrease reduction at pv-nodes which are likely to fail low.

The idea of this patch can be described as following: during the search, if a node
on the principal variation was re-searched in non-pv search and this re-search got
a value which was much lower than alpha, then we can assume that this pv-node is
likely to fail low again, and we can reduce more aggressively at this node.

Passed STC
https://tests.stockfishchess.org/tests/view/6023a5fa7f517a561bc49638
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 70288 W: 6443 L: 6223 D: 57622
Ptnml(0-2): 239, 5022, 24436, 5174, 273

Passed LTC
https://tests.stockfishchess.org/tests/view/6023f2617f517a561bc49661
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 105656 W: 4048 L: 3748 D: 97860
Ptnml(0-2): 67, 3312, 45761, 3630, 58

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

Bench: 3766422
2021-02-11 23:39:06 +01:00
mattginsberg 573f0e364f Better code for hash table generation
This patch removes some magic numbers in TT bit management and introduce proper
constants in the code, to improve documentation and ease further modifications.

No function change
2021-02-11 22:29:35 +01:00
Gian-Carlo Pascutto 550fed3343 Enable New Pass Manager for Clang.
It's about 1% speedup for Stockfish.

Result of 100 runs
==================
base (...fish_clang12) =    1946851  +/- 3717
test (./stockfish    ) =    1967276  +/- 3408
diff                   =     +20425  +/- 2438

speedup        = +0.0105
P(speedup > 0) =  1.0000

Thanks to David Major for making me aware of this part
of LLVM development.

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

No functional change
2021-02-10 19:54:26 +01:00
Gian-Carlo Pascutto b15e3b3fa9 Disable ThinLTO when using Clang.
Benchmarking with current Clang 12 shows that
and ThinLTO is a pessimization, see issue #3341.

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

No functional change.
2021-02-10 19:52:20 +01:00
Andy Pilate 1f87a9eb6c Fixes FreeBSD compilation when using Clang
closes https://github.com/official-stockfish/Stockfish/pull/3342

No functional change
2021-02-10 19:50:44 +01:00
bmc4 29ed22de8c Search Parameters Tuning
A simple tuning on search.cpp.

based SPSA test:
https://tests.stockfishchess.org/tests/view/601f2a787f517a561bc493cd

passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 117840 W: 10796 L: 10508 D: 96536
Ptnml(0-2): 422, 8381, 41041, 8639, 437
https://tests.stockfishchess.org/tests/view/602144c37f517a561bc494ae

passed LTC:
LLR: 2.96 (-2.94,2.94) {0.25,1.25}
Total: 25024 W: 972 L: 847 D: 23205
Ptnml(0-2): 7, 767, 10847, 876, 15
https://tests.stockfishchess.org/tests/view/602156877f517a561bc494be

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

Bench: 3974098
2021-02-08 21:42:03 +01:00
FauziAkram 5ebdc40f83 Pawns Tuning
A simple tuning of Pawns parameters, and some PSQT changes.

Passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 219424 W: 43681 L: 43103 D: 132640
Ptnml(0-2): 4014, 25760, 49669, 26172, 4097
https://tests.stockfishchess.org/tests/view/601bce167f517a561bc491eb

Passed LTC:
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 317312 W: 42525 L: 41579 D: 233208
Ptnml(0-2): 2447, 30157, 92636, 30835, 2581
https://tests.stockfishchess.org/tests/view/601c21557f517a561bc49227

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

Bench: 4154473
2021-02-08 21:39:30 +01:00
bmc4 9f8058bd26 Simplify En Passant
simplifies the handling of en passant during search, needs a little more care in initialization.

Passed STC:
LLR: 2.95 (-2.94,2.94) {-1.25,0.25}
Total: 72608 W: 6569 L: 6559 D: 59480
Ptnml(0-2): 233, 5117, 25629, 5057, 268
https://tests.stockfishchess.org/tests/view/600f1363735dd7f0f0352ce7

Passed LTC:
LLR: 2.92 (-2.94,2.94) {-0.75,0.25}
Total: 24328 W: 913 L: 864 D: 22551
Ptnml(0-2): 10, 731, 10633, 780, 10
https://tests.stockfishchess.org/tests/view/600f2e93735dd7f0f0352cf6

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

No functional change.
2021-02-08 21:35:59 +01:00
bmc4 6617ad6e03 Tune ordering of moves at internal nodes
We change the relative weights of the function used to order
quiet moves in our MovePicker class.

Passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 32184 W: 2936 L: 2773 D: 26475
Ptnml(0-2): 115, 2196, 11328, 2317, 136
https://tests.stockfishchess.org/tests/view/60161ee1735dd7f0f03530f8

Passed LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.25}
Total: 33088 W: 1292 L: 1149 D: 30647
Ptnml(0-2): 14, 1030, 14318, 1163, 19
https://tests.stockfishchess.org/tests/view/60163146735dd7f0f03530ff

The new weight were chosen after the following SPSA session:
https://tests.stockfishchess.org/tests/view/60136857735dd7f0f0352f6c

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

Bench: 4398803
2021-01-31 16:00:06 +01:00
bmc4 dd96095214 Simplify Chess 960 castling
a little cleanup, and small speedup (about 0.3%) for Chess 960.

Verified with perft on a large set of chess960 positions.

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

No functional change
2021-01-31 10:07:02 +01:00
bmc4 0db374777e Speed Up Perft Search
It speeds up generate<LEGAL>, and thus perft, roughly by 2-3%.

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

No functional change
2021-01-31 10:04:41 +01:00
bmc4 befbcffb4e Clean Up Castling in gives_check
There is no need to add rto or kto on the Bitboard which represents the pieces.

STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 57064 W: 5096 L: 5067 D: 46901
Ptnml(0-2): 202, 3862, 20355, 3931, 182
https://tests.stockfishchess.org/tests/view/6005ea2c6019e097de3efa55

LTC:
LLR: 2.92 (-2.94,2.94) {-0.75,0.25}
Total: 30088 W: 1094 L: 1052 D: 27942
Ptnml(0-2): 10, 882, 13217, 926, 9
https://tests.stockfishchess.org/tests/view/6006115a6019e097de3efa6e

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

No functional change.
2021-01-31 10:02:10 +01:00
bmc4 7d0a16e06d Avoid more expensive legality check
speedup of the code, enough to pass STC, failed LTC.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 68928 W: 6334 L: 6122 D: 56472
Ptnml(0-2): 233, 4701, 24369, 4943, 218
https://tests.stockfishchess.org/tests/view/6002747f6019e097de3ef8dc

Failed LTC:
LLR: -2.96 (-2.94,2.94) {0.25,1.25}
Total: 44560 W: 1702 L: 1675 D: 41183
Ptnml(0-2): 25, 1383, 19438, 1408, 26
https://tests.stockfishchess.org/tests/view/6002a4836019e097de3ef8e3

About 1% speedup:

Result of  50 runs
==================
base (...kfish.master) =    2237500  +/- 7428
test (...ckfish.patch) =    2267003  +/- 7017
diff                   =     +29503  +/- 4774

speedup        = +0.0132
P(speedup > 0) =  1.0000

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

No functional change.
2021-01-31 10:00:17 +01:00
Lolligerhans 70a818cbd6 Small cleanups
closes https://github.com/official-stockfish/Stockfish/pull/3301

No functional change
2021-01-30 13:27:31 +01:00
Stéphane Nicolet 1188141aa7 Improve play for closed positions
This patch give a small bonus to incite the attacking side to keep more
pawns on the board.

A consequence of this bonus is that Stockfish will tend to play positions
slightly more closed on average than master, especially when it believes
that it has an advantage.

To lower the risk of blockades where Stockfish start shuffling without
progress, we also implement a progressive decrease of the evaluation
value with the 50 moves counter (along with the necessary aging of the
transposition table to reduce the impact of the Graph History Interaction
problem): since the evaluation decreases during shuffling phases, the
engine will tend to examine the consequences of pawn breaks faster during
the search.

Passed STC:
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 26184 W: 2406 L: 2252 D: 21526
Ptnml(0-2): 85, 1784, 9223, 1892, 108
https://tests.stockfishchess.org/tests/view/600cc08b735dd7f0f0352c06

Passed LCT:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 199768 W: 7695 L: 7191 D: 184882
Ptnml(0-2): 85, 6478, 86269, 6952, 100
https://tests.stockfishchess.org/tests/view/600ccd28735dd7f0f0352c10

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

Bench: 3988915
2021-01-30 13:20:56 +01:00
Rod Johnson b7f643fe39 Add .gitignore
add files produced during the build to a newly added .gitignore

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

No functional change
2021-01-30 13:19:20 +01:00
Krystian Kuzniarek 329ef2a6aa Change lock type
No additional features of std::unique_lock has been previously used
so it's better to use a lighter lock.

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

No functional change.
2021-01-30 12:57:27 +01:00
Lolligerhans 77eeea407c Add penalty for doubled pawns in agile structure
Give an additional penalty of S(20, 10) for any doubled pawn if none of
the opponent's pawns is facing any of our
 - pawns or
 - pawn attacks;
that means, each of their pawns can push at least one square without
being captured.
This ignores their non-pawns pieces and attacks.

One possible justification: Their pawns' ability to push freely provides
options to react to our threats by changing their pawn structure. Our
doubled pawns however will likely lead to an exploitable weakness, even
if the pawn structure is not yet fixed.

Note that the notion of "their pawns not being fixed" is symmetric for
both players: If all of their pawns can push freely so can ours. All
pawns being freely pushable might just be an early-game-indicator.
However, it can trigger during endgame pawns races, where doubled pawns
are especially hindering, too.

LTC
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 134976 W: 17964 L: 17415 D: 99597
Ptnml(0-2): 998, 12702, 39619, 13091, 1078
https://tests.stockfishchess.org/tests/view/5ffdd5316019e097de3ef281

STC
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 35640 W: 7219 L: 6904 D: 21517
Ptnml(0-2): 645, 4096, 8084, 4289, 706
https://tests.stockfishchess.org/tests/view/5ffda4a16019e097de3ef265

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

Bench: 4363873
2021-01-17 09:35:59 +01:00
Tomasz Sobczyk 6dddcecb09 Optimize generate_moves
This change simplifies control flow in the generate_moves function which ensures the compiler doesn't duplicate work due to possibly not resolving pureness of the function calls. Also the biggest change is the removal of the unnecessary condition checking for empty b in a convoluted way. The rationale for removal of this condition is that computing attacks_bb with occupancy is not much more costly than computing pseudo attacks and overall the condition (also being likely unpredictable) is a pessimisation.

This is inspired by previous changes by @BM123499.

Passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 88040 W: 8172 L: 7931 D: 71937
Ptnml(0-2): 285, 6128, 30957, 6361, 289
https://tests.stockfishchess.org/tests/view/5ffc28386019e097de3ef1c7

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

No functional change.
2021-01-13 22:59:54 +01:00
FauziAkram ee3f7b6b6e Bad Outpost Pawn Scale
Changed name from Bad Outpost to Uncontested Outpost
Scale Uncontested Outpost with number of pawns + Decrease Bishop PSQT values and general tuning

Credits for the decrease of the Bishop PSQT values: Fauzi
Credits for scaling Uncontested Outpost with number of pawns: Lolligerhans
Credits for the tunings: Fauzi

Passed STC:
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 32040 W: 6593 L: 6281 D: 19166
Ptnml(0-2): 596, 3713, 7095, 4015, 601
https://tests.stockfishchess.org/tests/view/5ffa43026019e097de3ef0f2

Passed LTC:
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 84376 W: 11395 L: 10950 D: 62031
Ptnml(0-2): 652, 7930, 24623, 8287, 696
https://tests.stockfishchess.org/tests/view/5ffa6e7b6019e097de3ef0fd

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

Bench: 4287509
2021-01-11 19:42:31 +01:00
Vizvezdenec 37c2b5685e Refine stat based reductions
This patch separates stat based reductions for quiet moves in case of being in check and in case of not being in check.
We will be using sum of first continuation history and main history (similar to movepicker) instead of statScore for the first case.

passed STC
https://tests.stockfishchess.org/tests/view/5ff87b2f6019e097de3ef09b
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 63992 W: 5887 L: 5678 D: 52427
Ptnml(0-2): 201, 4561, 22305, 4686, 243

passed LTC
https://tests.stockfishchess.org/tests/view/5ff8b6206019e097de3ef0b2
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 81216 W: 3127 L: 2880 D: 75209
Ptnml(0-2): 46, 2544, 35176, 2801, 41

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

bench 4395984
2021-01-11 19:36:07 +01:00
BM123499 5f222f1d98 Rethink En Passant Evasion Capture
It now checks if it were a discovery attack instead of the attacking piece is the double-moved pawn.

As a side effect, certain illegal fens have different, and slightly more logical move generation.
There is no intend to maintain particular behavior for such non-reachable fens.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 47912 W: 4327 L: 4285 D: 39300
Ptnml(0-2): 144, 3312, 17012, 3334, 154
https://tests.stockfishchess.org/tests/view/5ff890946019e097de3ef0a5

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

closes / fixes https://github.com/official-stockfish/Stockfish/issues/3270

No functional change
2021-01-11 19:31:22 +01:00
Dieter Dobbelaere 0266e70297 Fix static_assert.
With a hard-coded true, this declaration has no effect.

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

No functional change.
2021-01-11 19:23:05 +01:00
Dieter Dobbelaere 87586b3d0c Use correct chess terms + fix spelling.
- "discovered check" (instead of "discovery check")
  - "en passant" (instead of "en-passant")
  - "pseudo-legal" before a noun (instead of "pseudo legal")
  - "3-fold" (instead of "3fold")

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

No functional change.
2021-01-11 19:19:39 +01:00