]> git.sesse.net Git - stockfish/log
stockfish
15 months agoExtract bench according to wiki instructions
ppigazzini [Fri, 16 Jun 2023 11:01:20 +0000 (13:01 +0200)]
Extract bench according to wiki instructions

- loop through the commits starting from the latest one
- read the bench value from the last match, if any, of the template
  in the commit body text

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

No functional change

15 months agosimplified gives check castling
rn5f107s2 [Fri, 16 Jun 2023 16:49:31 +0000 (18:49 +0200)]
simplified gives check castling

tested verifying perft and bench is unchanged
on a larger set of epds for both standard and FRC chess.

Passed non-regression STC:
https://tests.stockfishchess.org/tests/live_elo/648587be65ffe077ca123d78
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 153632 W: 41015 L: 40928 D: 71689
Ptnml(0-2): 377, 16077, 43816, 16174, 372

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

No functional change

15 months agoImproving grammar and readability of comments
FauziAkram [Tue, 27 Jun 2023 12:13:59 +0000 (15:13 +0300)]
Improving grammar and readability of comments

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

No functional change

15 months agoSimplify score improvement reduction
Muzhen Gaming [Thu, 22 Jun 2023 11:19:21 +0000 (19:19 +0800)]
Simplify score improvement reduction

Reduce depth by 2 based on score improvement, only for depths 3 to 11.

Simplification STC: https://tests.stockfishchess.org/tests/view/64929a53dc7002ce609c7807
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 238912 W: 63466 L: 63468 D: 111978
Ptnml(0-2): 564, 26262, 65805, 26262, 563

Simplification LTC: https://tests.stockfishchess.org/tests/view/64942e47dc7002ce609c9e07
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 64452 W: 17485 L: 17320 D: 29647
Ptnml(0-2): 19, 6161, 19706, 6316, 24

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

Bench: 2740142

15 months agoSimplify away improvement term in null move search
Muzhen Gaming [Wed, 28 Jun 2023 10:36:11 +0000 (18:36 +0800)]
Simplify away improvement term in null move search

passed STC:
https://tests.stockfishchess.org/tests/view/649c0d2edc7002ce609d33b5
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 271104 W: 72181 L: 72217 D: 126706
Ptnml(0-2): 691, 30042, 74129, 29992, 698

passed LTC:
https://tests.stockfishchess.org/tests/view/649d0dd7dc7002ce609d4efa
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 183120 W: 49469 L: 49418 D: 84233
Ptnml(0-2): 84, 17636, 56063, 17699, 78

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

Bench: 2642851

15 months agoFix pruning to (in TB loss) in Null move pruning.
peregrineshahin [Tue, 27 Jun 2023 03:07:20 +0000 (06:07 +0300)]
Fix pruning to (in TB loss) in Null move pruning.

Current logic can apply Null move pruning
on a dead-lost position returning an unproven loss
(i.e. in TB loss score or mated in losing score) on nonPv nodes.

on a default bench, this can be observed by adding this debugging line:
```
if (nullValue >= beta)
{
    // Do not return unproven mate or TB scores
    nullValue = std::min(nullValue, VALUE_TB_WIN_IN_MAX_PLY-1);
    dbg_hit_on(nullValue <= VALUE_TB_LOSS_IN_MAX_PLY); // Hit #0: Total 73983 Hits 1 Hit Rate (%) 0.00135166
    if (thisThread->nmpMinPly || depth < 14)
        return nullValue;
```

This fixes this very rare issue (happens at ~0.00135166% of the time) by
eliminating the need to try Null Move Pruning with dead-lost positions
and leaving it to be determined by a normal searching flow.

The previous try to fix was not as safe enough because it was capping
the returned value to (out of TB range) thus reviving the dead-lost position
based on an artificial clamp (i.e. the in TB score/mate score can be lost on that nonPv node):
https://tests.stockfishchess.org/tests/view/649756d5dc7002ce609cd794

Final fix:
Passed STC:
https://tests.stockfishchess.org/tests/view/649a5446dc7002ce609d1049
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 577280 W: 153613 L: 153965 D: 269702
Ptnml(0-2): 1320, 60594, 165190, 60190, 1346

Passed LTC:
https://tests.stockfishchess.org/tests/view/649cd048dc7002ce609d4801
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 246432 W: 66769 L: 66778 D: 112885
Ptnml(0-2): 83, 22105, 78847, 22100, 81

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

Bench: 2425978

15 months agoSimplify lookup_count and clean up pieces().
mstembera [Mon, 3 Jul 2023 02:48:18 +0000 (19:48 -0700)]
Simplify lookup_count and clean up pieces().

https://github.com/official-stockfish/Stockfish/pull/4656

No functional change

15 months agoAdd bmi2 to CI generated binaries
disservin [Mon, 3 Jul 2023 06:20:56 +0000 (08:20 +0200)]
Add bmi2 to CI generated binaries

verify bench for avx2 and bmi2 as well

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

No functional change

16 months agoMake posix and msys2 shells consistent in CI
ppigazzini [Sat, 1 Jul 2023 12:36:52 +0000 (14:36 +0200)]
Make posix and msys2 shells consistent in CI

In CI, it is typical for the process to halt immediately when an error
is encountered. However, with our `shell: bash {0}` configuration,
the process continues despite errors for posix shells.
This commit updates the behavior of posix and msys2 shells to ensure
consistency in terms of pipeline exit codes and stop conditions.
We adopt the most appropriate default behavior as recommended
by the GitHub documentation.

Update the code that searches for the bench value in the git log:
- to be compatible with the new shell settings
- to retry the value from the first line that contains
  only the template and spaces/tabs/newlines

see also

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
https://github.com/msys2/setup-msys2/blob/main/main.js

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

No functional change

16 months agoUpdate NNUE architecture to SFNNv7 with larger L1 size of 2048
Linmiao Xu [Sun, 25 Jun 2023 21:44:28 +0000 (17:44 -0400)]
Update NNUE architecture to SFNNv7 with larger L1 size of 2048

Creating this net involved:
- a 5-step training process from scratch
- greedy permuting L1 weights with https://github.com/official-stockfish/Stockfish/pull/4620
- leb128 compression with https://github.com/glinscott/nnue-pytorch/pull/251
- greedy 2- and 3- cycle permuting with https://github.com/official-stockfish/Stockfish/pull/4640

The 5 training steps were:

1. 400 epochs, lambda 1.0, lr 9.75e-4
   UHOx2-wIsRight-multinet-dfrc-n5000-largeGensfen-d9.binpack (178G)
     nodes5000pv2_UHO.binpack
     data_pv-2_diff-100_nodes-5000.binpack
     wrongIsRight_nodes5000pv2.binpack
     multinet_pv-2_diff-100_nodes-5000.binpack
     dfrc_n5000.binpack
     large_gensfen_multipvdiff_100_d9.binpack
   ep399 chosen as start model for step2

2. 800 epochs, end-lambda 0.75, skip 16
   LeelaFarseer-T78juntoaugT79marT80dec.binpack (141G)
     T60T70wIsRightFarseerT60T74T75T76.binpack
     test78-junjulaug2022-16tb7p.no-db.min.binpack
     test79-mar2022-16tb7p.no-db.min.binpack
     test80-dec2022-16tb7p.no-db.min.binpack
   ep559 chosen as start model for step3

3. 800 epochs, end-lambda 0.725, skip 20
   leela96-dfrc99-v2-T80dectofeb-sk20-mar-v6-T77decT78janfebT79apr.binpack (223G)
     leela96-filt-v2.min.binpack
     dfrc99-16tb7p-eval-filt-v2.min.binpack
     test80-dec2022-16tb7p-filter-v6-sk20.min-mar2023.binpack
     test80-jan2023-16tb7p-filter-v6-sk20.min-mar2023.binpack
     test80-feb2023-16tb7p-filter-v6-sk20.min-mar2023.binpack
     test80-mar2023-2tb7p-filter-v6.min.binpack
     test77-dec2021-16tb7p.no-db.min.binpack
     test78-janfeb2022-16tb7p.no-db.min.binpack
     test79-apr2022-16tb7p.no-db.min.binpack
   ep499 chosen as start model for step4

4. 800 epochs, end-lambda 0.7, skip 24
   0dd1cebea57 dataset https://github.com/official-stockfish/Stockfish/pull/4606
   ep599 chosen as start model for step5

5. 800 epochs, end-lambda 0.7, skip 28
   same dataset as step4
   ep619 became nn-1b951f8b449d.nnue

For the final step5 training:

python3 easy_train.py \
  --experiment-name L1-2048-S5-sameData-sk28-S4-0dd1cebea57-shuffled-S3-leela96-dfrc99-v2-T80dectofeb-sk20-mar-v6-T77decT78janfebT79apr-sk20-S2-LeelaFarseerT78T79T80-ep399-S1-UHOx2-wIsRight-multinet-dfrc-n5000-largeGensfen-d9 \
  --training-dataset /data/leela96-dfrc99-T60novdec-v2-T80juntonovjanfebT79aprmayT78jantosepT77dec-v6dd-T80apr.binpack \
  --early-fen-skipping 28 \
  --nnue-pytorch-branch linrock/nnue-pytorch/misc-fixes-L1-2048 \
  --engine-test-branch linrock/Stockfish/L1-2048 \
  --start-from-engine-test-net False \
  --start-from-model /data/experiments/experiment_L1-2048-S4-0dd1cebea57-shuffled-S3-leela96-dfrc99-v2-T80dectofeb-sk20-mar-v6-T77decT78janfebT79apr-sk20-S2-LeelaFarseerT78T79T80-ep399-S1-UHOx2-wIsRight-multinet-dfrc-n5000-largeGensfen-d9/training/run_0/nn-epoch599.nnue
  --max_epoch 800 \
  --lr 4.375e-4 \
  --gamma 0.995 \
  --start-lambda 1.0 \
  --end-lambda 0.7 \
  --tui False \
  --seed $RANDOM \
  --gpus 0

SF training data components for the step1 dataset:
https://drive.google.com/drive/folders/1yLCEmioC3Xx9KQr4T7uB6GnLm5icAYGU

Leela training data for steps 2-5 can be found at:
https://robotmoon.com/nnue-training-data/

Due to larger L1 size and slower inference, the speed penalty loses elo
at STC. Measurements from 100 bench runs at depth 13 with x86-64-modern
on Intel Core i5-1038NG7 2.00GHz:

sf_base =  1240730  +/-   3443 (95%)
sf_test =  1153341  +/-   2832 (95%)
diff    =   -87388  +/-   1616 (95%)
speedup = -7.04330% +/- 0.130% (95%)

Local elo at 25k nodes per move (vs. L1-1536 nn-fdc1d0fe6455.nnue):
nn-epoch619.nnue : 21.1 +/- 3.2

Failed STC:
https://tests.stockfishchess.org/tests/view/6498ee93dc7002ce609cf979
LLR: -2.95 (-2.94,2.94) <0.00,2.00>
Total: 11680 W: 3058 L: 3299 D: 5323
Ptnml(0-2): 44, 1422, 3149, 1181, 44

LTC:
https://tests.stockfishchess.org/tests/view/649b32f5dc7002ce609d20cf
Elo: 0.68 ± 1.5 (95%) LOS: 80.5%
Total: 40000 W: 10887 L: 10809 D: 18304
Ptnml(0-2): 36, 3938, 11958, 4048, 20
nElo: 1.50 ± 3.4 (95%) PairsRatio: 1.02

Passed VLTC 180+1.8:
https://tests.stockfishchess.org/tests/view/64992b43dc7002ce609cfd20
LLR: 3.06 (-2.94,2.94) <0.00,2.00>
Total: 38086 W: 10612 L: 10338 D: 17136
Ptnml(0-2): 9, 3316, 12115, 3598, 5

Passed VLTC SMP 60+0.6 th 8:
https://tests.stockfishchess.org/tests/view/649a21fedc7002ce609d0c7d
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 38936 W: 11091 L: 10820 D: 17025
Ptnml(0-2): 1, 2948, 13305, 3207, 7

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

