]> git.sesse.net Git - stockfish/log
stockfish
22 months agoExtend all moves at low depth if ttMove is doubly extended
Alfredo Menezes [Fri, 9 Dec 2022 15:11:43 +0000 (12:11 -0300)]
Extend all moves at low depth if ttMove is doubly extended

If ttMove is doubly extended, we allow a depth growth of the remaining moves.
The idea is to get a more realistic score comparison, because of the depth
difference. We take some care to avoid this extension for high depths,
in order to avoid the cost, since the search result is supposed
to be more accurate in this case.

This pull request includes some small cleanups.

STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 60256 W: 16189 L: 15848 D: 28219
Ptnml(0-2): 182, 6546, 16330, 6889, 181
https://tests.stockfishchess.org/tests/view/639109a1792a529ae8f27777

LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 106232 W: 28487 L: 28053 D: 49692
Ptnml(0-2): 46, 10224, 32145, 10652, 49
https://tests.stockfishchess.org/tests/view/63914cba792a529ae8f282ee

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

Bench: 3622368

22 months agoGitHub Action: upload ARM artifacts
ppigazzini [Thu, 8 Dec 2022 19:50:32 +0000 (20:50 +0100)]
GitHub Action: upload ARM artifacts

And some clean up in other files.

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

No functional change

22 months agoInvoke .depend only on build targets
MinetaS [Tue, 6 Dec 2022 12:32:42 +0000 (21:32 +0900)]
Invoke .depend only on build targets

Add a constraint so that the dependency build only occurs when users
actually run build tasks.

This fixes a bug on some systems where gcc/g++ is not available.

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

No functional change

22 months agoCorrectly output lowerbound/upperbound scores
Guenther Demetz [Tue, 6 Dec 2022 18:09:33 +0000 (19:09 +0100)]
Correctly output lowerbound/upperbound scores

fixes the lowerbound/upperbound output by avoiding
scores outside the alpha,beta bracket. Since SF search
uses fail-soft we can't simply take the returned value
as score.

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

No functional change

22 months agodoEvenDeeperSearch + tuning
FauziAkram [Fri, 2 Dec 2022 15:23:28 +0000 (18:23 +0300)]
doEvenDeeperSearch + tuning

Credit for the main idea of doEvenDeeperSearch goes to Vizvezdenec,
tuning by FauziAkram: Expansion of existing logic of doDeeperSearch -
if value from LMR is really really good do full depth search not
1 ply deeper but rather 2 instead.

Passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 330048 W: 87672 L: 86942 D: 155434
Ptnml(0-2): 1012, 36739, 88912, 37229, 1132
https://tests.stockfishchess.org/tests/view/638a1cadd2b9c924c4c621d2

Passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 216696 W: 57891 L: 57240 D: 101565
Ptnml(0-2): 72, 21221, 65152, 21790, 113
https://tests.stockfishchess.org/tests/view/638c7d52a971f1f096c68fe2

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

Bench: 3461830

22 months agoSet the right PATH for ARM compiler and build tests in CI
ppigazzini [Thu, 8 Dec 2022 17:32:30 +0000 (18:32 +0100)]
Set the right PATH for ARM compiler and build tests in CI

Fix for the GitHub upgrade:
https://github.com/actions/runner-images/issues/5879
that broke our ARM workflows because it changed the value of
the ANDROID_NDK_HOME variable referenced in our PATH.

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

No functional change

22 months agoRestore development version
Joost VandeVondele [Thu, 8 Dec 2022 19:33:32 +0000 (20:33 +0100)]
Restore development version

No functional change

22 months agoStockfish 15.1
Joost VandeVondele [Sat, 3 Dec 2022 07:50:46 +0000 (08:50 +0100)]
Stockfish 15.1

Official release version of Stockfish 15.1

Bench: 3467381

---

Today, we have the pleasure to announce Stockfish 15.1.

As usual, downloads will be freely available at stockfishchess.org/download

*Elo gain and competition results*

With this release, version 5 of the NNUE neural net architecture has
been introduced, and the training data has been extended to include
Fischer random chess (FRC) positions. As a result, Elo gains are largest
for FRC, reaching up to 50 Elo for doubly randomized FRC[1] (DFRC).
More importantly, also for standard chess this release progressed and
will win two times more game pairs than it loses[2] against
Stockfish 15. Stockfish continues to win in a dominating way[3] all
chess engine tournaments, including the TCEC Superfinal, Cup, FRC, DFRC,
and Swiss as well as the CCC Bullet, Blitz, and Rapid events.

*New evaluation*

This release also introduces a new convention for the evaluation that
is reported by search. An evaluation of +1 is now no longer tied to the
value of one pawn, but to the likelihood of winning the game. With
a +1 evaluation, Stockfish has now a 50% chance of winning the game
against an equally strong opponent. This convention scales down
evaluations a bit compared to Stockfish 15 and allows for consistent
evaluations in the future.

*ChessBase settlement*

In this release period, the Stockfish team has successfully enforced
its GPL license against ChessBase. This has been an intense process that
included filing a lawsuit[4], a court hearing[5], and finally
negotiating a settlement[6] that established that ChessBase infringed on
the license by not distributing the Stockfish derivatives Fat Fritz 2
and Houdini 6 as free software, and that ensures ChessBase will respect
the Free Software principles in the future. This settlement has been
covered by major chess sites (see e.g. lichess.org[7] and chess.com[8]),
and we are proud that it has been hailed as a ‘historic violation
settlement[9]’ by the Software Freedom Conservancy.

*Thank you*

The Stockfish project builds on a thriving community of enthusiasts
(thanks everybody!) that contribute their expertise, time, and resources
to build a free and open-source chess engine that is robust, widely
available, and very strong. We invite our chess fans to join the
fishtest testing framework and programmers to contribute to the
project[10].

The Stockfish team

[1] https://tests.stockfishchess.org/tests/view/638a6170d2b9c924c4c62cb4
[2] https://tests.stockfishchess.org/tests/view/638a4dd7d2b9c924c4c6297b
[3] https://en.wikipedia.org/wiki/Stockfish_(chess)#Competition_results
[4] https://stockfishchess.org/blog/2021/our-lawsuit-against-chessbase/
[5] https://stockfishchess.org/blog/2022/public-court-hearing-soon/
[6] https://stockfishchess.org/blog/2022/chessbase-stockfish-agreement/
[7] https://lichess.org/blog/Y3u1mRAAACIApBVn/settlement-reached-in-stockfish-v-chessbase
[8] https://www.chess.com/news/view/chessbase-stockfish-reach-settlement
[9] https://sfconservancy.org/news/2022/nov/28/sfc-named-trusted-party-in-gpl-case/
[10] https://stockfishchess.org/get-involved/

22 months agoFix bestThread selection
Joost VandeVondele [Mon, 28 Nov 2022 19:59:38 +0000 (20:59 +0100)]
Fix bestThread selection

If multiple threads have the same best move,
pick the thread with the largest contribution to the confidence vote.
This thread will later be used to display PV, so this patch is
about user-friendliness and/or least surprises, it non-functional for playing strenght.

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

No functional change

22 months agoSimply do full sort on captures.
VoyagerOne [Thu, 1 Dec 2022 21:31:35 +0000 (16:31 -0500)]
Simply do full sort on captures.

STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 42712 W: 11413 L: 11203 D: 20096
Ptnml(0-2): 145, 4661, 11544, 4851, 155
https://tests.stockfishchess.org/tests/view/6384df57d2b9c924c4c53900

LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 239072 W: 64065 L: 64067 D: 110940
Ptnml(0-2): 106, 23735, 71859, 23727, 109
https://tests.stockfishchess.org/tests/view/63851120d2b9c924c4c541ee

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

Bench: 3467381

22 months agoRemove PvNode Parameter for cutoff LMR
VoyagerOne [Sun, 27 Nov 2022 17:00:16 +0000 (12:00 -0500)]
Remove PvNode Parameter for cutoff LMR

STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 198520 W: 52673 L: 52632 D: 93215
Ptnml(0-2): 645, 22241, 53499, 22178, 697
https://tests.stockfishchess.org/tests/view/63746e8f9849fa7a36a6698f

LTC:
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 253568 W: 67487 L: 67501 D: 118580
Ptnml(0-2): 109, 25222, 76141, 25198, 114
https://tests.stockfishchess.org/tests/view/63839859d2b9c924c4c4feb7

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

Bench: 3733322

23 months agoCorrectly output lowerbound/upperbound in threaded searches
Guenther Demetz [Tue, 22 Nov 2022 10:07:18 +0000 (11:07 +0100)]
Correctly output lowerbound/upperbound in threaded searches

fixes the lowerbound/upperbound output by taking the alpha,beta bracket
into account also if a bestThread is selected that is different from the master thread.

Instead of keeping track which bounds where used in the specific search,
in this version we simply store the quality (exact, upperbound,
lowerbound) of the score along with the actual score as information on
rootMove.

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

No functional change

23 months agoSimplify both quiet check evasions' conditions
peregrineshahin [Sun, 13 Nov 2022 09:08:17 +0000 (11:08 +0200)]
Simplify both quiet check evasions' conditions

passed Non-regression STC:
https://tests.stockfishchess.org/tests/view/6370b647f1b748d4819e0b64
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 162904 W: 43249 L: 43171 D: 76484
Ptnml(0-2): 491, 17089, 46220, 17155, 497

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

No functional change

23 months agoSkip full depth search in LMR depending on depth
VoyagerOne [Tue, 22 Nov 2022 17:07:33 +0000 (20:07 +0300)]
Skip full depth search in LMR depending on depth

dynamically adjust newDepth, and skip full depth search if newDepth doesn't exceed the previous search depth.
This affects the used newDepth for future searches, and influences the stat bonus for the move.