Bench: 2505168

16 months agoNegative extension on cutNodes based on depth
cj5716 [Mon, 26 Jun 2023 11:40:22 +0000 (19:40 +0800)]
Negative extension on cutNodes based on depth

This patch was inspired by candirufish original attempt at negative extensions
here that failed yellow: https://tests.stockfishchess.org/tests/view/6486529065ffe077ca124f32

I tested some variations of the idea and tuned a depth condition for
a modified version of it here https://tests.stockfishchess.org/tests/view/648db80a91c58631ce31fe00
after noticing abnormal scaling (ie many passed STC but not LTC)
After some small tweaks I got the final version here

Passed STC:
LLR: 2.98 (-2.94,2.94) <0.00,2.00>
Total: 122208 W: 32776 L: 32350 D: 57082
Ptnml(0-2): 310, 13250, 33553, 13686, 305
https://tests.stockfishchess.org/tests/view/64997934dc7002ce609d01e3

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 145092 W: 39617 L: 39115 D: 66360
Ptnml(0-2): 54, 13691, 44552, 14197, 52
https://tests.stockfishchess.org/tests/view/649a1c5ddc7002ce609d0bff

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

Bench: 2637784

16 months agoDocument the LEB128 patch
Stéphane Nicolet [Tue, 27 Jun 2023 10:03:00 +0000 (12:03 +0200)]
Document the LEB128 patch

Add some comments and harmonize style for the LEB128 patch.

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

No functional change

16 months agoUpdate default net to nn-a3d1bfca1672.nnue
Daniel Monroe [Fri, 23 Jun 2023 22:36:27 +0000 (18:36 -0400)]
Update default net to nn-a3d1bfca1672.nnue

faster permutation of master net weights

Activation data taken from https://drive.google.com/drive/folders/1Ec9YuuRx4N03GPnVPoQOW70eucOKngQe?usp=sharing
Permutation found using https://github.com/Ergodice/nnue-pytorch/blob/836387a0e5e690431d404158c46648710f13904d/ftperm.py
See also https://github.com/glinscott/nnue-pytorch/pull/254

The algorithm greedily selects 2- and 3-cycles that can be permuted to increase the number of runs of zeroes. The percent of zero runs from the master net increased from 68.46 to 70.11 from 2-cycles and only increased to 70.32 when considering 3-cycles. Interestingly, allowing both halves of L1 to intermix when creating zero runs can give another 0.5% zero-run density increase with this method.

Measured speedup:

```
CPU: 16 x AMD Ryzen 9 3950X 16-Core Processor
Result of 50 runs

base (./stockfish.master ) = 1561556 +/- 5439
test (./stockfish.patch ) = 1575788 +/- 5427
diff = +14231 +/- 2636

speedup = +0.0091
P(speedup > 0) = 1.0000
```

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

No functional change

16 months agoRestore development
Joost VandeVondele [Sat, 1 Jul 2023 10:18:46 +0000 (12:18 +0200)]
Restore development

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

No functional change

16 months agoStockfish 16
Joost VandeVondele [Sat, 24 Jun 2023 06:58:17 +0000 (08:58 +0200)]
Stockfish 16

Official release version of Stockfish 16

Bench: 2593605

---

Stockfish 16

A new major release of Stockfish is now available at

https://stockfishchess.org/download/

*Quality of chess play*

Stockfish continues to demonstrate its ability to discover superior moves
with remarkable speed. In self-play against Stockfish 15, this new
release gains up to 50 Elo[1] and wins up to 12 times more game pairs[2]
than it loses. In major chess engine tournaments, Stockfish reliably tops
the rankings[3] winning the TCEC season 24 Superfinal, Swiss, Fischer
Random, and Double Random Chess tournaments and the CCC 19 Bullet,
20 Blitz, and 20 Rapid competitions. Leela Chess Zero[4] was the
challenger in most finals, putting top-engine chess now firmly in the
hands of teams embracing free and open-source software.

*Progress made*

This updated version of Stockfish introduces several enhancements,
including an upgraded neural net architecture (SFNNv6)[5], improved
implementation, and refined parameterization. The ongoing utilization
of Leela’s data combined with a novel inference approach exploiting
sparsity[6], and network compression[7] ensure a speedy evaluation and
modest binary sizes while allowing for more weights and higher accuracy.
The search has undergone more optimization, leading to improved
performance, particularly in longer analyses[8]. Additionally,
the Fishtest framework has been improved and is now able to run the
tests needed to validate new ideas with 10000s of CPU cores.

*Usability improvements*

Stockfish now comes with documentation, found in the wiki folder when
downloading it or on GitHub[9]. Additionally, Stockfish now includes
a clear and consistent forced tablebase win score, displaying a value
of 200 minus the number of plies required to reach a tablebase win[10].
Furthermore, the UCI_Elo option, to reduce its strength, has been
calibrated[11]. It is worth noting that the evaluation system remains
consistent with Stockfish 15.1[12], maintaining the choice that 100cp
means a 50% chance of winning the game against an equal opponent[13].
Finally, binaries of our latest development version are now provided
continuously as pre-releases on GitHub making it easier for
enthusiasts to download the latest and strongest version of
the program[14], we thank Roman Korba for having provided a similar
service for a long time.

*Thank you*

The success of the Stockfish project relies on the vibrant community
of passionate enthusiasts (we appreciate each and every one of you!)
who generously contribute their knowledge, time, and resources.
Together, this dedicated community works towards the common goal of
developing a powerful, freely accessible, and open-source chess engine.
We invite all chess enthusiasts to join the Fishtest testing framework
and contribute to the project[15].

The Stockfish team

[1] https://tests.stockfishchess.org/tests/view/649409f0dc7002ce609c99cc
[2] https://tests.stockfishchess.org/tests/view/649409d7dc7002ce609c99c6
[3] https://en.wikipedia.org/wiki/Stockfish_(chess)#Competition_results
[4] https://lczero.org/
[5] https://github.com/official-stockfish/Stockfish/commit/c1fff71
[6] https://github.com/official-stockfish/Stockfish/commit/38e6166
[7] https://github.com/official-stockfish/Stockfish/commit/a46087e
[8] https://github.com/official-stockfish/Stockfish/commit/472e726
[9] https://github.com/official-stockfish/Stockfish/wiki/
[10] https://github.com/official-stockfish/Stockfish/commit/def2966
[11] https://github.com/official-stockfish/Stockfish/commit/a08b8d4
[12] https://github.com/official-stockfish/Stockfish/commit/52e84e4
[13] https://github.com/official-stockfish/Stockfish/wiki/Stockfish-FAQ#interpretation-of-the-stockfish-evaluation
[14] https://github.com/official-stockfish/Stockfish/releases?q=prerelease%3Atrue
[15] https://stockfishchess.org/get-involved/

16 months agoUpdate default net to nn-5af11540bbfe.nnue
Linmiao Xu [Wed, 21 Jun 2023 04:43:46 +0000 (00:43 -0400)]
Update default net to nn-5af11540bbfe.nnue

Created by retraining the sparsified master net (nn-cd2ff4716c34.nnue) on
a 100% minified dataset including Leela transformers data from T80 may2023.

Weights permuted with the exact methods and code in:
https://github.com/official-stockfish/Stockfish/pull/4620

LEB128 compression done with the new serialize.py param in:
https://github.com/glinscott/nnue-pytorch/pull/251

Initially trained with max epoch 800. Around epoch 780, training was paused
and max epoch raised to 960.

python3 easy_train.py \
  --experiment-name L1-1536-sparse-master-retrain \
  --training-dataset /data/leela96-dfrc99-v2-T60novdecT77decT78jantosepT79aprmayT80juntonovjan-v6dd-T80febtomay2023.min.binpack \
  --early-fen-skipping 27 \
  --start-from-engine-test-net True \
  --max_epoch 960 \
  --lr 4.375e-4 \
  --gamma 0.995 \
  --start-lambda 1.0 \
  --end-lambda 0.7 \
  --tui False \
  --seed $RANDOM \
  --gpus 0

For preparing the training dataset (interleaved size 328G):

python3 interleave_binpacks.py \
  leela96-filt-v2.min.binpack \
  dfrc99-16tb7p-eval-filt-v2.min.binpack \
  filt-v6-dd-min/test60-novdec2021-12tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test77-dec2021-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test78-jantomay2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test78-juntosep2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test79-apr2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test79-may2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test80-jun2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test80-jul2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test80-aug2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test80-sep2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test80-oct2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test80-nov2022-16tb7p-filter-v6-dd.min.binpack \
  filt-v6-dd-min/test80-jan2023-16tb7p-filter-v6-dd.min.binpack \
  test80-2023/test80-feb2023-16tb7p-no-db.min.binpack \
  test80-2023/test80-mar2023-2tb7p-no-db.min.binpack \
  test80-2023/test80-apr2023-2tb7p-no-db.min.binpack \
  test80-2023/test80-may2023-2tb7p-no-db.min.binpack \
  /data/leela96-dfrc99-v2-T60novdecT77decT78jantosepT79aprmayT80juntonovjan-v6dd-T80febtomay2023.min.binpack

Minified binpacks and Leela T80 training data from 2023 available at:
https://robotmoon.com/nnue-training-data/

Local elo at 25k nodes per move:
nn-epoch879.nnue : 3.9 +/- 5.7

Passed STC:
https://tests.stockfishchess.org/tests/view/64928c1bdc7002ce609c7690
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 72000 W: 19242 L: 18889 D: 33869
Ptnml(0-2): 182, 7787, 19716, 8126, 189

Passed LTC:
https://tests.stockfishchess.org/tests/view/64930a37dc7002ce609c82e3
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 54552 W: 14978 L: 14647 D: 24927
Ptnml(0-2): 23, 5123, 16650, 5460, 20

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

bench 2593605

16 months agoFix Potential in TB cutoffs for NMP.
peregrineshahin [Mon, 12 Jun 2023 09:57:41 +0000 (12:57 +0300)]
Fix Potential in TB cutoffs for NMP.

Removes the second dependency on beta and caps the return value to VALUE_TB_WIN_IN_MAX_PLY - 1

Earlier tests:

STC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 193632 W: 51372 L: 51326 D: 90934
Ptnml(0-2): 447, 20111, 55687, 20091, 480
https://tests.stockfishchess.org/tests/view/6486ee4465ffe077ca125bc1

LTC:
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 331758 W: 89538 L: 89624 D: 152596
Ptnml(0-2): 114, 30121, 105516, 29993, 135
https://tests.stockfishchess.org/tests/view/6489401af42a44347ed7be42

updated constant:
LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 100260 W: 27143 L: 27017 D: 46100
Ptnml(0-2): 34, 8842, 32248, 8976, 30
https://tests.stockfishchess.org/tests/view/6492fcafdc7002ce609c818c

closes: https://github.com/official-stockfish/Stockfish/pull/4632
fixes: https://github.com/official-stockfish/Stockfish/issues/4598

bench: 2370027

16 months agoUpdate winrate model with June data
Joost VandeVondele [Thu, 22 Jun 2023 07:59:03 +0000 (09:59 +0200)]
Update winrate model with June data

Retained 748191776 scored positions for analysis

const int NormalizeToPawnValue = 328;
Corresponding spread = 60;
Corresponding normalized spread = 0.18337766691628035;
Draw rate at 0.0 eval at move 32 = 0.9914715947898592;

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

No functional change

16 months agoUpdate top CPU contributors
Joost VandeVondele [Tue, 20 Jun 2023 07:46:02 +0000 (09:46 +0200)]
Update top CPU contributors

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

No functional change

16 months agoFix failing CI of pull requests
disservin [Tue, 20 Jun 2023 16:27:20 +0000 (18:27 +0200)]
Fix failing CI of pull requests

adds a guard to prevent pull requests from trying to delete the previous pre-release

closing https://github.com/official-stockfish/Stockfish/pull/4631