Passed STC:
https://tests.stockfishchess.org/tests/view/63795500aa34433735bc1cfe
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 112776 W: 30082 L: 29663 D: 53031
Ptnml(0-2): 352, 12453, 30423, 12744, 416

Passed LTC:
https://tests.stockfishchess.org/tests/view/6379ea39aa34433735bc2f9b
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 83576 W: 22559 L: 22169 D: 38848
Ptnml(0-2): 38, 8011, 25303, 8395, 41

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

Bench: 4390318

23 months agoUpdate Top CPU Contributors
Joost VandeVondele [Sat, 19 Nov 2022 09:18:04 +0000 (10:18 +0100)]
Update Top CPU Contributors

list as of 2022-11-19. Thanks!

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

No functional change

23 months agoUpdate WDL model for current SF
Joost VandeVondele [Sat, 19 Nov 2022 12:03:14 +0000 (13:03 +0100)]
Update WDL model for current SF

This updates the WDL model based on the LTC statistics  (2M games).

Relatively small change, note that this also adjusts the NormalizeToPawnValue (now 361),
to keep win prob at 50% for 100cp.

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

No functional change.

23 months agoFix a missing conversion
Joost VandeVondele [Sat, 19 Nov 2022 09:57:08 +0000 (10:57 +0100)]
Fix a missing conversion

This conversion to cp was overlooked.

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

No functional change

23 months agoSimplification away Cutoff Reset
VoyagerOne [Mon, 14 Nov 2022 13:11:27 +0000 (08:11 -0500)]
Simplification away Cutoff Reset

STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 150184 W: 39913 L: 39819 D: 70452
Ptnml(0-2): 493, 16796, 40474, 16782, 547
https://tests.stockfishchess.org/tests/view/63723e9e54d69a2f33911d3c

LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 58880 W: 15890 L: 15717 D: 27273
Ptnml(0-2): 35, 5765, 17659, 5954, 27
https://tests.stockfishchess.org/tests/view/6373baf49849fa7a36a65427

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

Bench: 4035152

23 months agoDo shallower search in case of lmr being not successful enough
Michael Chaly [Thu, 17 Nov 2022 15:31:59 +0000 (18:31 +0300)]
Do shallower search in case of lmr being not successful enough

In case of a move passing LMR but it results being not too far from
the current best search result produce a full depth search with reduced depth.

Original idea by lonfom169 .

Passed STC:
https://tests.stockfishchess.org/tests/view/6373409b54d69a2f33913fbd
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 169504 W: 45351 L: 44848 D: 79305
Ptnml(0-2): 598, 18853, 45353, 19344, 604

Passed LTC:
https://tests.stockfishchess.org/tests/view/6374c58528e3405283eb8d2d
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 51144 W: 13802 L: 13471 D: 23871
Ptnml(0-2): 19, 4928, 15362, 5229, 34

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

bench 4277005

23 months agospeedup CI
disservin [Mon, 7 Nov 2022 17:15:42 +0000 (18:15 +0100)]
speedup CI

Github Actions allows us to use up to 20 workers.
This way we can launch multiple different checks
at the same time and optimize the overall time
the CI takes a bit.

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

No functional change

23 months agoRemove trend
disservin [Thu, 3 Nov 2022 20:53:02 +0000 (21:53 +0100)]
Remove trend

Simplify trend away.

passed Non-regression STC:
https://tests.stockfishchess.org/tests/view/63642a63a90afcecbd1cb887
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 130000 W: 34683 L: 34567 D: 60750
Ptnml(0-2): 455, 14424, 35135, 14522, 464

passed Non-regression LTC:
https://tests.stockfishchess.org/tests/view/636566fda90afcecbd1cded9
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 81592 W: 21938 L: 21787 D: 37867
Ptnml(0-2): 42, 8035, 24490, 8188, 41

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

Bench: 4239512

23 months agoChange versioning and save binaries as CI artifacts
disservin [Sun, 6 Nov 2022 15:17:17 +0000 (16:17 +0100)]
Change versioning and save binaries as CI artifacts

For development versions of Stockfish, the version will now look like
dev-20221107-dca9a0533
indicating a development version, the date of the last commit,
and the git SHA of that commit. If git is not available,
the fallback is the date of compilation. Releases will continue to be
versioned as before.

Additionally, this PR extends the CI to create binary artifacts,
i.e. pushes to master will automatically build Stockfish and upload
the binaries to github.

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

No functional change

23 months agoNormalize evaluation
Joost VandeVondele [Mon, 31 Oct 2022 19:36:43 +0000 (20:36 +0100)]
Normalize evaluation

Normalizes the internal value as reported by evaluate or search
to the UCI centipawn result used in output. This value is derived from
the win_rate_model() such that Stockfish outputs an advantage of
"100 centipawns" for a position if the engine has a 50% probability to win
from this position in selfplay at fishtest LTC time control.

The reason to introduce this normalization is that our evaluation is, since NNUE,
no longer related to the classical parameter PawnValueEg (=208). This leads to
the current evaluation changing quite a bit from release to release, for example,
the eval needed to have 50% win probability at fishtest LTC (in cp and internal Value):

June 2020  :   113cp (237)
June 2021  :   115cp (240)
April 2022 :   134cp (279)
July 2022  :   167cp (348)

With this patch, a 100cp advantage will have a fixed interpretation,
i.e. a 50% win chance. To keep this value steady, it will be needed to update the win_rate_model()
from time to time, based on fishtest data. This analysis can be performed with
a set of scripts currently available at https://github.com/vondele/WLD_model

fixes https://github.com/official-stockfish/Stockfish/issues/4155
closes https://github.com/official-stockfish/Stockfish/pull/4216

No functional change

23 months agoMark variable as potentially unused
Joost VandeVondele [Sat, 5 Nov 2022 08:14:11 +0000 (09:14 +0100)]
Mark variable as potentially unused

fixes CI when compiled with -Werror

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

No functional change

2 years agoAdjust reduction less at medium depths
kurt22i [Sun, 30 Oct 2022 13:02:48 +0000 (09:02 -0400)]
Adjust reduction less at medium depths

This patch dampens the reduction increase/decrease from statScore at mid-range depths.
Inspired by patterns noticed in this tune: https://tests.stockfishchess.org/tests/view/635188930e5f47a8d0ffe8f5

Passed STC:
https://tests.stockfishchess.org/tests/view/63599dfd6b27ef94d9ec04af
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 87464 W: 23519 L: 23134 D: 40811
Ptnml(0-2): 319, 9599, 23524, 9958, 332

Passed LTC:
https://tests.stockfishchess.org/tests/view/635a73046b27ef94d9ec2313
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 154792 W: 41746 L: 41214 D: 71832
Ptnml(0-2): 79, 15181, 46349, 15703, 84

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

Bench 4271738

2 years agoUpdate MacOS CI
Joost VandeVondele [Sat, 29 Oct 2022 06:23:11 +0000 (08:23 +0200)]
Update MacOS CI

move to 12 following actions runner update deprecation
(see https://github.com/actions/runner-images/issues/5583)

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

No functional change

2 years agoFix README typos, update AUTHORS
Clausable [Mon, 24 Oct 2022 20:00:31 +0000 (16:00 -0400)]
Fix README typos, update AUTHORS

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

No functional change

2 years agoAdd issue template
dav1312 [Tue, 25 Oct 2022 09:15:00 +0000 (11:15 +0200)]
Add issue template

Add an issue template using GitHub's form schema
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema

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

No functional change.

2 years agoUse TT moves more often in qsearch
Michael Chaly [Fri, 21 Oct 2022 14:10:45 +0000 (17:10 +0300)]
Use TT moves more often in qsearch

During the recapture phase of quiescence search (where we limit the generated moves to recaptures on the last seen capture square),
the move picker will now emit the tt move, even if the tt move is not a recapture.

Passed STC :
https://tests.stockfishchess.org/tests/view/6350df2928d3a71cb1eef838
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 90280 W: 24001 L: 23845 D: 42434
Ptnml(0-2): 273, 9779, 24941, 9813, 334

Passed LTC :
https://tests.stockfishchess.org/tests/view/6351308b28d3a71cb1ef06ce
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 104504 W: 27937 L: 27807 D: 48760
Ptnml(0-2): 54, 10378, 31260, 10504, 56

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

Bench: 4540268

2 years agoAdd RISC-V 64-bit support
Clement [Fri, 21 Oct 2022 02:29:57 +0000 (02:29 +0000)]
Add RISC-V 64-bit support

adds a riscv64 target architecture to the Makefile to support RISC-V 64-bit.
Compiled and tested on VisionFive 2 board.

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

No functional change.

2 years agoenable bit manipulation instruction set 1
disservin [Sun, 16 Oct 2022 12:37:01 +0000 (14:37 +0200)]
enable bit manipulation instruction set 1

bmi1 enables the use of _blsr_u64 for pop_lsb, and is availabe when avx2 is.

verified a small speedup (0.2 - 0.6%)

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

No functional change

2 years agoApply -flto-partition=one / -flto=full
MinetaS [Sun, 16 Oct 2022 15:03:08 +0000 (00:03 +0900)]
Apply -flto-partition=one / -flto=full

This patch fixes a potential bug derived from an incompatibility between LTO and top-level assembly code (INCBIN).

Passed non-regression STC (master e90341f):
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 119352 W: 31986 L: 31862 D: 55504
Ptnml(0-2): 439, 12624, 33400, 12800, 413
https://tests.stockfishchess.org/tests/view/634aacf84bc7650f0755188b

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

No functional change

2 years agoFix tablebase probe for dtz >1000 w/o 50 move rule
Rodrigo Roim [Fri, 7 Oct 2022 23:55:07 +0000 (16:55 -0700)]
Fix tablebase probe for dtz >1000 w/o 50 move rule

For qn4N1/6R1/3K4/8/B2k4/8/8/8 w - - 0 1, white loses with DTZ 1034.
See https://syzygy-tables.info/?fen=qn4N1/6R1/3K4/8/B2k4/8/8/8_w_-_-_0_1

Prior to this fix, due to a too small hard-coded value, Stockfish interpreted this as winning.
The new value picked (1<<18) is large enough to deal with the largest DTZ values that can be stored in the current syzygy format.

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

No functional change.

2 years agoAdjust timeman constants
xoto10 [Sat, 8 Oct 2022 13:53:14 +0000 (14:53 +0100)]
Adjust timeman constants

Adjust timeman constants to use more time in early part of game.

STC @ 10+0.1 th 1 :
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 93984 W: 25177 L: 24787 D: 44020
Ptnml(0-2): 350, 10096, 25729, 10448, 369
https://tests.stockfishchess.org/tests/live_elo/6339077135f43d649ff6162a

LTC @ 60+0.6 th 1 :
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 329368 W: 88953 L: 88093 D: 152322
Ptnml(0-2): 170, 31457, 100594, 32269, 194
https://tests.stockfishchess.org/tests/live_elo/6339baed35f43d649ff63142

Sudden death 10+0 :
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 20400 W: 5908 L: 5588 D: 8904
Ptnml(0-2): 177, 2252, 5128, 2360, 283
https://tests.stockfishchess.org/tests/live_elo/6347c9384bc7650f07549ba7

Sudden death 10+0, no adjudication :
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 17920 W: 4755 L: 4442 D: 8723
Ptnml(0-2): 137, 1985, 4466, 2172, 200
https://tests.stockfishchess.org/tests/live_elo/634806e84bc7650f0754a639

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

No functional change

2 years agoTweak the formula for NNUE complexity
Stéphane Nicolet [Sat, 8 Oct 2022 22:27:26 +0000 (00:27 +0200)]
Tweak the formula for NNUE complexity

Joint work by Ofek Shochat and Stéphane Nicolet.

passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 93288 W: 24996 L: 24601 D: 43691
Ptnml(0-2): 371, 10263, 24989, 10642, 379
https://tests.stockfishchess.org/tests/view/63448f4f4bc7650f07541987

passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 84168 W: 22771 L: 22377 D: 39020
Ptnml(0-2): 47, 8181, 25234, 8575, 47
https://tests.stockfishchess.org/tests/view/6345186d4bc7650f07542fbd

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

It seems there are two effects with this patch:

effect A :

If Stockfish is winning at root, we have optimism > 0 for all leaves in
the search tree where Stockfish is to move. There, if (psq - nnue) > 0
(ie if the advantage is more materialistic than positional), then the
product D = optimism * (psq - nnue) will be positive, nnueComplexity will
increase, and the eval will increase from SF point of view.

So the effect A is that if Stockfish is winning at root, she will slightly
favor in the search tree (in other words, search more) the positions where
she can convert her advantage via materialist means.

effect B :

If Stockfish is losing at root, we have optimism > 0 for all leaves in
the search tree where the opponent is to move. There, if (psq - nnue) < 0
(ie if the opponent advantage is more positional than materialistic), then
the product D = optimism * (psq-nnue) will be negative, nnueComplexity will
decrease, and the eval will decrease from the opponent point of view.

So the effect B is that Stockfish will slightly favor in the search tree
(search more) the branches where she can defend by slowly reducing the
opponent positional advantage.

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

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

bench: 4673898

2 years agoRemove depth condition from razoring
Dubslow [Fri, 7 Oct 2022 10:44:29 +0000 (05:44 -0500)]
Remove depth condition from razoring

The eval condition depends on depth anyways, so this patch is nearly (not quite) non-functional

passed STC:
https://tests.stockfishchess.org/tests/view/63428169fb7ccb2ea9be2629
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 185992 W: 49612 L: 49558 D: 86822
Ptnml(0-2): 618, 19956, 51842, 19914, 666

passed LTC:
https://tests.stockfishchess.org/tests/view/634418b14bc7650f07540760
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 126816 W: 34147 L: 34043 D: 58626
Ptnml(0-2): 74, 11941, 39281, 12031, 81

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

bench 4148700

2 years agoOptimize make_index() using templates and lookup tables.
mstembera [Fri, 14 Oct 2022 21:41:08 +0000 (14:41 -0700)]
Optimize make_index() using templates and lookup tables.

https://tests.stockfishchess.org/tests/view/634517e54bc7650f07542f99
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 642672 W: 171819 L: 170658 D: 300195
Ptnml(0-2): 2278, 68077, 179416, 69336, 2229

this also introduces `-flto-partition=one` as suggested by MinetaS (Syine Mineta)
to avoid linking errors due to LTO on 32 bit mingw. This change was tested in isolation as well

https://tests.stockfishchess.org/tests/view/634aacf84bc7650f0755188b
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 119352 W: 31986 L: 31862 D: 55504
Ptnml(0-2): 439, 12624, 33400, 12800, 413

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

No functional change

2 years agoTweak history initialization
Stefan Geschwentner [Tue, 4 Oct 2022 16:16:20 +0000 (18:16 +0200)]
Tweak history initialization

Simplify initialization of continuation history by using everywhere the same starting value.

STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 90952 W: 24312 L: 24153 D: 42487
Ptnml(0-2): 356, 10168, 24290, 10285, 377
https://tests.stockfishchess.org/tests/view/633948f235f43d649ff61fd0

LTC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 162416 W: 43540 L: 43466 D: 75410
Ptnml(0-2): 77, 16289, 48417, 16333, 92
https://tests.stockfishchess.org/tests/view/6339ee8a35f43d649ff63986

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

Bench: 4156027

2 years agoRemove old line in "Futility pruning for captures"
Giacomo Lorenzetti [Wed, 5 Oct 2022 11:08:00 +0000 (13:08 +0200)]
Remove old line in "Futility pruning for captures"

The line is no longer needed after https://github.com/official-stockfish/Stockfish/commit/910cf8b21839eb9f1991934a5436eea112021723.
This patch incidentally applies "Futility Pruning for Captures" also in case of en-passant, changing the bench signature.

Passed STC:
https://tests.stockfishchess.org/tests/view/6332c1f1208c26088697b731
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 68760 W: 18440 L: 18256 D: 32064
Ptnml(0-2): 267, 7530, 18595, 7728, 260

Passed LTC:
https://tests.stockfishchess.org/tests/view/633312e9208c26088697c59b
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 455552 W: 121910 L: 122123 D: 211519
Ptnml(0-2): 253, 45439, 136600, 45236, 248

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

Bench: 4374521

2 years agoRevert "Mix alpha and statScore for reduction"
Joost VandeVondele [Wed, 5 Oct 2022 20:59:05 +0000 (22:59 +0200)]
Revert "Mix alpha and statScore for reduction"

This reverts commit 8bab09749dd00951bfa9c5f89f6e35bded76c8a9.

In this form the patch reduces mate finding effectiveness, as the large alpha value has negative influence on the reductions.

see also https://github.com/official-stockfish/Stockfish/pull/4183

Bench: 4114228

2 years agoMix alpha and statScore for reduction
FauziAkram [Mon, 3 Oct 2022 14:45:05 +0000 (17:45 +0300)]
Mix alpha and statScore for reduction

Idea by @xoto10, and tuning by @FauziAkram.

Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 57832 W: 15540 L: 15199 D: 27093
Ptnml(0-2): 207, 6343, 15477, 6680, 209
https://tests.stockfishchess.org/tests/view/6338db6f35f43d649ff60fdc

passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 50968 W: 13770 L: 13440 D: 23758
Ptnml(0-2): 25, 4905, 15306, 5211, 37
https://tests.stockfishchess.org/tests/view/6339777035f43d649ff62686

Links to the tuning sessions:
https://tests.stockfishchess.org/tests/view/63345725a004bed9a2e47b28
https://tests.stockfishchess.org/tests/view/63345728a004bed9a2e47b2a

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

Bench: 4426602

2 years agoUse less reduction for escaping moves
disservin [Sun, 18 Sep 2022 09:16:54 +0000 (11:16 +0200)]
Use less reduction for escaping moves

This patch reuses the threatenedPieces variable (which is calculated in movepicker)
to reduce less in the search tree the moves which escape a capture.

passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 314352 W: 84042 L: 83328 D: 146982
Ptnml(0-2): 1105, 35084, 84207, 35552, 1228
https://tests.stockfishchess.org/tests/view/63355f37a004bed9a2e4a17f

passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 90752 W: 24556 L: 24147 D: 42049
Ptnml(0-2): 59, 8855, 27123, 9296, 43
https://tests.stockfishchess.org/tests/view/63383a7735f43d649ff5fa8b

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

bench: 4114228

2 years agoSimplify both position calls in useClassical
peregrineshahin [Thu, 22 Sep 2022 05:49:21 +0000 (08:49 +0300)]
Simplify both position calls in useClassical

Simplify the use of classical evaluation when using default settings to only be dependent on piece count and decisive PSQ

passed STC:
https://tests.stockfishchess.org/tests/view/632d32a7006ef9eb96d86ce9
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 108048 W: 28904 L: 28763 D: 50381
Ptnml(0-2): 383, 12060, 29006, 12183, 392

passed LTC:
https://tests.stockfishchess.org/tests/view/632d705a006ef9eb96d87649
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 76600 W: 20671 L: 20516 D: 35413
Ptnml(0-2): 34, 7533, 23023, 7664, 46

Inspired by sorais, credit to him.

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

bench  4173163

2 years agoUpdate README.md
Brad Knox [Tue, 20 Sep 2022 21:15:15 +0000 (16:15 -0500)]
Update README.md

Adding some svg icons and additional information, insert links as references

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

No functional change

2 years agoAlways output hashfull
Torsten Hellwig [Mon, 19 Sep 2022 16:22:56 +0000 (18:22 +0200)]
Always output hashfull

This removes the restriction that no hashfull information is printed within the first second of a search.
On modern systems, a non-zero value is returned within 6 ms with default settings.

passed STC:
https://tests.stockfishchess.org/tests/view/63277b08b9c0caa5f4a798e4
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 290096 W: 77505 L: 77561 D: 135030
Ptnml(0-2): 1008, 30713, 81592, 30797, 938

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

No functional change

2 years agoSimplify EVASIONS scoring
mstembera [Sat, 17 Sep 2022 12:45:54 +0000 (05:45 -0700)]
Simplify EVASIONS scoring

remove some multipliers & adjust, doesn't change the move ordering

STC https://tests.stockfishchess.org/tests/view/6325c1c9b9c0caa5f4a759ae
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 192760 W: 51528 L: 51482 D: 89750
Ptnml(0-2): 642, 20490, 54148, 20380, 720

Credit to locutus2

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

No functional change

2 years agoPrioritize checks in movepicker
mstembera [Wed, 14 Sep 2022 19:11:52 +0000 (12:11 -0700)]
Prioritize checks in movepicker

give a little bonus for moving pieces to squares where they give check

STC: https://tests.stockfishchess.org/tests/view/631da742162491686d2e40b5
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 80072 W: 21753 L: 21368 D: 36951
Ptnml(0-2): 421, 8876, 21075, 9225, 439

LTC: https://tests.stockfishchess.org/tests/view/631dd9e6b85daa436625de1d
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 263480 W: 70916 L: 70158 D: 122406
Ptnml(0-2): 322, 26156, 78029, 26908, 325

similar ideas have been tested by Viz and Guenther

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

bench: 4326572

2 years agoSimplify trend and optimism.
atumanian [Mon, 12 Sep 2022 17:16:54 +0000 (20:16 +0300)]
Simplify trend and optimism.

This patch simplifies the formulas used to compute the trend and optimism values before each search iteration.
As a side effect, this removes the parameters which make the relationship between the displayed evaluation value
and the expected game result asymmetric.

I've also provided links to the results of isotonic regression analysis of the relationship between the evaluation and game result (statistical data and a graph) for both tests, which demonstrate that the new version has a more symmetric relationship:

STC: [Data and graph](https://github.com/official-stockfish/Stockfish/discussions/4150#discussioncomment-3548954)
LTC: [Data and graph](https://github.com/official-stockfish/Stockfish/discussions/4150#discussioncomment-3626311)
See also https://github.com/official-stockfish/Stockfish/issues/4142

passed STC:
https://tests.stockfishchess.org/tests/view/6313f44b8202a039920e27e6
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 108016 W: 28903 L: 28760 D: 50353
Ptnml(0-2): 461, 12075, 28850, 12104, 518

passed LTC:
https://tests.stockfishchess.org/tests/view/631de45db85daa436625dfe6
LLR: 3.01 (-2.94,2.94) <-1.75,0.25>
Total: 34792 W: 9412 L: 9209 D: 16171
Ptnml(0-2): 24, 3374, 10397, 3577, 24

Furthermore, this does not measurably impact Elo strength against weaker engines,
as demonstrated in a match of master and patch vs SF13:

This patch vs SF 13:
https://tests.stockfishchess.org/tests/view/631fa34ae1612778c344c6eb
Elo: 141.66 +-1.2 (95%) LOS: 100.0%
Total: 100000 W: 48182 L: 9528 D: 42290
Ptnml(0-2): 96, 1426, 13277, 30130, 5071
nElo: 284.13 +-3.3 (95%) PairsRatio: 23.13

Master vs SF 13:
https://tests.stockfishchess.org/tests/view/631fa3ece1612778c344c6ff
Elo: 143.26 +-1.2 (95%) LOS: 100.0%
Total: 100000 W: 48525 L: 9479 D: 41996
Ptnml(0-2): 94, 1537, 13098, 29771, 5500
nElo: 281.70 +-3.3 (95%) PairsRatio: 21.63

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

Bench: 4425574

2 years agoExplicitly annotate a few variables
Joost VandeVondele [Sun, 11 Sep 2022 19:28:12 +0000 (21:28 +0200)]
Explicitly annotate a few variables

as [[maybe_unused]], avoiding the (void)foo trick.

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

No functional change

2 years agoOptimize AVX2 path in NNUE evaluation
mstembera [Tue, 6 Sep 2022 22:02:35 +0000 (15:02 -0700)]
Optimize AVX2 path in NNUE evaluation

always selecting AffineTransform specialization for small inputs.

A related patch was tested as

Initially tested as a simplification
STC https://tests.stockfishchess.org/tests/view/6317c3f437f41b13973d6dff
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 58072 W: 15619 L: 15425 D: 27028
Ptnml(0-2): 241, 6191, 15992, 6357, 255

Elo gain speedup test
STC https://tests.stockfishchess.org/tests/view/63181c1b37f41b13973d79dc
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 184496 W: 49922 L: 49401 D: 85173
Ptnml(0-2): 851, 19397, 51208, 19964, 828

and this patch gained in testing

speedup        = +0.0071
P(speedup > 0) =  1.0000
on CPU: 16 x AMD Ryzen 9 3950X

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

No functional change

2 years agoDo less singular extensions for former PVnode
Michael Chaly [Sat, 10 Sep 2022 09:30:25 +0000 (12:30 +0300)]
Do less singular extensions for former PVnode

Patch is a reintroduction of logic what was simplified a while ago
in a slightly different form. Do bigger extension offset in
case of non-pv node having a pv.

passed STC
https://tests.stockfishchess.org/tests/view/631977c048f27688a06e66d5
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 23296 W: 6404 L: 6108 D: 10784
Ptnml(0-2): 88, 2539, 6118, 2795, 108

passed LTC
https://tests.stockfishchess.org/tests/view/631989cb48f27688a06e696c
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 235592 W: 63890 L: 63188 D: 108514
Ptnml(0-2): 275, 23392, 69804, 24006, 319

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

Bench: 3993611

2 years agoRazor also on PV nodes
Dubslow [Sat, 20 Aug 2022 03:49:29 +0000 (22:49 -0500)]
Razor also on PV nodes

Simplification introduced by xoto10

blue LTC vs new master:
https://tests.stockfishchess.org/tests/view/631ad4ef9cfa5e9b648d1b4e
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 59184 W: 16002 L: 15828 D: 27354
Ptnml(0-2): 65, 5777, 17747, 5925, 78

blue STC vs old master:
https://tests.stockfishchess.org/tests/view/6306b87b902a848543334c25
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 213944 W: 57184 L: 57159 D: 99601
Ptnml(0-2): 877, 23448, 58331, 23405, 911

blue LTC vs old master:
https://tests.stockfishchess.org/tests/view/63070e6b902a8485433357e7
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 192080 W: 52050 L: 52006 D: 88024
Ptnml(0-2): 232, 18981, 57611, 18943, 273

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

bench 4208975

2 years agoFurther LTC tuning of search parameters
Michael Chaly [Sat, 10 Sep 2022 22:45:37 +0000 (01:45 +0300)]
Further LTC tuning of search parameters

Tuning done by bigpenor with some hand adjustments on top by Viz.

Had a good performance at fixed games 180+1.8:
https://tests.stockfishchess.org/tests/view/631836b437f41b13973d7da1
Elo: 1.35 +-1.2 (95%) LOS: 98.6%
Total: 60000 W: 16422 L: 16189 D: 27389
Ptnml(0-2): 39, 5335, 18992, 5622, 12
nElo: 3.13 +-2.8 (95%) PairsRatio: 1.05

Passed 60+0.6 8 threads SPRT:
https://tests.stockfishchess.org/tests/view/631ba0ff74bc4fe483a99db3
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 29712 W: 8301 L: 8039 D: 13372
Ptnml(0-2): 12, 2318, 9925, 2598, 3

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

bench 3938073

2 years agoVLTC tuning
FauziAkram [Wed, 31 Aug 2022 11:45:39 +0000 (14:45 +0300)]
VLTC tuning

Tuning some parameters that scale well with longer time control:

Failed STC:
https://tests.stockfishchess.org/tests/view/6313424d8202a039920e130a
LLR: -2.94 (-2.94,2.94) <-1.75,0.25>
Total: 42680 W: 11231 L: 11540 D: 19909
Ptnml(0-2): 191, 5008, 11232, 4737, 172

Passed LTC:
https://tests.stockfishchess.org/tests/view/6311e2cd874169ca52ae7933
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 53448 W: 14782 L: 14437 D: 24229
Ptnml(0-2): 101, 5214, 15740, 5577, 92

Passed VLTC:
https://tests.stockfishchess.org/tests/view/6312530cfa99a92e3002c927
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 123336 W: 33465 L: 33007 D: 56864
Ptnml(0-2): 38, 11466, 38204, 11920, 40

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

Bench: 5609606

2 years agoProvide network download fallback
Joost VandeVondele [Sat, 3 Sep 2022 09:03:09 +0000 (11:03 +0200)]
Provide network download fallback

in case the base infrastructure for providing the networks

https://tests.stockfishchess.org/nns

is down, use an alternate github repo for downloading networks during the build.

fixes #4149
fixes #4140

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

No functional change

2 years agoIncrease the maximum number of threads to 1024
Joost VandeVondele [Sat, 3 Sep 2022 09:15:40 +0000 (11:15 +0200)]
Increase the maximum number of threads to 1024

relatively soon servers with 512 threads will be available 'quite commonly',
anticipate even more threads, and increase our current maximum from 512 to 1024.

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

No functional change.

2 years agoDisable ARM CI tests
dav1312 [Fri, 26 Aug 2022 09:26:31 +0000 (11:26 +0200)]
Disable ARM CI tests

Temporarily disable ARM CI tests until a mitigation is implemented

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

No functional change.

2 years agoMake key_after() more consistent with key()
mstembera [Sun, 14 Aug 2022 00:01:11 +0000 (17:01 -0700)]
Make key_after() more consistent with key()

STC: https://tests.stockfishchess.org/tests/view/62f8547123d42b50a8dac674
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 176640 W: 47699 L: 47189 D: 81752
Ptnml(0-2): 776, 18599, 49129, 18971, 845

A bug fix plus non functional speed optimization. Position::key_after(Move m) is now
consistent with Position::key() thus prefetching correct TT entries which speeds things up.
Related PR #3759

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

No functional change

2 years agoSimplify the use of classical eval
Joost VandeVondele [Fri, 12 Aug 2022 10:31:49 +0000 (12:31 +0200)]
Simplify the use of classical eval

no benefit of the fallback term (exercised rarely).
Cleanup the associated code.

passed STC
https://tests.stockfishchess.org/tests/view/62f62c2b6f0a08af9f776367
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 67832 W: 18334 L: 18148 D: 31350
Ptnml(0-2): 369, 7171, 18609, 7439, 328

passed LTC
https://tests.stockfishchess.org/tests/view/62f68beb6f0a08af9f77710e
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 104664 W: 28363 L: 28233 D: 48068
Ptnml(0-2): 169, 10162, 31511, 10350, 140

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

Bench: 6079565

2 years agoSimplify away smp adjustment in TT use
Michael Chaly [Mon, 15 Aug 2022 05:52:55 +0000 (08:52 +0300)]
Simplify away smp adjustment in TT use

Passed STC
https://tests.stockfishchess.org/tests/view/62f7d81f23d42b50a8dab568
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 98160 W: 26307 L: 26165 D: 45688
Ptnml(0-2): 201, 10282, 27960, 10448, 189

Passed LTC
https://tests.stockfishchess.org/tests/view/62f8d1a623d42b50a8dad4fb
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 81544 W: 22346 L: 22200 D: 36998
Ptnml(0-2): 44, 7542, 25446, 7704, 36

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

No functional change (single threaded).

2 years agoMake LMR code easier to follow
mckx00 [Sat, 13 Aug 2022 12:32:30 +0000 (05:32 -0700)]
Make LMR code easier to follow

Remove flags doFullDepthSearch and didLMR, and reorder instruction.

Small measured speedup.

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

No functional change.

2 years agoReport longest PV lines for multithreaded search
mstembera [Tue, 9 Aug 2022 04:33:59 +0000 (21:33 -0700)]
Report longest PV lines for multithreaded search

In case several threads find the same bestmove,
report the longest PV line found.

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

No functional change.

2 years agoRemove an unneeded randomization of evals.
Joost VandeVondele [Sun, 31 Jul 2022 14:55:07 +0000 (16:55 +0200)]
Remove an unneeded randomization of evals.

most of the effect comes from the randomization of 3-folds.

passed STC:
https://tests.stockfishchess.org/tests/view/62e697e97e84186e5d19af6f
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 572976 W: 153168 L: 153539 D: 266269
Ptnml(0-2): 2505, 64783, 152364, 64250, 2586

passed LTC:
https://tests.stockfishchess.org/tests/view/62ee5977523c86dcd6957154
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 704808 W: 191212 L: 191680 D: 321916
Ptnml(0-2): 1340, 70579, 208972, 70235, 1278

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

Bench: 5868987

2 years agoCleanup code
Stefan Geschwentner [Tue, 9 Aug 2022 18:56:13 +0000 (20:56 +0200)]
Cleanup code

This PR includes following cleanups:
- Remove the unused depth variable in the thread class.
- cleanup ValueList (added from mstembera)

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

No functional change.

2 years agoUpdate WDL model for current SF
Joost VandeVondele [Sun, 31 Jul 2022 12:58:13 +0000 (14:58 +0200)]
Update WDL model for current SF

This updates the WDL model based on the LTC statistics for the two weeks (3M games).

for old results see:

https://github.com/official-stockfish/Stockfish/pull/3981
https://github.com/official-stockfish/Stockfish/pull/3582
https://github.com/official-stockfish/Stockfish/pull/2778

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

No functional change.

2 years agoUpdate CPU contributors list
Joost VandeVondele [Sun, 31 Jul 2022 13:04:23 +0000 (15:04 +0200)]
Update CPU contributors list

Thanks for your contributions!

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

No functional change

2 years agoReintroduce singularQuietLMR
lonfom169 [Wed, 3 Aug 2022 15:43:21 +0000 (12:43 -0300)]
Reintroduce singularQuietLMR

STC:
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 88912 W: 23972 L: 23580 D: 41360
Ptnml(0-2): 365, 9820, 23712, 10176, 383
https://tests.stockfishchess.org/tests/view/62e9537a400addce2c13399b

LTC:
LLR: 2.97 (-2.94,2.94) <0.50,2.50>
Total: 85672 W: 23607 L: 23192 D: 38873
Ptnml(0-2): 219, 8316, 25365, 8703, 233
https://tests.stockfishchess.org/tests/view/62e9a174400addce2c1346e4

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

Bench: 5921315

2 years agoTweak history updates
Stefan Geschwentner [Tue, 2 Aug 2022 21:14:14 +0000 (23:14 +0200)]
Tweak history updates

In general the history update bonus is slightly decreased by 11% which gives a slower saturation speed.
In addition only for main history the divisor is halfed (used history values are doubled to maintain same maximum)
which have an effect in the opposite direction on saturation speed.

STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 157088 W: 42673 L: 42168 D: 72247
Ptnml(0-2): 857, 17346, 41642, 17833, 866
https://tests.stockfishchess.org/tests/view/62e5517ab383a712b13867c5

LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 325592 W: 88705 L: 87753 D: 149134
Ptnml(0-2): 594, 32288, 96076, 33248, 590
https://tests.stockfishchess.org/tests/view/62e5e4f4b383a712b1387d53

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

Bench: 5518728

2 years agoDo more TT cutoffs in case of exact bound
Michael Chaly [Sat, 30 Jul 2022 23:04:23 +0000 (02:04 +0300)]
Do more TT cutoffs in case of exact bound

The idea is that these TT entries are considered move valuable in TT replacement scheme - they are always overwriting other entries. So it makes sence for them to produce more aggressive cutoffs.

passed STC
https://tests.stockfishchess.org/tests/view/62e4d407b383a712b1385410
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 96632 W: 26045 L: 25659 D: 44928
Ptnml(0-2): 434, 10635, 25770, 11065, 412

passed LTC
https://tests.stockfishchess.org/tests/view/62e523e2b383a712b1386193
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 77960 W: 21363 L: 20989 D: 35608
Ptnml(0-2): 190, 7591, 23009, 8035, 155

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

bench 5820568

2 years agoremove useClassical depth condition
Dubslow [Wed, 27 Jul 2022 04:45:19 +0000 (23:45 -0500)]
remove useClassical depth condition

passed STC:
https://tests.stockfishchess.org/tests/view/62e0c3e98e4fa6ae472695ed
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 293568 W: 78934 L: 79151 D: 135483
Ptnml(0-2): 1344, 31488, 81366, 31213, 1373

passed LTC:
https://tests.stockfishchess.org/tests/view/62e190aa8e4fa6ae4726b5b5
LLR: 2.98 (-2.94,2.94) <-2.25,0.25>
Total: 187392 W: 50971 L: 51028 D: 85393
Ptnml(0-2): 384, 17801, 57369, 17772, 370

other attempts to otherwise tune this parameter failed, bounds 6,7,10,11 failed STC, 8 passed STC but failed LTC

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

bench 5796377

2 years agoSimplify reduction condition for cutNodes
Dubslow [Tue, 19 Jul 2022 06:09:30 +0000 (01:09 -0500)]
Simplify reduction condition for cutNodes

LMR: for cutNodes, dont exclude killer moves. This was a prelude to reducing
allNodes, altho that's failed so far.

STC https://tests.stockfishchess.org/tests/view/62d64ad147ae1768b34a27c3
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 37064 W: 10044 L: 9889 D: 17131
Ptnml(0-2): 162, 4115, 9828, 4260, 167

LTC https://tests.stockfishchess.org/tests/view/62d66cc047ae1768b34a2b14
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 39832 W: 10796 L: 10659 D: 18377
Ptnml(0-2): 69, 3969, 11706, 4100, 72

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

bench: 5697891

2 years agoUpdate default net to nn-ad9b42354671.nnue
Joost VandeVondele [Mon, 11 Jul 2022 15:32:39 +0000 (17:32 +0200)]
Update default net to nn-ad9b42354671.nnue

using trainer branch https://github.com/glinscott/nnue-pytorch/pull/208 with a slightly
tweaked loss function (power 2.5 instead of 2.6), otherwise same training as in
the previous net update https://github.com/official-stockfish/Stockfish/pull/4100

passed STC:
LLR: 2.97 (-2.94,2.94) <0.00,2.50>
Total: 367536 W: 99465 L: 98573 D: 169498
Ptnml(0-2): 1820, 40994, 97117, 42148, 1689
https://tests.stockfishchess.org/tests/view/62cc43fe50dcbecf5fc1c5b8

passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 25032 W: 6802 L: 6553 D: 11677
Ptnml(0-2): 40, 2424, 7341, 2669, 42
https://tests.stockfishchess.org/tests/view/62ce5f421dacb46e4d5fd277

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

Bench: 5905619

2 years agoSimplify away some unneeded code in time management
Michael Chaly [Wed, 13 Jul 2022 08:59:54 +0000 (11:59 +0300)]
Simplify away some unneeded code in time management

The lower bound of the clamp is never used since complexity can't be negative and thus is unneeded.

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

No functional change

2 years agoLimit the researching at same depth.
Joost VandeVondele [Sat, 2 Jul 2022 06:55:05 +0000 (08:55 +0200)]
Limit the researching at same depth.

If the elapsed time is close to the available time, the time management thread can signal that the next iterations should be searched at the same depth (Threads.increaseDepth = false). While the rootDepth increases, the adjustedDepth is kept constant with the searchAgainCounter.

In exceptional cases, when threading is used and the master thread, which controls the time management, signals to not increaseDepth, but by itself takes a long time to finish the iteration, the helper threads can search repeatedly at the same depth. This search finishes more and more quickly, leading to helper threads that report a rootDepth of MAX_DEPTH (245). The latter is not optimal as it is confusing for the user, stops search on these threads, and leads to an incorrect bias in the thread voting scheme. Probably with only a small impact on strength.

This behavior was observed almost two years ago,
see https://github.com/official-stockfish/Stockfish/issues/2717

This patch fixes #2717 by ensuring the effective depth increases at once every four iterations,
even in increaseDepth is false.

Depth 245 searches (for non-trivial positions) were indeed absent with this patch,
but frequent with master in the tests below:
https://discord.com/channels/435943710472011776/813919248455827515/994872720800088095
Total pgns: 2173
Base: 2867
Patch: 0

it passed non-regression testing in various setups:

SMP STC:
https://tests.stockfishchess.org/tests/view/62bfecc96178ffe6394ba036
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 37288 W: 10171 L: 10029 D: 17088
Ptnml(0-2): 75, 3777, 10793, 3929, 70

SMP LTC:
https://tests.stockfishchess.org/tests/view/62c08f6f49b62510394be066
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 190568 W: 52125 L: 52186 D: 86257
Ptnml(0-2): 70, 17854, 59504, 17779, 77

LTC:
https://tests.stockfishchess.org/tests/view/62c08b6049b62510394bdfb6
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 48120 W: 13204 L: 13083 D: 21833
Ptnml(0-2): 54, 4458, 14919, 4571, 58

Special thanks to miguel-I,  Disservin, ruicoelhopedro and others for analysing the problem,
the data, and coming up with the key insight, needed to fix this longstanding issue.

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

Bench: 5182295

2 years agoTime mgmt fix division.
Dubslow [Fri, 1 Jul 2022 16:53:16 +0000 (11:53 -0500)]
Time mgmt fix division.

oversight changed the corresponding float division to integer division in a previous tune https://github.com/official-stockfish/Stockfish/commit/442c40b43de8ede1e424efa674c8d45322e3b43c it is stronger to keep the original float division.

green LTC: https://tests.stockfishchess.org/tests/view/62bf34bc0340fb1e0cc934e7
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 38952 W: 10738 L: 10467 D: 17747
Ptnml(0-2): 46, 3576, 11968, 3833, 53

yellow STC: https://tests.stockfishchess.org/tests/view/62bff6506178ffe6394ba1d1
LLR: -2.95 (-2.94,2.94) <0.00,2.50>
Total: 226960 W: 61265 L: 61062 D: 104633
Ptnml(0-2): 938, 24398, 62582, 24647, 915

further slightly tweaked tests confirm this Elo gain.

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

No functional change

2 years agoSimplify away FRC correction term
Michael Chaly [Tue, 5 Jul 2022 11:15:34 +0000 (14:15 +0300)]
Simplify away FRC correction term

Since new net is trained partially using FRC data this part of adjustment that penalises bishops that are locked in the corner is no longer needed - net should "know" this things itself much better.

STC on FRC book :
https://tests.stockfishchess.org/tests/view/62c3031b9e7d9997a12d852f
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 22048 W: 3003 L: 2845 D: 16200
Ptnml(0-2): 96, 1778, 7149, 1874, 127

LTC on FRC book :
https://tests.stockfishchess.org/tests/view/62c32e939e7d9997a12d8c5e
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 36784 W: 3138 L: 3037 D: 30609
Ptnml(0-2): 36, 1842, 14537, 1939, 38

STC on DFRC book :
https://tests.stockfishchess.org/tests/view/62c32efb9e7d9997a12d8c6f
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 20424 W: 3903 L: 3721 D: 12800
Ptnml(0-2): 172, 1984, 5724, 2154, 178

LTC on DFRC book :
https://tests.stockfishchess.org/tests/view/62c358c79e7d9997a12d9319
LLR: 2.93 (-2.94,2.94) <-2.25,0.25>
Total: 53784 W: 7581 L: 7480 D: 38723
Ptnml(0-2): 87, 3887, 18856, 3962, 100

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

bench 5182295

2 years agoUpdate default net to nn-3c0054ea9860.nnu
Joost VandeVondele [Fri, 1 Jul 2022 13:07:49 +0000 (15:07 +0200)]
Update default net to nn-3c0054ea9860.nnu

First things first...

this PR is being made from court. Today, Tord and Stéphane, with broad support
of the developer community are defending their complaint, filed in Munich, against ChessBase.
With their products Houdini 6 and Fat Fritz 2, both Stockfish derivatives,
ChessBase violated repeatedly the Stockfish GPLv3 license. Tord and Stéphane have terminated
their license with ChessBase permanently. Today we have the opportunity to present
our evidence to the judge and enforce that termination. To read up, have a look at our blog post
https://stockfishchess.org/blog/2022/public-court-hearing-soon/ and
https://stockfishchess.org/blog/2021/our-lawsuit-against-chessbase/

This PR introduces a net trained with an enhanced data set and a modified loss function in the trainer.
A slight adjustment for the scaling was needed to get a pass on standard chess.

passed STC:
https://tests.stockfishchess.org/tests/view/62c0527a49b62510394bd610
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 135008 W: 36614 L: 36152 D: 62242
Ptnml(0-2): 640, 15184, 35407, 15620, 653

passed LTC:
https://tests.stockfishchess.org/tests/view/62c17e459e7d9997a12d458e
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 28864 W: 8007 L: 7749 D: 13108
Ptnml(0-2): 47, 2810, 8466, 3056, 53

Local testing at a fixed 25k nodes resulted in
Test run1026/easy_train_data/experiments/experiment_2/training/run_0/nn-epoch799.nnue
localElo: 4.2  +-      1.6

The real strength of the net is in FRC and DFRC chess where it gains significantly.

Tested at STC with slightly different scaling:
FRC:
https://tests.stockfishchess.org/tests/view/62c13a4002ba5d0a774d20d4
Elo: 29.78 +-3.4 (95%) LOS: 100.0%
Total: 10000 W: 2007 L: 1152 D: 6841
Ptnml(0-2): 31, 686, 2804, 1355, 124
nElo: 59.24 +-6.9 (95%) PairsRatio: 2.06

DFRC:
https://tests.stockfishchess.org/tests/view/62c13a5702ba5d0a774d20d9
Elo: 55.25 +-3.9 (95%) LOS: 100.0%
Total: 10000 W: 2984 L: 1407 D: 5609
Ptnml(0-2): 51, 636, 2266, 1779, 268
nElo: 96.95 +-7.2 (95%) PairsRatio: 2.98

Tested at LTC with identical scaling:
FRC:
https://tests.stockfishchess.org/tests/view/62c26a3c9e7d9997a12d6caf
Elo: 16.20 +-2.5 (95%) LOS: 100.0%
Total: 10000 W: 1192 L: 726 D: 8082
Ptnml(0-2): 10, 403, 3727, 831, 29
nElo: 44.12 +-6.7 (95%) PairsRatio: 2.08

DFRC:
https://tests.stockfishchess.org/tests/view/62c26a539e7d9997a12d6cb2
Elo: 40.94 +-3.0 (95%) LOS: 100.0%
Total: 10000 W: 2215 L: 1042 D: 6743
Ptnml(0-2): 10, 410, 3053, 1451, 76
nElo: 92.77 +-6.9 (95%) PairsRatio: 3.64

This is due to the mixing in a significant fraction of DFRC training data in the final training round. The net is
trained using the easy_train.py script in the following way:

```
python easy_train.py \
     --training-dataset=../Leela-dfrc_n5000.binpack \
     --experiment-name=2 \
     --nnue-pytorch-branch=vondele/nnue-pytorch/lossScan4 \
     --additional-training-arg=--param-index=2 \
     --start-lambda=1.0 \
     --end-lambda=0.75 \
     --gamma=0.995 \
     --lr=4.375e-4 \
     --start-from-engine-test-net True \
     --tui=False \
     --seed=$RANDOM \
     --max_epoch=800 \
     --auto-exit-timeout-on-training-finished=900 \
     --network-testing-threads 8  \
     --num-workers 12
```

where the data set used (Leela-dfrc_n5000.binpack) is a combination of our previous best data set (mix of Leela and some SF data) and DFRC data, interleaved to form:
The data is available in https://drive.google.com/drive/folders/1S9-ZiQa_3ApmjBtl2e8SyHxj4zG4V8gG?usp=sharing
Leela mix: https://drive.google.com/file/d/1JUkMhHSfgIYCjfDNKZUMYZt6L5I7Ra6G/view?usp=sharing
DFRC: https://drive.google.com/file/d/17vDaff9LAsVo_1OfsgWAIYqJtqR8aHlm/view?usp=sharing

The training branch used is
https://github.com/vondele/nnue-pytorch/commits/lossScan4
A PR to the main trainer repo will be made later. This contains a revised loss function, now computing the loss from the score based on the win rate model, which is a more accurate representation than what we had before. Scaling constants are tweaked there as well.

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

Bench: 5186781

2 years agoUse NNUE complexity in search, retune related parameters
Dubslow [Fri, 10 Jun 2022 13:11:02 +0000 (08:11 -0500)]
Use NNUE complexity in search, retune related parameters

This builds on ideas of xoto10 and mstembera to use more output from NNUE in the search algorithm.

passed STC:
https://tests.stockfishchess.org/tests/view/62ae454fe7ee5525ef88a957
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 89208 W: 24127 L: 23753 D: 41328
Ptnml(0-2): 400, 9886, 23642, 10292, 384

passed LTC:
https://tests.stockfishchess.org/tests/view/62acc6ddd89eb6cf1e0750a1
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 56352 W: 15430 L: 15115 D: 25807
Ptnml(0-2): 44, 5501, 16782, 5794, 55

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

bench 5332964

2 years agoLMR: remove `deeper`
Dubslow [Wed, 15 Jun 2022 22:30:32 +0000 (17:30 -0500)]
LMR: remove `deeper`

...apparently it wasn't doing much anymore. inspired by rufish's recent attempts to improve this.

passed STC:
https://tests.stockfishchess.org/tests/view/62abca2cd89eb6cf1e072c04
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 85576 W: 22766 L: 22683 D: 40127
Ptnml(0-2): 362, 9607, 22741, 9742, 336

passed LTC:
https://tests.stockfishchess.org/tests/view/62ac90ffd89eb6cf1e07488f
LLR: 2.93 (-2.94,2.94) <-2.25,0.25>
Total: 48248 W: 13018 L: 12896 D: 22334
Ptnml(0-2): 32, 4773, 14400, 4879, 40

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

bench 5578988

2 years agoDon't change ttPv at probCut
bmc4 [Thu, 16 Jun 2022 10:19:39 +0000 (07:19 -0300)]
Don't change ttPv at probCut

STC:
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 35672 W: 9618 L: 9462 D: 16592
Ptnml(0-2): 151, 3890, 9601, 4040, 154
https://tests.stockfishchess.org/tests/view/62ab03f750949cfc241b1965

LTC:
LLR: 2.93 (-2.94,2.94) <-2.25,0.25>
Total: 54160 W: 14626 L: 14511 D: 25023
Ptnml(0-2): 42, 5414, 16056, 5523, 45
https://tests.stockfishchess.org/tests/view/62ab5e6fd89eb6cf1e071b87

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

bench: 5798229

2 years agoSimplify away condition in ttSave in probCut
bmc4 [Thu, 9 Jun 2022 13:37:24 +0000 (10:37 -0300)]
Simplify away condition in ttSave in probCut

Remove condition for tte->save in probCut so it always saves on probCut cutoff.

STC:
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 47848 W: 12921 L: 12782 D: 22145
Ptnml(0-2): 207, 5340, 12715, 5431, 231
https://tests.stockfishchess.org/tests/view/62a1f7c87bd8e641e44436f7

LTC:
LLR: 2.97 (-2.94,2.94) <-2.25,0.25>
Total: 132736 W: 35895 L: 35881 D: 60960
Ptnml(0-2): 109, 13384, 39360, 13414, 101
https://tests.stockfishchess.org/tests/view/62a2421a7bd8e641e444434f

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

bench: 5845802

2 years agoMinor simplifications and cleanup in search
mstembera [Mon, 6 Jun 2022 02:32:05 +0000 (19:32 -0700)]
Minor simplifications and cleanup in search

STC: https://tests.stockfishchess.org/tests/view/629d6775593a4a9b6482c1ec
LLR: 2.93 (-2.94,2.94) <-2.25,0.25>
Total: 77416 W: 20683 L: 20589 D: 36144
Ptnml(0-2): 317, 8690, 20620, 8744, 337

LTC: https://tests.stockfishchess.org/tests/view/629db4be593a4a9b6482ceef
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 106544 W: 28752 L: 28705 D: 49087
Ptnml(0-2): 97, 10692, 31641, 10751, 91

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

Bench: 5913510

2 years agoRestore NDKv21 for GitHub Actions
ppigazzini [Mon, 13 Jun 2022 20:08:01 +0000 (22:08 +0200)]
Restore NDKv21 for GitHub Actions

GitHub updated the versions of NDK installed on the Actions runners
breaking the ARM tests.
Restore the NDKv21 using the GitHub suggested mitigation, see:
https://github.com/actions/virtual-environments/issues/5595

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

No functional change

2 years agoUse qsearch on step 11 if depth is equal to or below 0
candirufish [Tue, 7 Jun 2022 05:21:43 +0000 (07:21 +0200)]
Use qsearch on step 11 if depth is equal to or below 0

larger reduction of depth if no TT entry is found, and go in qsearch as needed.

stc:
https://tests.stockfishchess.org/tests/view/629dfacd593a4a9b6482db72
LLR: 2.93 (-2.94,2.94) <0.00,2.50>
Total: 31920 W: 8591 L: 8322 D: 15007
Ptnml(0-2): 127, 3551, 8376, 3738, 168

ltc:
https://tests.stockfishchess.org/tests/view/629e304e593a4a9b6482e451
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 17488 W: 4842 L: 4614 D: 8032
Ptnml(0-2): 13, 1670, 5151, 1896, 14

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

Bench: 5870283

2 years agoWording of help output and comments.
Boštjan Mejak [Tue, 31 May 2022 18:25:57 +0000 (20:25 +0200)]
Wording of help output and comments.

Improved the output text that is diplayed when executing the 'help' command.
Also, some comments were fixed along the way.

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

No functional change

2 years agoRemove LMR condition for complex pos
Dubslow [Mon, 30 May 2022 00:52:11 +0000 (19:52 -0500)]
Remove LMR condition for complex pos

Inspired by Kia's similar test: https://tests.stockfishchess.org/tests/view/6292898c1e7cd5f29966fbe0

Passed STC:
https://tests.stockfishchess.org/tests/view/62941588b0d5a7d1b780ed4b
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 266872 W: 70850 L: 71033 D: 124989
Ptnml(0-2): 1180, 30114, 70941, 30111, 1090

Passed LTC:
https://tests.stockfishchess.org/tests/view/62964a754628d33daa24f062
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 70160 W: 18756 L: 18662 D: 32742
Ptnml(0-2): 42, 6976, 20950, 7070, 42

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

Bench 6237567

2 years agoBlend nnue complexity with classical.
xoto10 [Wed, 1 Jun 2022 00:20:27 +0000 (01:20 +0100)]
Blend nnue complexity with classical.

Following mstembera's test of the complexity value derived from nnue values,
this change blends that idea with the old complexity calculation.

STC 10+0.1:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 42320 W: 11436 L: 11148 D: 19736
Ptnml(0-2): 209, 4585, 11263, 4915, 188
https://tests.stockfishchess.org/tests/live_elo/6295c9239c8c2fcb2bad7fd9

LTC 60+0.6:
LLR: 2.98 (-2.94,2.94) <0.50,3.00>
Total: 34600 W: 9393 L: 9125 D: 16082
Ptnml(0-2): 32, 3323, 10319, 3597, 29
https://tests.stockfishchess.org/tests/view/6295fd5d9c8c2fcb2bad88cf

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

Bench 6078140

2 years agocutnode and movecount lmr extension simplification
candirufish [Tue, 31 May 2022 19:52:04 +0000 (21:52 +0200)]
cutnode and movecount lmr extension simplification

Passed STC
https://tests.stockfishchess.org/tests/view/6294133cb0d5a7d1b780ece3
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 41072 W: 11052 L: 10908 D: 19112
Ptnml(0-2): 153, 4324, 11461, 4422, 176

Passed LTC
ltc: https://tests.stockfishchess.org/tests/view/62947ae6b0d5a7d1b780fe86
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 102736 W: 27509 L: 27459 D: 47768
Ptnml(0-2): 98, 9734, 31669, 9754, 113

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

Bench: 6410652

2 years agoAdd info about elo gained from some heuristics
Michael Chaly [Mon, 30 May 2022 10:30:59 +0000 (13:30 +0300)]
Add info about elo gained from some heuristics

Add info about qsearch and impact of main and continuation histories.

Based on these tests:
https://tests.stockfishchess.org/tests/view/62946ffcb0d5a7d1b780fc7e
https://tests.stockfishchess.org/tests/view/628facb71e7cd5f299669534
https://tests.stockfishchess.org/tests/view/628eade11e7cd5f299666f2e

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

No functional change.

2 years agoAdjust scale param higher
xoto10 [Thu, 19 May 2022 07:51:40 +0000 (08:51 +0100)]
Adjust scale param higher

xoto10's scaleopt tune resulted in a yellow LTC, but the main parameter shift looked almost exactly like the tune rate reduction schedule,
so further increases of that param were tried. Joint work xoto10 and dubslow.

passed LTC:
https://tests.stockfishchess.org/tests/view/628c709372775f382300f03e
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 70112 W: 18932 L: 18584 D: 32596
Ptnml(0-2): 66, 6904, 20757, 7274, 55

failed STC:
https://tests.stockfishchess.org/tests/view/6290e4441e7cd5f29966bdc8
LLR: -2.96 (-2.94,2.94) <0.00,2.50>
Total: 59976 W: 15919 L: 16018 D: 28039
Ptnml(0-2): 250, 6791, 15974, 6754, 219

similar LTC's were yellow
first yellow LTC: https://tests.stockfishchess.org/tests/view/6288a33f817227d3e5c5b05d
double exaggerate yellow: https://tests.stockfishchess.org/tests/live_elo/628e140372775f38230129a6
triple exaggerate yellow: https://tests.stockfishchess.org/tests/live_elo/628e2caf72775f3823012d45

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

bench 6410652

2 years agoImprove handling of variables set in the make environment
proukornew [Thu, 16 Dec 2021 21:41:29 +0000 (00:41 +0300)]
Improve handling of variables set in the make environment

removes duplication on the commandline for example in a profile-build

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

No functional change

2 years agoSmall speedup in futility_move_count
Giacomo Lorenzetti [Sun, 22 May 2022 10:47:30 +0000 (12:47 +0200)]
Small speedup in futility_move_count

The speedup is around 0.25% using gcc 11.3.1 (bmi2, nnue bench, depth 16
and 23) while it is neutral using clang (same conditions).

According to `perf` that integer division was one of the most time-consuming
instructions in search (gcc disassembly).

Passed STC:
https://tests.stockfishchess.org/tests/view/628a17fe24a074e5cd59b3aa
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 22232 W: 5992 L: 5751 D: 10489
Ptnml(0-2): 88, 2235, 6218, 2498, 77

yellow LTC:
https://tests.stockfishchess.org/tests/view/628a35d7ccae0450e35106f7
LLR: -2.95 (-2.94,2.94) <0.50,3.00>
Total: 320168 W: 85853 L: 85326 D: 148989
Ptnml(0-2): 185, 29698, 99821, 30165, 215

This patch also suggests that UHO STC is sensible to small speedups (< 0.50%).

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

No functional change

2 years agoAdd command line flags to link to information
Joost VandeVondele [Fri, 20 May 2022 05:42:33 +0000 (07:42 +0200)]
Add command line flags to link to information

This patch provides command line flags `--help` and `--license` as well as the corresponding `help` and `license` commands.

```
$ ./stockfish --help
Stockfish 200522 by the Stockfish developers (see AUTHORS file)

Stockfish is a powerful chess engine and free software licensed under the GNU GPLv3.
Stockfish is normally used with a separate graphical user interface (GUI).
Stockfish implements the universal chess interface (UCI) to exchange information.
For further information see https://github.com/official-stockfish/Stockfish#readme
or the corresponding README.md and Copying.txt files distributed with this program.

```

The idea is to provide a minimal help that links to the README.md file,
not replicating information that is already available elsewhere.

We use this opportunity to explicitly report the license as well.

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

No functional change.

2 years agoAssorted small cleanups
Giacomo Lorenzetti [Fri, 1 Apr 2022 16:33:25 +0000 (18:33 +0200)]
Assorted small cleanups

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

No functional change

2 years agoSimplify a condition
candirufish [Sat, 21 May 2022 02:20:09 +0000 (04:20 +0200)]
Simplify a condition

Principal variation depth late move reduction extension simplification.

stc:
https://tests.stockfishchess.org/tests/view/6285a1d19d18a78568e7fa24
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 428536 W: 113433 L: 113851 D: 201252
Ptnml(0-2): 1671, 48606, 114090, 48272, 1629

ltc:
https://tests.stockfishchess.org/tests/view/62871d20375cdc5de8cf5db3
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 56792 W: 15123 L: 15011 D: 26658
Ptnml(0-2): 42, 5681, 16825, 5819, 29

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

bench: 6501437

2 years agoTune scale and optimism.
xoto10 [Sun, 15 May 2022 12:14:28 +0000 (13:14 +0100)]
Tune scale and optimism.

Tune scale and optimism in effort to make stockfish play more aggressively.

STC @ 10+0.1 th 1:
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 27896 W: 7506 L: 7248 D: 13142
Ptnml(0-2): 103, 3047, 7388, 3309, 101
https://tests.stockfishchess.org/tests/live_elo/627fd0cfab44257388ab1f13

LTC @ 60+0.6 th 1:
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 65576 W: 17512 L: 17178 D: 30886
Ptnml(0-2): 37, 6397, 19587, 6729, 38
https://tests.stockfishchess.org/tests/live_elo/627ff666ab44257388ab256d

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

Bench 6407734

2 years agoSE depth scaling using the previous depth
disservin [Sat, 14 May 2022 10:10:13 +0000 (12:10 +0200)]
SE depth scaling using the previous depth

This patch makes the SE depth condition more robust and allows it to scale with completed depth
from a previous search.

At long TC this patch is almost equivalent to https://github.com/official-stockfish/Stockfish/pull/4016 which had

VLTC:
https://tests.stockfishchess.org/tests/view/626abd7e8707aa698c0093a8
Elo: 2.35 +-1.5 (95%) LOS: 99.9%
Total: 40000 W: 10991 L: 10720 D: 18289
Ptnml(0-2): 8, 3534, 12648, 3799, 11
nElo: 5.47 +-3.4 (95%) PairsRatio: 1.08

VLTC multicore:
https://tests.stockfishchess.org/tests/view/6272a6afc8f14123163c1997
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 86808 W: 24165 L: 23814 D: 38829
Ptnml(0-2): 11, 7253, 28524, 7606, 10

however, it is now also gaining at LTC:

LTC:
https://tests.stockfishchess.org/tests/view/627e7cb523c0c72a05b651a9
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 27064 W: 7285 L: 7046 D: 12733
Ptnml(0-2): 8, 2446, 8390, 2675, 13

and should have nearly no influence at STC as depth 27 is rarely reached.
It was noticed that initializing the threshold with MAX_PLY, had an adverse effect,
possibly because the first move is sensitive to this.

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

Bench: 6481017

2 years agoUpdate NNUE architecture to SFNNv5. Update network to nn-3c0aa92af1da.nnue.
Tomasz Sobczyk [Fri, 13 May 2022 15:26:50 +0000 (17:26 +0200)]
Update NNUE architecture to SFNNv5. Update network to nn-3c0aa92af1da.nnue.

Architecture changes:

    Duplicated activation after the 1024->15 layer with squared crelu (so 15->15*2). As proposed by vondele.

Trainer changes:

    Added bias to L1 factorization, which was previously missing (no measurable improvement but at least neutral in principle)
    For retraining linearly reduce lambda parameter from 1.0 at epoch 0 to 0.75 at epoch 800.
    reduce max_skipping_rate from 15 to 10 (compared to vondele's outstanding PR)

Note: This network was trained with a ~0.8% error in quantization regarding the newly added activation function.
      This will be fixed in the released trainer version. Expect a trainer PR tomorrow.

Note: The inference implementation cuts a corner to merge results from two activation functions.
       This could possibly be resolved nicer in the future. AVX2 implementation likely not necessary, but NEON is missing.

First training session invocation:

python3 train.py \
    ../nnue-pytorch-training/data/nodes5000pv2_UHO.binpack \
    ../nnue-pytorch-training/data/nodes5000pv2_UHO.binpack \
    --gpus "$3," \
    --threads 4 \
    --num-workers 8 \
    --batch-size 16384 \
    --progress_bar_refresh_rate 20 \
    --random-fen-skipping 3 \
    --features=HalfKAv2_hm^ \
    --lambda=1.0 \
    --max_epochs=400 \
    --default_root_dir ../nnue-pytorch-training/experiment_$1/run_$2

Second training session invocation:

python3 train.py \
    ../nnue-pytorch-training/data/T60T70wIsRightFarseerT60T74T75T76.binpack \
    ../nnue-pytorch-training/data/T60T70wIsRightFarseerT60T74T75T76.binpack \
    --gpus "$3," \
    --threads 4 \
    --num-workers 8 \
    --batch-size 16384 \
    --progress_bar_refresh_rate 20 \
    --random-fen-skipping 3 \
    --features=HalfKAv2_hm^ \
    --start-lambda=1.0 \
    --end-lambda=0.75 \
    --gamma=0.995 \
    --lr=4.375e-4 \
    --max_epochs=800 \
    --resume-from-model /data/sopel/nnue/nnue-pytorch-training/data/exp367/nn-exp367-run3-epoch399.pt \
    --default_root_dir ../nnue-pytorch-training/experiment_$1/run_$2

Passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 27288 W: 7445 L: 7178 D: 12665
Ptnml(0-2): 159, 3002, 7054, 3271, 158
https://tests.stockfishchess.org/tests/view/627e8c001919125939623644

Passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 21792 W: 5969 L: 5727 D: 10096
Ptnml(0-2): 25, 2152, 6294, 2406, 19
https://tests.stockfishchess.org/tests/view/627f2a855734b18b2e2ece47

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

Bench: 6481017

2 years agoReduce depth after score improvement at PV nodes
Stéphane Nicolet [Wed, 4 May 2022 05:39:23 +0000 (07:39 +0200)]
Reduce depth after score improvement at PV nodes

STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 73760 W: 19590 L: 19244 D: 34926
Ptnml(0-2): 285, 8352, 19292, 8634, 317
https://tests.stockfishchess.org/tests/view/626eb2dc9116b52aa83b73da

LTC:
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 114400 W: 30561 L: 30111 D: 53728
Ptnml(0-2): 68, 11432, 33785, 11812, 103
https://tests.stockfishchess.org/tests/view/626f730859e9c431e0b10b21

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

bench: 6174823

2 years agoUse fail high count for LMR
candirufish [Tue, 3 May 2022 10:35:21 +0000 (12:35 +0200)]
Use fail high count for LMR

Increase reduction if next ply has a lot of fail high else reset count to 0

Passed STC:
https://tests.stockfishchess.org/tests/view/626ea8299116b52aa83b71f6
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 144288 W: 38377 L: 37902 D: 68009
Ptnml(0-2): 565, 16298, 38054, 16551, 676

Passed LTC:
https://tests.stockfishchess.org/tests/view/626fa0fb79f761bab2e382f0
LLR: 2.98 (-2.94,2.94) <0.50,3.00>
Total: 74872 W: 20050 L: 19686 D: 35136
Ptnml(0-2): 51, 7541, 21893, 7895, 56

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

bench: 7084802