No functional change.

16 months agoFix indentation in qsearch.
Joerg Oster [Tue, 20 Jun 2023 08:40:31 +0000 (10:40 +0200)]
Fix indentation in qsearch.

https://github.com/official-stockfish/Stockfish/pull/4630

No functional change.

16 months agocreate prereleases upon push to master
disservin [Tue, 13 Jun 2023 17:30:01 +0000 (19:30 +0200)]
create prereleases upon push to master

using github actions, create a prerelease for the latest commit to master.
As such a development version will be available on github, in addition to the latest release.

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

No functional change

16 months agoCompressed network parameters
maxim [Tue, 13 Jun 2023 20:09:05 +0000 (23:09 +0300)]
Compressed network parameters

Implemented LEB128 (de)compression for the feature transformer.
Reduces embedded network size from 70 MiB to 39 Mib.

The new nn-78bacfcee510.nnue corresponds to the master net compressed.

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

No functional change

16 months agoSmall cleanup
cj5716 [Thu, 15 Jun 2023 13:05:01 +0000 (21:05 +0800)]
Small cleanup

This non-functional change keeps formatting consistent.

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

Bench 2370027

16 months agoPermute master net weights to increase sparsity
AndrovT [Tue, 13 Jun 2023 01:00:04 +0000 (03:00 +0200)]
Permute master net weights to increase sparsity

Activation data collection using https://github.com/AndrovT/Stockfish/commit/ac468039ab544b03ad9a22c859a4217729c10a77 run as

bench 16 1 13 varied_1000.epd depth NNUE log.bin

on FENs from https://gist.github.com/AndrovT/7eae6918eb50764227e2bafe7938953c.

Permutation found using https://gist.github.com/AndrovT/359c831b7223c637e9156b01eb96949e.
Uses a greedy algorithm that goes sequentially through the output positions and
chooses a neuron for that position such that the number of nonzero quartets is the smallest.

Net weights permuted using https://gist.github.com/AndrovT/9e3fbaebb7082734dc84d27e02094cb3.

Benchmark:

Result of 100 runs of 'bench 16 1 13 default depth NNUE'
========================================================
base (...kfish-master) =     885869  +/- 7395
test (./stockfish    ) =     895885  +/- 7368
diff                   =     +10016  +/- 2984

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

Passed STC:
https://tests.stockfishchess.org/tests/view/648866c4713491385c804728
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 126784 W: 34003 L: 33586 D: 59195
Ptnml(0-2): 283, 13001, 36437, 13358, 313

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

No functional change.

16 months agoConsistent bench extraction with fishtest.
peregrineshahin [Wed, 14 Jun 2023 12:57:36 +0000 (15:57 +0300)]
Consistent bench extraction with fishtest.

Consistent with recent fishtest commit https://github.com/glinscott/fishtest/commit/c0d174396f7fb1c0b3243aaa6cc73769079f3ff9

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

No functional change

16 months agoRemove setting of static to none if in check in qsearch
Viren6 [Tue, 13 Jun 2023 21:26:20 +0000 (22:26 +0100)]
Remove setting of static to none if in check in qsearch

Small simplification

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/6487924d713491385c8034ae
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 59616 W: 15885 L: 15703 D: 28028
Ptnml(0-2): 144, 6130, 17086, 6296, 152

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

No functional change.

16 months agoFix for MSVC compilation.
Andreas Matthies [Tue, 13 Jun 2023 04:24:04 +0000 (06:24 +0200)]
Fix for MSVC compilation.

MSVC needs two more explicit casts to compile new affine_transform_sparse_input.
See https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_castsi256_ps
and https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_castsi128_ps

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

No functional change

16 months agoClean-up code indentation in qsearch
Stéphane Nicolet [Mon, 12 Jun 2023 21:26:42 +0000 (23:26 +0200)]
Clean-up code indentation in qsearch

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

No functional change

16 months agoImprove comments
Michael Chaly [Mon, 12 Jun 2023 19:13:08 +0000 (22:13 +0300)]
Improve comments

Fix comments for IIR, also document non-linear scaling in extensions.
Also add explicitly the bench, to fix an issue after the last commit.

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

bench 2370027

16 months agoUse block sparse input for the first layer.
AndrovT [Sun, 11 Jun 2023 01:24:04 +0000 (03:24 +0200)]
Use block sparse input for the first layer.

Use block sparse input for the first fully connected layer on architectures with at least SSSE3.

Depending on the CPU architecture, this yields a speedup of up to 10%, e.g.

```
Result of 100 runs of 'bench 16 1 13 default depth NNUE'

base (...ockfish-base) =     959345  +/- 7477
test (...ckfish-patch) =    1054340  +/- 9640
diff                   =     +94995  +/- 3999

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

CPU: 8 x AMD Ryzen 7 5700U with Radeon Graphics
Hyperthreading: on
```

Passed STC:
https://tests.stockfishchess.org/tests/view/6485aa0965ffe077ca12409c
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 8864 W: 2479 L: 2223 D: 4162
Ptnml(0-2): 13, 829, 2504, 1061, 25

This commit includes a net with reordered weights, to increase the likelihood of block sparse inputs,
but otherwise equivalent to the previous master net (nn-ea57bea57e32.nnue).

Activation data collected with https://github.com/AndrovT/Stockfish/tree/log-activations, running bench 16 1 13 varied_1000.epd depth NNUE on this data. Net parameters permuted with https://gist.github.com/AndrovT/9e3fbaebb7082734dc84d27e02094cb3.

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

No functional change

16 months agoAdd network export to CI
Joost VandeVondele [Mon, 12 Jun 2023 07:51:28 +0000 (09:51 +0200)]
Add network export to CI

verify the network written by export_net matches the original

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

No functional change

16 months agoUpdate default net to nn-ea57bea57e32.nnue
Linmiao Xu [Wed, 7 Jun 2023 18:57:17 +0000 (14:57 -0400)]
Update default net to nn-ea57bea57e32.nnue

Created by retraining an earlier epoch (ep659) of the experiment that led to the first SFNNv6 net:
- First retrained on the nn-0dd1cebea573 dataset
- Then retrained with skip 20 on a smaller dataset containing unfiltered Leela data
- And then retrained again with skip 27 on the nn-0dd1cebea573 dataset

The equivalent 7-step training sequence from scratch that led here was:

1. max-epoch 400, lambda 1.0, constant LR 9.75e-4, T79T77-filter-v6-dd.min.binpack
   ep379 chosen for retraining in step2

2. max-epoch 800, end-lambda 0.75, T60T70wIsRightFarseerT60T74T75T76.binpack
   ep679 chosen for retraining in step3

3. max-epoch 800, end-lambda 0.75, skip 28, nn-e1fb1ade4432 dataset
   ep799 chosen for retraining in step4

4. max-epoch 800, end-lambda 0.7, skip 28, nn-e1fb1ade4432 dataset
   ep759 became nn-8d69132723e2.nnue (first SFNNv6 net)
   ep659 chosen for retraining in step5

5. max-epoch 800, end-lambda 0.7, skip 28, nn-0dd1cebea573 dataset
   ep759 chosen for retraining in step6

6. max-epoch 800, end-lambda 0.7, skip 20, leela-dfrc-v2-T77decT78janfebT79aprT80apr.binpack
   ep639 chosen for retraining in step7

7. max-epoch 800, end-lambda 0.7, skip 27, nn-0dd1cebea573 dataset
   ep619 became nn-ea57bea57e32.nnue

For the last retraining (step7):

python3 easy_train.py
  --experiment-name L1-1536-Re6-masterShuffled-ep639-sk27-Re5-leela-dfrc-v2-T77toT80small-Re4-masterShuffled-ep659-Re3-sameAs-Re2-leela96-dfrc99-16t-v2-T60novdecT80juntonovjanfebT79aprmayT78jantosepT77dec-v6dd-Re1-LeelaFarseer-new-T77T79 \
  --training-dataset /data/leela96-dfrc99-T60novdec-v2-T80juntonovjanfebT79aprmayT78jantosepT77dec-v6dd-T80apr.binpack \
  --nnue-pytorch-branch linrock/nnue-pytorch/misc-fixes-L1-1536 \
  --early-fen-skipping 27 \
  --start-lambda 1.0 \
  --end-lambda 0.7 \
  --max_epoch 800 \
  --start-from-engine-test-net False \
  --start-from-model /data/L1-1536-Re5-leela-dfrc-v2-T77toT80small-epoch639.nnue \
  --lr 4.375e-4 \
  --gamma 0.995 \
  --tui False \
  --seed $RANDOM \
  --gpus "0,"

For preparing the step6 leela-dfrc-v2-T77decT78janfebT79aprT80apr.binpack dataset:

python3 interleave_binpacks.py \
  leela96-filt-v2.binpack \
  dfrc99-16tb7p-eval-filt-v2.binpack \
  test77-dec2021-16tb7p.no-db.min-mar2023.binpack \
  test78-janfeb2022-16tb7p.no-db.min-mar2023.binpack \
  test79-apr2022-16tb7p-filter-v6-dd.binpack \
  test80-apr2022-16tb7p.no-db.min-mar2023.binpack \
  /data/leela-dfrc-v2-T77decT78janfebT79aprT80apr.binpack

The unfiltered Leela data used for the step6 dataset can be found at:
https://robotmoon.com/nnue-training-data

Local elo at 25k nodes per move:
nn-epoch619.nnue : 2.3 +/- 1.9

Passed STC:
https://tests.stockfishchess.org/tests/view/6480d43c6e6ce8d9fc6d7cc8
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 40992 W: 11017 L: 10706 D: 19269
Ptnml(0-2): 113, 4400, 11170, 4689, 124

Passed LTC:
https://tests.stockfishchess.org/tests/view/648119ac6e6ce8d9fc6d8208
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 129174 W: 35059 L: 34579 D: 59536
Ptnml(0-2): 66, 12548, 38868, 13050, 55

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

bench: 2370027

16 months agoReintroduce SEE verification against discovered attacks
Guenther Demetz [Wed, 7 Jun 2023 07:01:05 +0000 (09:01 +0200)]
Reintroduce SEE verification against discovered attacks

Reintroduces https://github.com/official-stockfish/Stockfish/pull/4453
along with https://github.com/official-stockfish/Stockfish/pull/4469

Leaving out
https://github.com/official-stockfish/Stockfish/pull/4533
https://github.com/official-stockfish/Stockfish/pull/4572

Passed STC:
https://tests.stockfishchess.org/tests/view/647d8c37726f6b400e408a0a
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 143168 W: 38346 L: 37892 D: 66930
Ptnml(0-2): 352, 15672, 39164, 15962, 434

Passed LTC:
https://tests.stockfishchess.org/tests/view/647ee8c528c4431bcb58e432
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 71538 W: 19560 L: 19190 D: 32788
Ptnml(0-2): 49, 6905, 21499, 7259, 57

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

bench: 2595430

16 months agoSimplify multiplier for improvement
cj5716 [Sun, 4 Jun 2023 23:59:56 +0000 (07:59 +0800)]
Simplify multiplier for improvement

This simplifies a `* 99 / 1300` term into just `/ 13`.

Passed non-regression STC:
LLR: 2.92 (-2.94,2.94) <-1.75,0.25>
Total: 58816 W: 15727 L: 15540 D: 27549
Ptnml(0-2): 149, 6370, 16203, 6517, 169
https://tests.stockfishchess.org/tests/view/647d25e4726f6b400e408165

Passed non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 154386 W: 41749 L: 41669 D: 70968
Ptnml(0-2): 94, 14992, 46956, 15042, 109
https://tests.stockfishchess.org/tests/view/647d9b3c726f6b400e408b2a

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

Bench:  2511327

16 months agoRemove optimism multiplier in nnue eval calculation
Linmiao Xu [Mon, 5 Jun 2023 05:08:38 +0000 (01:08 -0400)]
Remove optimism multiplier in nnue eval calculation

The same formula had passed SPRT against an earlier version of master.

Passed non-regression STC vs. d99942f:
https://tests.stockfishchess.org/tests/view/6478e76654dd118e1d98f72e
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 118720 W: 31402 L: 31277 D: 56041
Ptnml(0-2): 301, 13148, 32344, 13259, 308

Passed non-regression LTC vs. d99942f:
https://tests.stockfishchess.org/tests/view/647a22c154dd118e1d991146
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 74286 W: 20019 L: 19863 D: 34404
Ptnml(0-2): 31, 7189, 22540, 7359, 24

The earlier patch had conflicted with a faster SPRT passer, so this
was tested again after rebasing on latest master.

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/647d6e46726f6b400e408790
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 166176 W: 44309 L: 44234 D: 77633
Ptnml(0-2): 461, 18252, 45557, 18387, 431

Passed non-regression LTC:
https://tests.stockfishchess.org/tests/view/647eb00ba268d1bc11255e7b
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 28170 W: 7713 L: 7513 D: 12944
Ptnml(0-2): 14, 2609, 8635, 2817, 10

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

bench 2503095

16 months agoUpdate default net to nn-0dd1cebea573.nnue
Linmiao Xu [Sun, 4 Jun 2023 05:56:11 +0000 (01:56 -0400)]
Update default net to nn-0dd1cebea573.nnue

Created by retraining an earlier epoch of the experiment leading to the first SFNNv6 net
on a more-randomized version of the nn-e1fb1ade4432.nnue dataset mixed with unfiltered
T80 apr2023 data. Trained using early-fen-skipping 28 and max-epoch 960.

The trainer settings and epochs used in the 5-step training sequence leading here were:
1. train from scratch for 400 epochs, lambda 1.0, constant LR 9.75e-4, T79T77-filter-v6-dd.min.binpack
2. retrain ep379, max-epoch 800, end-lambda 0.75, T60T70wIsRightFarseerT60T74T75T76.binpack
3. retrain ep679, max-epoch 800, end-lambda 0.75, skip 28, nn-e1fb1ade4432 dataset
4. retrain ep799, max-epoch 800, end-lambda 0.7, skip 28, nn-e1fb1ade4432 dataset
5. retrain ep439, max-epoch 960, end-lambda 0.7, skip 28, shuffled nn-e1fb1ade4432 + T80 apr2023

This net was epoch 559 of the final (step 5) retraining:

```bash
python3 easy_train.py \
  --experiment-name L1-1536-Re4-leela96-dfrc99-T60novdec-v2-T80juntonovjanfebT79aprmayT78jantosepT77dec-v6dd-T80apr-shuffled-sk28 \
  --training-dataset /data/leela96-dfrc99-T60novdec-v2-T80juntonovjanfebT79aprmayT78jantosepT77dec-v6dd-T80apr.binpack \
  --nnue-pytorch-branch linrock/nnue-pytorch/misc-fixes-L1-1536 \
  --early-fen-skipping 28 \
  --start-lambda 1.0 \
  --end-lambda 0.7 \
  --max_epoch 960 \
  --start-from-engine-test-net False \
  --start-from-model /data/L1-1536-Re3-nn-epoch439.nnue \
  --engine-test-branch linrock/Stockfish/L1-1536 \
  --lr 4.375e-4 \
  --gamma 0.995 \
  --tui False \
  --seed $RANDOM \
  --gpus "0,"
```

During data preparation, most binpacks were unminimized by removing positions with
score 32002 (`VALUE_NONE`). This makes the tradeoff of increasing dataset filesize
on disk to increase the randomness of positions in interleaved datasets.
The code used for unminimizing is at:
https://github.com/linrock/Stockfish/tree/tools-unminify

For preparing the dataset used in this experiment:

```bash
python3 interleave_binpacks.py \
  leela96-filt-v2.binpack \
  dfrc99-16tb7p-eval-filt-v2.binpack \
  filt-v6-dd-min/test60-novdec2021-12tb7p-filter-v6-dd.min-mar2023.unmin.binpack \
  filt-v6-dd-min/test80-aug2022-16tb7p-filter-v6-dd.min-mar2023.unmin.binpack \
  filt-v6-dd-min/test80-sep2022-16tb7p-filter-v6-dd.min-mar2023.unmin.binpack \
  filt-v6-dd-min/test80-jun2022-16tb7p-filter-v6-dd.min-mar2023.unmin.binpack \
  filt-v6-dd/test80-jul2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test80-oct2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test80-nov2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd-min/test80-jan2023-3of3-16tb7p-filter-v6-dd.min-mar2023.unmin.binpack \
  filt-v6-dd-min/test80-feb2023-16tb7p-filter-v6-dd.min-mar2023.unmin.binpack \
  filt-v6-dd/test79-apr2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test79-may2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd-min/test78-jantomay2022-16tb7p-filter-v6-dd.min-mar2023.unmin.binpack \
  filt-v6-dd/test78-juntosep2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test77-dec2021-16tb7p-filter-v6-dd.binpack \
  test80-apr2023-2tb7p.binpack \
  /data/leela96-dfrc99-T60novdec-v2-T80juntonovjanfebT79aprmayT78jantosepT77dec-v6dd-T80apr.binpack
```

T80 apr2023 data was converted using lc0-rescorer with ~2tb of tablebases and can be found at:
https://robotmoon.com/nnue-training-data/

Local elo at 25k nodes per move vs. nn-e1fb1ade4432.nnue (L1 size 1024):
nn-epoch559.nnue : 25.7 +/- 1.6

Passed STC:
https://tests.stockfishchess.org/tests/view/647cd3b87cf638f0f53f9cbb
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 59200 W: 16000 L: 15660 D: 27540
Ptnml(0-2): 159, 6488, 15996, 6768, 189

Passed LTC:
https://tests.stockfishchess.org/tests/view/647d58de726f6b400e4085d8
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 58800 W: 16002 L: 15657 D: 27141
Ptnml(0-2): 44, 5607, 17748, 5962, 39

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

bench 2141197

16 months agoAdd binaries to releases with github actions
disservin [Mon, 17 Apr 2023 20:16:22 +0000 (22:16 +0200)]
Add binaries to releases with github actions

when a release is made with a tag matching sf_* the binaries will also be uploaded to the release as assets.

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

No functional change.

16 months agoFix no previous moves on root.
peregrineshahin [Sun, 4 Jun 2023 21:59:31 +0000 (00:59 +0300)]
Fix no previous moves on root.

guards against no previous move existing if qSearch is called on the root node (i.e. when razoring).

Passed Non-regression STC:
https://tests.stockfishchess.org/tests/view/647d242d726f6b400e408143
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 53120 W: 14167 L: 13976 D: 24977
Ptnml(0-2): 109, 5597, 14981, 5740, 133

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

Bench: 2551691

16 months agoMove internal iterative reduction before probcut
Michael Chaly [Thu, 1 Jun 2023 12:24:13 +0000 (15:24 +0300)]
Move internal iterative reduction before probcut

This patch moves IIR before probcut which allows probcut
to be produced at lower depths. Comments in IIR are also slightly updated.

Passed STC:
https://tests.stockfishchess.org/tests/view/6472d604d29264e4cfa749fd
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 387616 W: 103295 L: 102498 D: 181823
Ptnml(0-2): 976, 42322, 106381, 43187, 942

Passed LTC:
https://tests.stockfishchess.org/tests/view/6475eb8c4a36543c4c9f42e8
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 202836 W: 54901 L: 54281 D: 93654
Ptnml(0-2): 85, 19609, 61422, 20205, 97

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

bench 2551691

16 months agoRemove static eval threshold for extensions when giving check
Linmiao Xu [Tue, 30 May 2023 22:24:54 +0000 (18:24 -0400)]
Remove static eval threshold for extensions when giving check

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/647685d54a36543c4c9f4f2a
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 114688 W: 30701 L: 30571 D: 53416
Ptnml(0-2): 336, 12708, 31136, 12818, 346

Passed non-regression LTC:
https://tests.stockfishchess.org/tests/view/64774b02b81f005b572de770
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 107310 W: 28920 L: 28796 D: 49594
Ptnml(0-2): 33, 10427, 32621, 10531, 43

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

bench 2597974

16 months agoSimplify away SEE verification
Guenther Demetz [Wed, 31 May 2023 09:48:18 +0000 (11:48 +0200)]
Simplify away SEE verification

After 4 simplificatons over PR#4453 the idea does not yield significant
improvement anymore. Maybe also
https://tests.stockfishchess.org/tests/view/640c88092644b62c3394c1c5 was
a fluke.

Passed non-regression bounds:

STC:
https://tests.stockfishchess.org/tests/view/64705389c079b6583146d873
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 131936 W: 35040 L: 34930 D: 61966
Ptnml(0-2): 336, 14559, 36035, 14735, 303

LTC:
https://tests.stockfishchess.org/tests/view/6471a2ade549d9cf2fb213cd
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 407700 W: 109999 L: 110164 D: 187537
Ptnml(0-2): 279, 39913, 123689, 39632, 337

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

bench: 2675974

16 months agoSimplify blending nnue complexity with optimism
Linmiao Xu [Thu, 1 Jun 2023 13:50:19 +0000 (09:50 -0400)]
Simplify blending nnue complexity with optimism

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/6478a26d54dd118e1d98f21c
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 241248 W: 64058 L: 64063 D: 113127
Ptnml(0-2): 644, 26679, 65960, 26720, 621

Passed non-regression LTC:
https://tests.stockfishchess.org/tests/view/647b464854dd118e1d9928b2
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 24336 W: 6658 L: 6451 D: 11227
Ptnml(0-2): 8, 2316, 7312, 2525, 7

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

bench 2425813

16 months agoSearch tuning at very long time control with new net
Muzhen Gaming [Fri, 2 Jun 2023 11:55:25 +0000 (19:55 +0800)]
Search tuning at very long time control with new net

The most significant change would be the singularBeta formula.
It was first tested by cj5716 (see https://tests.stockfishchess.org/tests/view/647317c9d29264e4cfa74ec7),
and I took much inspiration from that idea.

LTC (fixed games): https://tests.stockfishchess.org/tests/view/6479d8da54dd118e1d990b12
Elo: 0.61 ± 1.2 (95%) LOS: 83.4%
Total: 60000 W: 16278 L: 16172 D: 27550
Ptnml(0-2): 16, 5845, 18179, 5937, 23
nElo: 1.38 ± 2.8 (95%) PairsRatio: 1.02

VLTC 180+1.8: https://tests.stockfishchess.org/tests/view/6479da1454dd118e1d990b2b
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 33224 W: 9261 L: 8984 D: 14979
Ptnml(0-2): 5, 2809, 10710, 3080, 8

SMP VLTC 8-thread: https://tests.stockfishchess.org/tests/view/647b0fe354dd118e1d992425
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 61398 W: 17386 L: 17081 D: 26931
Ptnml(0-2): 7, 4571, 21232, 4888, 1

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

Bench: 2805878

17 months agoSmall simplification for probcut in check
Michael Chaly [Wed, 31 May 2023 06:22:26 +0000 (09:22 +0300)]
Small simplification for probcut in check

Remove depth condition from there as not longer needed.

Passed STC:
https://tests.stockfishchess.org/tests/view/647367cad29264e4cfa753e6
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 254336 W: 67830 L: 67847 D: 118659
Ptnml(0-2): 580, 28181, 69697, 28096, 614

Passed LTC:
https://tests.stockfishchess.org/tests/view/647576184a36543c4c9f3af7
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 80706 W: 22048 L: 21898 D: 36760
Ptnml(0-2): 28, 7721, 24712, 7857, 35

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

bench 2381945

17 months agoSimplify nnue eval complexity calculation
Linmiao Xu [Sun, 28 May 2023 18:45:24 +0000 (14:45 -0400)]
Simplify nnue eval complexity calculation

Remove a multiplier when blending nnue complexity with semi-classical complexity.

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/6473a71dd29264e4cfa75839
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 124768 W: 33180 L: 33060 D: 58528
Ptnml(0-2): 314, 13797, 34030, 13941, 302

Passed non-regression LTC:
https://tests.stockfishchess.org/tests/view/6474af3dd29264e4cfa768f4
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 108180 W: 29008 L: 28884 D: 50288
Ptnml(0-2): 29, 10420, 33075, 10530, 36

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

bench 2316827

17 months agoUpdate NNUE architecture to SFNNv6 with larger L1 size of 1536
Linmiao Xu [Fri, 12 May 2023 22:07:20 +0000 (18:07 -0400)]
Update NNUE architecture to SFNNv6 with larger L1 size of 1536

Created by training a new net from scratch with L1 size increased from 1024 to 1536.
Thanks to Vizvezdenec for the idea of exploring larger net sizes after recent
training data improvements.

A new net was first trained with lambda 1.0 and constant LR 8.75e-4. Then a strong net
from a later epoch in the training run was chosen for retraining with start-lambda 1.0
and initial LR 4.375e-4 decaying with gamma 0.995. Retraining was performed a total of
3 times, for this 4-step process:

1. 400 epochs, lambda 1.0 on filtered T77+T79 v6 deduplicated data
2. 800 epochs, end-lambda 0.75 on T60T70wIsRightFarseerT60T74T75T76.binpack
3. 800 epochs, end-lambda 0.75 and early-fen-skipping 28 on the master dataset
4. 800 epochs, end-lambda 0.7 and early-fen-skipping 28 on the master dataset

In the training sequence that reached the new nn-8d69132723e2.nnue net,
the epochs used for the 3x retraining runs were:

1. epoch 379 trained on T77T79-filter-v6-dd.min.binpack
2. epoch 679 trained on T60T70wIsRightFarseerT60T74T75T76.binpack
3. epoch 799 trained on the master dataset

For training from scratch:

python3 easy_train.py \
  --experiment-name new-L1-1536-T77T79-filter-v6dd \
  --training-dataset /data/T77T79-filter-v6-dd.min.binpack \
  --max_epoch 400 \
  --lambda 1.0 \
  --start-from-engine-test-net False \
  --engine-test-branch linrock/Stockfish/L1-1536 \
  --nnue-pytorch-branch linrock/Stockfish/misc-fixes-L1-1536 \
  --tui False \
  --gpus "0," \
  --seed $RANDOM

Retraining commands were similar to each other. For the 3rd retraining run:

python3 easy_train.py \
  --experiment-name L1-1536-T77T79-v6dd-Re1-LeelaFarseer-Re2-masterDataset-Re3-sameData \
  --training-dataset /data/leela96-dfrc99-v2-T60novdecT80juntonovjanfebT79aprmayT78jantosepT77dec-v6dd.binpack \
  --early-fen-skipping 28 \
  --max_epoch 800 \
  --start-lambda 1.0 \
  --end-lambda 0.7 \
  --lr 4.375e-4 \
  --gamma 0.995 \
  --start-from-engine-test-net False \
  --start-from-model /data/L1-1536-T77T79-v6dd-Re1-LeelaFarseer-Re2-masterDataset-nn-epoch799.nnue \
  --engine-test-branch linrock/Stockfish/L1-1536 \
  --nnue-pytorch-branch linrock/nnue-pytorch/misc-fixes-L1-1536 \
  --tui False \
  --gpus "0," \
  --seed $RANDOM

The T77+T79 data used is a subset of the master dataset available at:
https://robotmoon.com/nnue-training-data/

T60T70wIsRightFarseerT60T74T75T76.binpack is available at:
https://drive.google.com/drive/folders/1S9-ZiQa_3ApmjBtl2e8SyHxj4zG4V8gG

Local elo at 25k nodes per move vs. nn-e1fb1ade4432.nnue (L1 size 1024):
nn-epoch759.nnue : 26.9 +/- 1.6

Failed STC
https://tests.stockfishchess.org/tests/view/64742485d29264e4cfa75f97
LLR: -2.94 (-2.94,2.94) <0.00,2.00>
Total: 13728 W: 3588 L: 3829 D: 6311
Ptnml(0-2): 71, 1661, 3610, 1482, 40

Failing LTC
https://tests.stockfishchess.org/tests/view/64752d7c4a36543c4c9f3618
LLR: -1.91 (-2.94,2.94) <0.50,2.50>
Total: 35424 W: 9522 L: 9603 D: 16299
Ptnml(0-2): 24, 3579, 10585, 3502, 22

Passed VLTC 180+1.8
https://tests.stockfishchess.org/tests/view/64752df04a36543c4c9f3638
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 47616 W: 13174 L: 12863 D: 21579
Ptnml(0-2): 13, 4261, 14952, 4566, 16

Passed VLTC SMP 60+0.6 th 8
https://tests.stockfishchess.org/tests/view/647446ced29264e4cfa761e5
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 19942 W: 5694 L: 5451 D: 8797
Ptnml(0-2): 6, 1504, 6707, 1749, 5

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

bench 2222567

17 months agoRemoved quadratic term in optimism
windfishballad [Tue, 23 May 2023 00:13:44 +0000 (20:13 -0400)]
Removed quadratic term in optimism

Remove term which is quadratic in optimism in the eval.
Simplifies and should also remove the bias towards side to move making the eval better for analysis.

STC: https://tests.stockfishchess.org/tests/view/6470a9d8c29e0d4352b0bca5
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 154432 W: 41127 L: 41040 D: 72265
Ptnml(0-2): 380, 17094, 42190, 17163, 389

LTC: https://tests.stockfishchess.org/tests/view/6471e9b3e549d9cf2fb219ef
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 127926 W: 34474 L: 34369 D: 59083
Ptnml(0-2): 43, 12505, 38776, 12582, 57

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

Bench: 2541211

17 months agoUpdate CPU contributors list
Joost VandeVondele [Sat, 27 May 2023 16:01:08 +0000 (18:01 +0200)]
Update CPU contributors list

update CPU contributors list, the previous update was a couple of months ago,
and unfortunately, was not quite accurate for the number of games played.

This version is based clean calculation from the DB and
an updated script that tracks things (see https://github.com/glinscott/fishtest/pull/1702).

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

No functional change

17 months agoRemove ss->ttHit condition where ttValue != VALUE_NONE
cj5716 [Thu, 25 May 2023 06:34:52 +0000 (14:34 +0800)]
Remove ss->ttHit condition where ttValue != VALUE_NONE

Simplification is done at 3 separate places in the code.
Thanks to peregrineshahin for helping me find 2 of such places.
(See original PR #4584)

Passed non-regression test
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 120256 W: 32204 L: 32085 D: 55967
Ptnml(0-2): 292, 12473, 34483, 12584, 296
https://tests.stockfishchess.org/tests/view/646f045968661bfd984325e3

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

No functional change

17 months agoSimplify Futility pruning for captures
FauziAkram [Tue, 23 May 2023 17:36:47 +0000 (20:36 +0300)]
Simplify Futility pruning for captures

Passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 412928 W: 109433 L: 109620 D: 193875
Ptnml(0-2): 1071, 45929, 112650, 45744, 1070
https://tests.stockfishchess.org/tests/view/6468eac40db5177f2b76ef4d

Passed LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 190200 W: 51465 L: 51420 D: 87315
Ptnml(0-2): 58, 18585, 57788, 18592, 77
https://tests.stockfishchess.org/tests/view/646b66520db5177f2b772a84

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

bench: 2486604

17 months agoSimplify Prune moves with negative SEE
FauziAkram [Sun, 21 May 2023 13:22:28 +0000 (16:22 +0300)]
Simplify Prune moves with negative SEE

Passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 57760 W: 15472 L: 15286 D: 27002
Ptnml(0-2): 123, 6025, 16430, 6147, 155
https://tests.stockfishchess.org/tests/view/6468eb6b0db5177f2b76ef62

Passed LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 93966 W: 25274 L: 25141 D: 43551
Ptnml(0-2): 33, 8498, 29792, 8623, 37
https://tests.stockfishchess.org/tests/view/6469570b0db5177f2b76f81b

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

Bench: 2304063

17 months agoSimplify delta calculation in aspiration window
Muzhen Gaming [Sat, 20 May 2023 13:28:54 +0000 (21:28 +0800)]
Simplify delta calculation in aspiration window

Simplification STC: https://tests.stockfishchess.org/tests/view/6468cb200db5177f2b76ecbb
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 220416 W: 58503 L: 58487 D: 103426
Ptnml(0-2): 596, 24384, 60188, 24488, 552

Simplification LTC: https://tests.stockfishchess.org/tests/view/646a15840db5177f2b770704
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 177756 W: 47882 L: 47825 D: 82049
Ptnml(0-2): 55, 17430, 53858, 17473, 62

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

Bench: 2304063

17 months agoMore Depth Reduction
candirufish [Sun, 21 May 2023 22:14:55 +0000 (00:14 +0200)]
More Depth Reduction

Reduce more for depth > 3 and depth < 12

LTC: https://tests.stockfishchess.org/tests/view/646c5abbd1f14fd69a6f2fab
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 197280 W: 53405 L: 52797 D: 91078
Ptnml(0-2): 62, 19025, 59886, 19577, 90

STC: https://tests.stockfishchess.org/tests/view/646bee71d1f14fd69a6f259d
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 100832 W: 26861 L: 26466 D: 47505
Ptnml(0-2): 240, 10985, 27622, 11278, 291

https://github.com/official-stockfish/Stockfish/pull/4585

bench: 2276617

17 months agoSmall simplification in low depth pruning
Michael Chaly [Sat, 13 May 2023 21:30:35 +0000 (00:30 +0300)]
Small simplification in low depth pruning

Uncap low depth pruning lmr depth.
It's anyway capped for most cases apart from futility pruning for captures - removes one std::min call.

Passed STC:
https://tests.stockfishchess.org/tests/view/645e8fa6d55cccb2e64225a1
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 184064 W: 49039 L: 48982 D: 86043
Ptnml(0-2): 462, 20353, 50349, 20402, 466

Passed LTC:
https://tests.stockfishchess.org/tests/view/645f4d48d55cccb2e6423335
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 83886 W: 22613 L: 22465 D: 38808
Ptnml(0-2): 31, 8090, 25546, 8252, 24

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

bench 3201883

17 months agoSimplify SEE verfication logic
pb00067 [Wed, 17 May 2023 07:22:02 +0000 (09:22 +0200)]
Simplify SEE verfication logic

Passed STC
https://tests.stockfishchess.org/tests/view/6461d51887f6567dd4df27d0
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 177056 W: 47181 L: 47118 D: 82757
Ptnml(0-2): 456, 19381, 48792, 19442, 457

Passed LTC
https://tests.stockfishchess.org/tests/view/64631a9287f6567dd4df4502
2.94 (-2.94,2.94) <-1.75,0.25>
Total: 104346 W: 28062 L: 27935 D: 48349
Ptnml(0-2): 25, 10190, 31631, 10287, 40

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

bench: 2903251

17 months agoSimplify optimism calculation
xoto10 [Fri, 19 May 2023 18:58:18 +0000 (19:58 +0100)]
Simplify optimism calculation

This change removes one of the constants in the calculation of optimism. It also changes the 2 constants used with the scale value so that they are independent, instead of applying a constant to the scale and then adjusting it again when it is applied to the optimism. This might make the tuning of these constants cleaner and more reliable in the future.

STC 10+0.1 (accidentally run as an Elo gainer:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 154080 W: 41119 L: 40651 D: 72310
Ptnml(0-2): 375, 16840, 42190, 17212, 423
https://tests.stockfishchess.org/tests/live_elo/64653eabf3b1a4e86c317f77

LTC 60+0.6:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 217434 W: 58382 L: 58363 D: 100689
Ptnml(0-2): 66, 21075, 66419, 21088, 69
https://tests.stockfishchess.org/tests/live_elo/6465d077f3b1a4e86c318d6c

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

bench: 3190961

17 months agoSmall simplification in history pruning.
Stefan Geschwentner [Fri, 19 May 2023 21:16:48 +0000 (23:16 +0200)]
Small simplification in history pruning.

Remove the constant term of the history threshold which lowers the chance that pruning occurs.
As compensation allow pruning at a slightly higher depth.

Passed STC:
https://tests.stockfishchess.org/tests/view/64634c9a87f6567dd4df4901
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 101536 W: 27156 L: 27012 D: 47368
Ptnml(0-2): 266, 11165, 27772, 11289, 276

Passed LTC:
https://tests.stockfishchess.org/tests/view/6463d68b17982fde89d2bc2b
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 32154 W: 8741 L: 8543 D: 14870
Ptnml(0-2): 8, 3093, 9687, 3271, 18

Passed LTC: retest on top of VLTC tuning PR 4571 because this changes the history depth factor (use this new factor here)
https://tests.stockfishchess.org/tests/view/6467300e165c4b29ec0afd3f
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 99270 W: 26840 L: 26707 D: 45723
Ptnml(0-2): 36, 9753, 29928, 9878, 40

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

Bench: 2984341

17 months agoSearch tuning at very long time control
Muzhen Gaming [Tue, 16 May 2023 13:30:53 +0000 (21:30 +0800)]
Search tuning at very long time control

Many search parameter changes, tuned
(https://tests.stockfishchess.org/tests/view/645e4c67d55cccb2e64220ff)
at ~300k games @ VLTC (120+1.2).

Failed STC:
https://tests.stockfishchess.org/tests/view/6465fcd77968ca827c1410c2
LLR: -2.95 (-2.94,2.94) <0.00,2.00>
Total: 33824 W: 8863 L: 9067 D: 15894
Ptnml(0-2): 89, 3833, 9266, 3641, 83

Neutral LTC:
https://tests.stockfishchess.org/tests/view/646385ce87f6567dd4df4e37
Elo: -0.48 +-1.2 (95%) LOS: 22.2%
Total: 60000 W: 16235 L: 16318 D: 27447
Ptnml(0-2): 27, 5831, 18366, 5750, 26
nElo: -1.08 +-2.8 (95%) PairsRatio: 0.99

Passed VLTC 180+1.8:
https://tests.stockfishchess.org/tests/view/646385f787f6567dd4df4e3e
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 126448 W: 34704 L: 34258 D: 57486
Ptnml(0-2): 9, 10970, 40825, 11406, 14

Passed VLTC SMP 60+0.6 8thread:
https://tests.stockfishchess.org/tests/view/646628de884ce93b65df2ac9
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 59456 W: 16791 L: 16487 D: 26178
Ptnml(0-2): 5, 4473, 20467, 4779, 4

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

Bench: 3347573

17 months agoUpdate WLD model
Joost VandeVondele [Fri, 19 May 2023 21:02:27 +0000 (23:02 +0200)]
Update WLD model

using data of May, recalibrate the WLD model.

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

No functional change

17 months agoRefine deeper post-lmr searches
Michael Chaly [Sun, 7 May 2023 20:33:04 +0000 (23:33 +0300)]
Refine deeper post-lmr searches

This patch improves logic conditions for performing deeper searches after passed LMR.

Instead of exceeding alpha by some margin now it requires to exceed the
current best value - which may be lower than alpha (but never bigger since we
update alpha with bestvalue if it exceeds alpha).

Passed STC:
https://tests.stockfishchess.org/tests/view/6455f78008858de8313775b6
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 209344 W: 55993 L: 55448 D: 97903
Ptnml(0-2): 507, 22798, 57526, 23325, 516

Passed LTC:
https://tests.stockfishchess.org/tests/view/64572d46eb75932ccfebff97
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 66288 W: 17867 L: 17514 D: 30907
Ptnml(0-2): 21, 6240, 20269, 6593, 21

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

bench 3808503

17 months agoSmall cleanup
Michael Chaly [Fri, 5 May 2023 20:32:56 +0000 (23:32 +0300)]
Small cleanup

In search remove one condition check and reorder conditions. Removes some code.

Passed non-regression test:
https://tests.stockfishchess.org/tests/view/64548fa06206ee34ebf853ad
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 282976 W: 75327 L: 75374 D: 132275
Ptnml(0-2): 604, 29673, 80995, 29598, 618

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

No functional change

17 months agoClean up after "Simplify away complexity in evaluation"
peregrineshahin [Wed, 3 May 2023 11:11:55 +0000 (14:11 +0300)]
Clean up after "Simplify away complexity in evaluation"

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

No functional change.

17 months agoReduce more if current node has a lot of refuted moves.
Michael Chaly [Fri, 5 May 2023 04:54:12 +0000 (07:54 +0300)]
Reduce more if current node has a lot of refuted moves.

This patch refines idea of cutoff count - in master we reduce more if current node has at least 4 moves that are refuted by search, this patch increases this count by 1 if refutation happened without having a tt move.

Passed STC:
https://tests.stockfishchess.org/tests/view/645363c36206ee34ebf8191d
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 67616 W: 18220 L: 17874 D: 31522
Ptnml(0-2): 142, 7346, 18504, 7656, 160

Passed LTC:
https://tests.stockfishchess.org/tests/view/6453a0ea6206ee34ebf82796
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 195228 W: 52741 L: 52140 D: 90347
Ptnml(0-2): 53, 18718, 59482, 19297, 64

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

bench 3448916

17 months agoAdjust reductions
candirufish [Fri, 28 Apr 2023 17:05:56 +0000 (19:05 +0200)]
Adjust reductions

Decrease further on cutNodes with tte->depth() >= depth + 3 condition.

LTC: https://tests.stockfishchess.org/tests/view/644dc84bccf5e93df5e50c13
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 155346 W: 42184 L: 41660 D: 71502
Ptnml(0-2): 59, 14765, 47504, 15283, 62

STC: https://tests.stockfishchess.org/tests/view/644d05de68e01d8194cd9bbb
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 121888 W: 32868 L: 32444 D: 56576
Ptnml(0-2): 332, 13273, 33343, 13631, 365

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

bench: 3739675

17 months agoUpdate 7 eval and optimism params
Linmiao Xu [Sat, 29 Apr 2023 19:45:22 +0000 (15:45 -0400)]
Update 7 eval and optimism params

Params found using spsa at 30+0.3 with this tuning config:

```
// evaluate.cpp
int nnueOptScaleBase = 1001;
int nnueComplexityMult = 406;
int nnueComplexityOptOffset = 424;
int evalOptComplexityOffset = 272;
int evalOptScaleOffset = 748;
TUNE(SetRange(801, 1201), nnueOptScaleBase);
TUNE(SetRange(306, 506), nnueComplexityMult);
TUNE(SetRange(324, 524), nnueComplexityOptOffset);
TUNE(SetRange(172, 372), evalOptComplexityOffset);
TUNE(SetRange(648, 848), evalOptScaleOffset);

// search.cpp
int searchOptBase = 120;
int searchOptDenom = 161;
TUNE(SetRange(20, 220), searchOptBase);
TUNE(SetRange(111, 211), searchOptDenom);
```

Passed STC:
https://tests.stockfishchess.org/tests/view/644dda8accf5e93df5e50cbe
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 136800 W: 36682 L: 36237 D: 63881
Ptnml(0-2): 353, 14910, 37492, 15229, 416

Passed LTC:
https://tests.stockfishchess.org/tests/view/644eaedb3f31c3bbe4a3d345
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 64548 W: 17624 L: 17272 D: 29652
Ptnml(0-2): 33, 6112, 19631, 6466, 32

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

bench 3670343

18 months agoUpdate default net to nn-e1fb1ade4432.nnue
Linmiao Xu [Fri, 21 Apr 2023 13:37:29 +0000 (09:37 -0400)]
Update default net to nn-e1fb1ade4432.nnue

Created by retraining nn-dabb1ed23026.nnue with a dataset composed of:

* The previous best dataset (nn-1ceb1a57d117.nnue dataset)
* Adding de-duplicated T80 data from feb2023 and the last 10 days of jan2023, filtered with v6-dd

Initially trained with the same options as the recent master net (nn-1ceb1a57d117.nnue).
Around epoch 890, training was manually stopped and max epoch increased to 1000.

```
python3 easy_train.py \
  --experiment-name leela96-dfrc99-T60novdec-v2-T80augsep-v6-T80junjuloctnovjanfebT79aprmayT78jantosepT77dec-v6dd \
  --training-dataset /data/leela96-dfrc99-T60novdec-v2-T80augsep-v6-T80junjuloctnovjanfebT79aprmayT78jantosepT77dec-v6dd.binpack \
  --nnue-pytorch-branch linrock/nnue-pytorch/misc-fixes \
  --start-from-engine-test-net True \
  --early-fen-skipping 30 \
  --start-lambda 1.0 \
  --end-lambda 0.7 \
  --max_epoch 900 \
  --lr 4.375e-4 \
  --gamma 0.995 \
  --tui False \
  --gpus "0," \
  --seed $RANDOM
```

The same v6-dd filtering and binpack minimizer was used for preparing the recent nn-1ceb1a57d117.nnue dataset.

```
python3 interleave_binpacks.py \
  leela96-filt-v2.binpack \
  dfrc99-filt-v2.binpack \
  T60-nov2021-12tb7p-eval-filt-v2.binpack \
  T60-dec2021-12tb7p-eval-filt-v2.binpack \
  filt-v6/test80-aug2022-16tb7p-filter-v6.min-mar2023.binpack \
  filt-v6/test80-sep2022-16tb7p-filter-v6.min-mar2023.binpack \
  filt-v6-dd/test80-jun2022-16tb7p-filter-v6-dd.min-mar2023.binpack \
  filt-v6-dd/test80-jul2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test80-oct2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test80-nov2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test80-jan2022-3of3-16tb7p-filter-v6-dd.min-mar2023.binpack \
  filt-v6-dd/test80-feb2023-16tb7p-filter-v6-dd.min-mar2023.binpack \
  filt-v6-dd/test79-apr2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test79-may2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test78-jantomay2022-16tb7p-filter-v6-dd.min-mar2023.binpack \
  filt-v6-dd/test78-juntosep2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test77-dec2021-16tb7p-filter-v6-dd.binpack \
  /data/leela96-dfrc99-T60novdec-v2-T80augsep-v6-T80junjuloctnovjanfebT79aprmayT78jantosepT77dec-v6dd.binpack
```

Links for downloading the training data components can be found at:
https://robotmoon.com/nnue-training-data/

Local elo at 25k nodes per move:
nn-epoch919.nnue : 2.6 +/- 2.8

Passed STC vs. nn-dabb1ed23026.nnue
https://tests.stockfishchess.org/tests/view/644420df94ff3db5625f2af5
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 125960 W: 33898 L: 33464 D: 58598
Ptnml(0-2): 351, 13920, 34021, 14320, 368

Passed LTC vs. nn-1ceb1a57d117.nnue
https://tests.stockfishchess.org/tests/view/64469f128d30316529b3dc46
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 24544 W: 6817 L: 6542 D: 11185
Ptnml(0-2): 8, 2252, 7488, 2505, 19

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

bench 3714847

18 months agoCreated by retraining the master net with these changes to the dataset:
Linmiao Xu [Sat, 15 Apr 2023 13:51:01 +0000 (09:51 -0400)]
Created by retraining the master net with these changes to the dataset:

* Extending v6 filtering to data from T77 dec2021, T79 may2022, and T80 nov2022
* Reducing the number of duplicate positions, prioritizing position scores seen later in time
* Using a binpack minimizer to reduce the overall data size

Trained the same way as the previous master net, aside from the dataset changes:

```
python3 easy_train.py \
  --experiment-name leela96-dfrc99-T60novdec-v2-T80augsep-v6-T80junjuloctnovT79aprmayT78jantosepT77dec-v6dd \
  --training-dataset /data/leela96-dfrc99-T60novdec-v2-T80augsep-v6-T80junjuloctnovT79aprmayT78jantosepT77dec-v6dd.binpack \
  --nnue-pytorch-branch linrock/nnue-pytorch/misc-fixes \
  --start-from-engine-test-net True \
  --early-fen-skipping 30 \
  --start-lambda 1.0 \
  --end-lambda 0.7 \
  --max_epoch 900 \
  --lr 4.375e-4 \
  --gamma 0.995 \
  --tui False \
  --gpus "0," \
  --seed $RANDOM
```

The new v6-dd filtering reduces duplicate positions by iterating over hourly data files within leela test runs, starting with the most recent, then keeping positions the first time they're seen and ignoring positions that are seen again. This ordering was done with the assumption that position scores seen later in time are generally more accurate than scores seen earlier in the test run. Positions are de-duplicated based on piece orientations, the first token in fen strings.

The binpack minimizer was run with default settings after first merging monthly data into single binpacks.

```
python3 interleave_binpacks.py \
  leela96-filt-v2.binpack \
  dfrc99-filt-v2.binpack \
  T60-nov2021-12tb7p-eval-filt-v2.binpack \
  T60-dec2021-12tb7p-eval-filt-v2.binpack \
  filt-v6/test80-aug2022-16tb7p-filter-v6.min-mar2023.binpack \
  filt-v6/test80-sep2022-16tb7p-filter-v6.min-mar2023.binpack \
  filt-v6-dd/test80-jun2022-16tb7p-filter-v6-dd.min-mar2023.binpack \
  filt-v6-dd/test80-jul2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test80-oct2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test80-nov2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test79-apr2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test79-may2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test78-jantomay2022-16tb7p-filter-v6-dd.min-mar2023.binpack \
  filt-v6-dd/test78-juntosep2022-16tb7p-filter-v6-dd.binpack \
  filt-v6-dd/test77-dec2021-16tb7p-filter-v6-dd.binpack \
  /data/leela96-dfrc99-T60novdec-v2-T80augsep-v6-T80junjuloctnovT79aprmayT78jantosepT77dec-v6dd.binpack
```

The code for v6-dd filtering is available along with training data preparation scripts at:
https://github.com/linrock/nnue-data

Links for downloading the training data components:
https://robotmoon.com/nnue-training-data/

The binpack minimizer is from: #4447

Local elo at 25k nodes per move:
nn-epoch859.nnue : 1.2 +/- 2.6

Passed STC:
https://tests.stockfishchess.org/tests/view/643aad7db08900ff1bc5a832
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 565040 W: 150225 L: 149162 D: 265653
Ptnml(0-2): 1875, 62137, 153229, 63608, 1671

Passed LTC:
https://tests.stockfishchess.org/tests/view/643ecf2fa43cf30e719d2042
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 1014840 W: 274645 L: 272456 D: 467739
Ptnml(0-2): 515, 98565, 306970, 100956, 414

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

bench 3476305

18 months agoUpdate AUTHORS
Boštjan Mejak [Tue, 11 Apr 2023 11:55:14 +0000 (13:55 +0200)]
Update AUTHORS

Improved some comments in the AUTHORS file, sort contributors

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

No functional change

18 months agoLess reduction for tt move.
Stefan Geschwentner [Fri, 21 Apr 2023 14:22:55 +0000 (16:22 +0200)]
Less reduction for tt move.

This idea is a result of my second condition combination tuning for reductions:
https://tests.stockfishchess.org/tests/view/643ed5573806eca398f06d61

There were used two parameters per combination: one for the 'sign' of the first and the second condition in a combination. Values >= 50 indicate using a condition directly and values <= -50 means use the negation of a condition.

Each condition pair (X,Y) had two occurances dependent of the order of the two conditions:
- if X < Y the parameters used for more reduction
- if X > Y the parameters used for less reduction
- if X = Y then only one condition is present and A[X][X][0]/A[X][X][1] stands for using more/less reduction for only this condition.

The parameter pair A[7][2][0] (value = -94.70) and A[7][2][1] (value = 93.60) was one of the strongest signals with values near 100/-100.
Here condition nr. 7 was '(ss+1)->cutoffCnt > 3' and condition nr. 2 'move == ttMove'. For condition nr. 7 the negation is used because A[7][2][0] is negative.

This translates finally to less reduction (because 7 > 2) for tt moves if child cutoffs <= 3.

STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 65728 W: 17704 L: 17358 D: 30666
Ptnml(0-2): 184, 7092, 18008, 7354, 226
https://tests.stockfishchess.org/tests/view/643ff767ef2529086a7ed042

LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 139200 W: 37776 L: 37282 D: 64142
Ptnml(0-2): 58, 13241, 42509, 13733, 59
https://tests.stockfishchess.org/tests/view/6440bfa9ef2529086a7edbc7

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

Bench: 3548023

18 months agoSimplify away depth condition for aspiration window adjust
Muzhen Gaming [Fri, 14 Apr 2023 12:33:33 +0000 (20:33 +0800)]
Simplify away depth condition for aspiration window adjust

Simplification STC:
https://tests.stockfishchess.org/tests/view/64351654596a20f264276ded
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 374664 W: 98942 L: 99089 D: 176633
Ptnml(0-2): 1049, 41767, 101878, 41558, 1080

Simplification LTC:
https://tests.stockfishchess.org/tests/view/6439499f605991a801b4f684
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 457880 W: 123021 L: 123233 D: 211626
Ptnml(0-2): 166, 44739, 139335, 44541, 159

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

Bench: 3879281

18 months agoSimplification of SEE verification logic
Guenther Demetz [Mon, 17 Apr 2023 09:38:26 +0000 (11:38 +0200)]
Simplification of SEE verification logic

Use same logic for all handled pieces.
Don't prune the move if opponent King, Queen, Rook gets a discovered
attack while or after the exchanges.

remove an obsolete comment in position.cpp

Passed STC non regression:
https://tests.stockfishchess.org/tests/view/6437907594daa91835c290d0
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 107432 W: 28359 L: 28221 D: 50852
Ptnml(0-2): 298, 11724, 29524, 11882, 288

Passed LTC non-regression:
https://tests.stockfishchess.org/tests/view/6438ed2ebd1a5470263c51e8
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 236288 W: 63656 L: 63656 D: 108976
Ptnml(0-2): 99, 22960, 72011, 22990, 84

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

bench: 3741125

18 months agoSimplify away complexity in evaluation
Muzhen Gaming [Fri, 14 Apr 2023 12:48:22 +0000 (20:48 +0800)]
Simplify away complexity in evaluation

Simplification STC: https://tests.stockfishchess.org/tests/view/64394bc0605991a801b4f6f0
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 72360 W: 19313 L: 19138 D: 33909
Ptnml(0-2): 206, 7883, 19800, 8112, 179

Simplification LTC: https://tests.stockfishchess.org/tests/view/6439e788c233ce943b6bdac1
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 224992 W: 60665 L: 60654 D: 103673
Ptnml(0-2): 96, 21875, 68526, 21920, 79

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

Bench: 3709369

18 months agoSet the length of GIT_SHA to 8 characters
Torom [Thu, 13 Apr 2023 19:55:13 +0000 (21:55 +0200)]
Set the length of GIT_SHA to 8 characters

Previously, the length of git commit hashes could vary depending on the git environment.

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

No functional change

18 months agoRemove some conditions at PV improvement reduction
MinetaS [Fri, 7 Apr 2023 14:49:05 +0000 (14:49 +0000)]
Remove some conditions at PV improvement reduction

Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 63664 W: 17007 L: 16823 D: 29834
Ptnml(0-2): 163, 6998, 17336, 7162, 173
https://tests.stockfishchess.org/tests/view/6430b124028b029b01ac99f2

Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 90016 W: 24399 L: 24258 D: 41359
Ptnml(0-2): 52, 8672, 27405, 8841, 38
https://tests.stockfishchess.org/tests/view/64310e74028b029b01ad3131

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

Bench: 3661938

18 months agoSimplify stats assignment for Pv nodes
Michael Chaly [Tue, 11 Apr 2023 16:53:36 +0000 (19:53 +0300)]
Simplify stats assignment for Pv nodes

This patch is a simplification of my recent elo gainer.
Logically the Elo gainer didn't make much sense and this patch simplifies it into smth more logical.
Instead of assigning negative bonuses to all non-first moves that enter PV nodes
we assign positive bonuses in full depth search after LMR only for moves that
will result in a fail high - thus not assigning positive bonuses
for moves that will go to pv search - so doing "almost" the same as we do in master now for them.
Logic differs for some other moves, though, but this removes some lines of code.

Passed STC:
https://tests.stockfishchess.org/tests/view/642cf5cf77ff3301150dc5ec
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 409320 W: 109124 L: 109308 D: 190888
Ptnml(0-2): 1149, 45385, 111751, 45251, 1124

Passed LTC:
https://tests.stockfishchess.org/tests/view/642fe75d20eb941419bde200
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 260336 W: 70280 L: 70303 D: 119753
Ptnml(0-2): 99, 25236, 79528, 25199, 106

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

Bench:  4286815

18 months agoRemove good killer reduction rule.
Stefan Geschwentner [Mon, 10 Apr 2023 23:20:29 +0000 (01:20 +0200)]
Remove good killer reduction rule.

STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 246544 W: 65646 L: 65657 D: 115241
Ptnml(0-2): 706, 27350, 67138, 27405, 673
https://tests.stockfishchess.org/tests/view/642e253277ff3301150e9aa2

LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 165136 W: 44878 L: 44809 D: 75449
Ptnml(0-2): 64, 15991, 50378, 16082, 53
https://tests.stockfishchess.org/tests/view/6430db07028b029b01acd87f

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

Bench: 3746080

18 months agoRemove nmpColor
Dubslow [Thu, 6 Apr 2023 01:30:01 +0000 (20:30 -0500)]
Remove nmpColor

no benefit seen, neither in game play nor for zugzwang test positions

STC: https://tests.stockfishchess.org/tests/view/642e293977ff3301150e9b55
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 161848 W: 43332 L: 43254 D: 75262
Ptnml(0-2): 418, 16987, 46058, 17021, 440

LTC: https://tests.stockfishchess.org/tests/view/642fea9420eb941419bde296
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 120208 W: 32529 L: 32418 D: 55261
Ptnml(0-2): 35, 11424, 37080, 11525, 40

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

bench 3979409

18 months agoFix capturing underpromotions issue
peregrineshahin [Thu, 16 Mar 2023 21:04:41 +0000 (00:04 +0300)]
Fix capturing underpromotions issue

Fix underpromotion captures are generated amongst quiets although dealt with as a capture_stage in search, this makes not skipping them when move count pruning kicks-in consistent with updating their histories amongst captures.

Passed STC:
https://tests.stockfishchess.org/tests/view/6415579f65775d3b539e7537
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 118896 W: 31678 L: 31553 D: 55665
Ptnml(0-2): 356, 12911, 32793, 13028, 360

Passed LTC:
https://tests.stockfishchess.org/tests/view/641633b965775d3b539e9e95
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 126800 W: 34255 L: 34148 D: 58397
Ptnml(0-2): 57, 12216, 38763, 12291, 73

see also discussion in https://github.com/official-stockfish/Stockfish/pull/4436
closes https://github.com/official-stockfish/Stockfish/pull/4452

bench: 3979409

18 months agoSimplify away nnue scale pawn count multiplier
Linmiao Xu [Fri, 7 Apr 2023 16:33:28 +0000 (12:33 -0400)]
Simplify away nnue scale pawn count multiplier

Removes 2x multipliers in nnue scale calculation along with the pawn count term that was recently reintroduced.

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/64305bc720eb941419bdf72e
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 38008 W: 10234 L: 10021 D: 17753
Ptnml(0-2): 96, 4151, 10323, 4312, 122

Passed non-regression LTC:
https://tests.stockfishchess.org/tests/view/6430b76a028b029b01ac9bfd
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 91232 W: 24686 L: 24547 D: 41999
Ptnml(0-2): 30, 8721, 27986, 8838, 41

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

bench 4017320

18 months agoDo no initialize TM in all cases
Maxim Masiutin [Sat, 1 Apr 2023 20:49:03 +0000 (23:49 +0300)]
Do no initialize TM in all cases

Avoid doing full TM initialization if it won't be used, avoids division by zero.

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

No functional change

18 months agoReduce Position::pieces() overloads
mstembera [Wed, 5 Apr 2023 02:44:09 +0000 (19:44 -0700)]
Reduce Position::pieces() overloads

Reduce the number of overloads for pieces() by using a more general template implementation.
Secondly simplify some code in search.cpp using the new general functionality.

TC https://tests.stockfishchess.org/tests/view/642ce27877ff3301150dc193
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 269640 W: 71775 L: 71809 D: 126056
Ptnml(0-2): 687, 27294, 78885, 27274, 680

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

No functional change.

18 months agoMade two specializations for affine transform easier to understand.
Maxim Masiutin [Thu, 6 Apr 2023 11:08:50 +0000 (14:08 +0300)]
Made two specializations for affine transform easier to understand.

Added AVX-512 for the specialization for small inputs

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

No functional change

18 months agoRemove extraReduction
MinetaS [Fri, 7 Apr 2023 14:30:59 +0000 (14:30 +0000)]
Remove extraReduction

Since bestValue becomes value and beta - alpha is always non-negative,
extraReduction is always false, hence it has no effect.

This patch includes small changes to improve readability.

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

No functional change

18 months agoUse int conversion for Option class
MinetaS [Fri, 7 Apr 2023 15:23:04 +0000 (15:23 +0000)]
Use int conversion for Option class

The current implementation generates warnings on MSVC. However, we have
no real use cases for double-typed UCI option values now. Also parameter
tuning only accepts following three types:

  int, Value, Score

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

No functional change

18 months agoFix linking / character types of windows API calls
Maxim Masiutin [Sat, 1 Apr 2023 17:14:41 +0000 (20:14 +0300)]
Fix linking / character types of windows API calls

ensures large pages can be allocated again.

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

No functional change

18 months agoFix rootComplexity calculation
Joost VandeVondele [Sun, 9 Apr 2023 07:18:29 +0000 (09:18 +0200)]
Fix rootComplexity calculation

The calculation of rootComplexity can't call eval when in check.
Doing so triggers an assert if compiled in debug mode when
the rootpos is evaluated using classical eval.

Fixes https://github.com/official-stockfish/Stockfish/issues/4512

Passed STC:
https://tests.stockfishchess.org/tests/view/6432697431feee5c6d306876
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 41096 W: 11017 L: 10815 D: 19264
Ptnml(0-2): 113, 4172, 11780, 4366, 117

Running LTC:
https://tests.stockfishchess.org/tests/view/6432974d31feee5c6d306fc0
LLR: 1.76 (-2.94,2.94) <-1.75,0.25>
Total: 73200 W: 19792 L: 19728 D: 33680
Ptnml(0-2): 24, 6659, 23182, 6699, 36

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

No functional change

18 months agoDepth Tweak and tuning
FauziAkram [Wed, 5 Apr 2023 21:35:05 +0000 (00:35 +0300)]
Depth Tweak and tuning

tunes reduction related parameters, and introduces more reduction on found good moves.

credit for this patch goes also to candirufish Yoshie2000 dubslow peregrineshahin Vizvezdenec

Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 38424 W: 10346 L: 10040 D: 18038
Ptnml(0-2): 103, 4111, 10473, 4427, 98
https://tests.stockfishchess.org/tests/view/642ca74277ff3301150db511

Passed LTC:
LLR: 2.97 (-2.94,2.94) <0.50,2.50>
Total: 136968 W: 37151 L: 36660 D: 63157
Ptnml(0-2): 43, 13052, 41808, 13533, 48
https://tests.stockfishchess.org/tests/view/642d632377ff3301150dddbe

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

bench: 3672914

18 months agoAssign negative stat bonuses for quiet moves at Pv nodes
Michael Chaly [Wed, 5 Apr 2023 02:48:34 +0000 (05:48 +0300)]
Assign negative stat bonuses for quiet moves at Pv nodes

This patch assigns negative stat bonuses for quiet moves
at pv nodes which are searched at depth greater than
this node assumes, so are extended.

Passed STC:
https://tests.stockfishchess.org/tests/view/6426198bdb43ab2ba6f9cfa2
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 548944 W: 147287 L: 146254 D: 255403
Ptnml(0-2): 1662, 59772, 150671, 60605, 1762

Passed LTC:
https://tests.stockfishchess.org/tests/view/642be4f177ff3301150d892d
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 93352 W: 25400 L: 24994 D: 42958
Ptnml(0-2): 44, 8817, 28547, 9225, 43

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

bench 5044536

18 months agoSimplify away piece count condition for useClassical
Muzhen Gaming [Tue, 4 Apr 2023 23:25:00 +0000 (07:25 +0800)]
Simplify away piece count condition for useClassical

Simplify away the piece count condition for useClassical. In compensation, the psq requirement is increased by 15%.

Also updated the Elo estimate for useClassical, based on recent testing.

Simplification STC:
https://tests.stockfishchess.org/tests/view/642acbb577ff3301150d3ef5
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 51984 W: 13906 L: 13707 D: 24371
Ptnml(0-2): 150, 5638, 14227, 5817, 160

Simplification LTC:
https://tests.stockfishchess.org/tests/view/642b9c5777ff3301150d778a
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 119696 W: 32412 L: 32300 D: 54984
Ptnml(0-2): 53, 11529, 36567, 11651, 48

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

Bench: 5089321

18 months agoParameters Tweak
FauziAkram [Tue, 4 Apr 2023 11:26:29 +0000 (14:26 +0300)]
Parameters Tweak

Passed STC
LLR: 3.22 (-2.94,2.94) <0.00,2.00>
Total: 664048 W: 177526 L: 176301 D: 310221
Ptnml(0-2): 2002, 72968, 180891, 74129, 2034
https://tests.stockfishchess.org/tests/view/64219901db43ab2ba6f901fa

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 77576 W: 21125 L: 20750 D: 35701
Ptnml(0-2): 24, 7350, 23669, 7717, 28
https://tests.stockfishchess.org/tests/view/642abe3377ff3301150d3a16

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

bench: 4522076

18 months agoSimplifiy TM's root complexity
Dubslow [Sat, 1 Apr 2023 23:48:31 +0000 (18:48 -0500)]
Simplifiy TM's root complexity

Also requires moving optimism initialization, this is a very early `evaluate()` call.

STC: https://tests.stockfishchess.org/tests/view/6428c39677ff3301150ca0d7
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 51256 W: 13805 L: 13612 D: 23839
Ptnml(0-2): 145, 5283, 14592, 5450, 158

LTC: https://tests.stockfishchess.org/tests/view/64296ff377ff3301150cc519
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 106968 W: 28951 L: 28830 D: 49187
Ptnml(0-2): 47, 9746, 33789, 9843, 59

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

no functional change

18 months agoRemove unneeded bitboard from MP
Miguel Lahoz [Sun, 2 Apr 2023 09:28:39 +0000 (17:28 +0800)]
Remove unneeded bitboard from MP

Recent simplification has removed the need for an extra bitboard in MP struct.
Use a local variable instead.

STC: Passed Non-regression test
https://tests.stockfishchess.org/tests/view/64294ae677ff3301150cba16
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 64872 W: 17383 L: 17203 D: 30286
Ptnml(0-2): 179, 6675, 18546, 6859, 177

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

No functional change.

19 months agoDecrease Depth more for positions not in TT.
FauziAkram [Sat, 1 Apr 2023 12:22:53 +0000 (15:22 +0300)]
Decrease Depth more for positions not in TT.

If the position is not in TT, decrease depth by 2
or by 4 if the TT entry for the current position was hit
and the stored depth is greater than or equal to the current depth.

Many thanks to Vizvezdenec as the main idea was his.

Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 70664 W: 18995 L: 18639 D: 33030
Ptnml(0-2): 228, 7712, 19090, 8080, 222
https://tests.stockfishchess.org/tests/view/64258a8bdb43ab2ba6f9b682

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 85040 W: 23227 L: 22836 D: 38977
Ptnml(0-2): 26, 8115, 25867, 8466, 46
https://tests.stockfishchess.org/tests/view/64262057db43ab2ba6f9d0e7

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

bench: 4380438

19 months agoReplace deprecated icc with icx
Maxim Masiutin [Fri, 31 Mar 2023 15:16:50 +0000 (18:16 +0300)]
Replace deprecated icc with icx

Replace the deprecated Intel compiler icc with its newer icx variant.
This newer compiler is based on clang, and yields good performance.
As before, currently only linux is supported.

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

No functional change

19 months agoSimplify away complexityAverage
MinetaS [Thu, 30 Mar 2023 11:14:30 +0000 (11:14 +0000)]
Simplify away complexityAverage

Instead of tracking the average of complexity values, calculate
complexity of root position at the beginning of the search and use it as
a scaling factor in time management.

Passed non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 58752 W: 15738 L: 15551 D: 27463
Ptnml(0-2): 164, 6194, 16478, 6371, 169
https://tests.stockfishchess.org/tests/view/6423010edb43ab2ba6f9424a

Passed non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 92872 W: 24865 L: 24729 D: 43278
Ptnml(0-2): 38, 8652, 28929, 8770, 47
https://tests.stockfishchess.org/tests/view/6423c1f0db43ab2ba6f9644f

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

No functional change

19 months agoStringify the git info passed
Joost VandeVondele [Sat, 1 Apr 2023 09:56:49 +0000 (11:56 +0200)]
Stringify the git info passed

avoid escaping the string in the Makefile.

Alternative to https://github.com/official-stockfish/Stockfish/pull/4476

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

No functional change.

19 months agoRemove reduction for moving threatened piece
Muzhen Gaming [Thu, 30 Mar 2023 09:46:15 +0000 (17:46 +0800)]
Remove reduction for moving threatened piece

Simplify away "Decrease reduction if we move a threatened piece".

Running a dbg_hit_on() shows that this line is only called ~0.12% of the time.

Simplification STC: https://tests.stockfishchess.org/tests/view/641ec2dcdb43ab2ba6f88103
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 146128 W: 39168 L: 39070 D: 67890
Ptnml(0-2): 466, 16117, 39830, 16155, 496

Simplification LTC: https://tests.stockfishchess.org/tests/view/64200689db43ab2ba6f8bca8
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 248016 W: 66703 L: 66714 D: 114599
Ptnml(0-2): 105, 24202, 75406, 24189, 106

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

Bench: 4961236

19 months agoMade advanced Windows API calls dynamically linked
Maxim Masiutin [Wed, 29 Mar 2023 09:43:36 +0000 (12:43 +0300)]
Made advanced Windows API calls dynamically linked

Made advanced Windows API calls (those from Advapi32.dll) dynamically
linked to avoid link errors when compiling using
Intel icx compiler for Windows.

https://github.com/official-stockfish/Stockfish/pull/4467

No functional change

19 months agoImprove compatibility
Maxim Masiutin [Sun, 12 Mar 2023 13:16:51 +0000 (15:16 +0200)]
Improve compatibility

this makes it easier to compile under MSVC, even though we recommend gcc/clang for production compiles at the moment.

In Win32 API, by default, most null-terminated character strings arguments are of wchar_t (UTF16, formerly UCS16-LE) type, i.e. 2 bytes (at least) per character. So, src/misc.cpp should have proper type. Respectively, for src/syzygy/tbprobe.cpp, in Widows, file paths should be std::wstring rather than std::string. However, this requires a very big number of changes, since the config files are also keeping the 8-bit-per-character std::string strings. Therefore, just one change of using 8-byte-per-character CreateFileA make it compile under MSVC.

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

No functional change