]> git.sesse.net Git - stockfish/log
stockfish
23 months 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

23 months 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

23 months 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

23 months 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

23 months 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

2 years agoSimplify time management.
Stefan Geschwentner [Wed, 27 Apr 2022 11:09:53 +0000 (13:09 +0200)]
Simplify time management.

Replace the best move instability adjustment factor by a simpler version which doesn't have a dependency on the iteration depth.

STC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 30800 W: 8232 L: 8073 D: 14495
Ptnml(0-2): 101, 3309, 8444, 3422, 124
https://tests.stockfishchess.org/tests/view/6266c77bc5b924ba22908d30

LTC:
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 61664 W: 16375 L: 16272 D: 29017
Ptnml(0-2): 40, 5869, 18897, 6000, 26
https://tests.stockfishchess.org/tests/view/6266fc39b3d1812808915f23

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

Bench: 7729968

2 years agoNegative extension for ttMove that is less than alpha and value
candirufish [Fri, 22 Apr 2022 06:03:50 +0000 (08:03 +0200)]
Negative extension for ttMove that is less than alpha and value

in the context of singular extensions

Passed STC:
https://tests.stockfishchess.org/tests/view/626047e8b03f22647441ade0
LLR: 2.97 (-2.94,2.94) <0.00,2.50>
Total: 50296 W: 13410 L: 13108 D: 23778
Ptnml(0-2): 196, 5548, 13370, 5826, 208

Passed LTC:
https://tests.stockfishchess.org/tests/view/6260a513b03f22647441b970
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 83896 W: 22433 L: 22054 D: 39409
Ptnml(0-2): 49, 8273, 24938, 8626, 62

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

bench: 7729968

2 years agoSimplify away best move count logic
Michael Chaly [Thu, 21 Apr 2022 12:28:23 +0000 (15:28 +0300)]
Simplify away best move count logic

the only place where it was used it was true with >99% probability so it seemed to not be doing much any more.

Passed STC:
https://tests.stockfishchess.org/tests/view/625f4778d00da81c22dd4c93
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 85152 W: 22487 L: 22406 D: 40259
Ptnml(0-2): 313, 9035, 23818, 9078, 332

Passed LTC:
https://tests.stockfishchess.org/tests/view/625ff1f1b03f22647441a215
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 66776 W: 17768 L: 17673 D: 31335
Ptnml(0-2): 46, 6200, 20792, 6313, 37

close https://github.com/official-stockfish/Stockfish/pull/3993

bench 7280798

2 years agoUpdate default net to nn-d0b74ce1e5eb.nnue
Joost VandeVondele [Mon, 18 Apr 2022 05:34:03 +0000 (07:34 +0200)]
Update default net to nn-d0b74ce1e5eb.nnue

train a net using training data with a
heavier weight on positions having 16 pieces on the board. More specifically,
with a relative weight of `i * (32-i)/(16 * 16)+1` (where i is the number of pieces on the board).

This is done with the trainer branch https://github.com/glinscott/nnue-pytorch/pull/173

The command used is:
```
python train.py $datafile $datafile $restarttype $restartfile --gpus 1 --threads 4 --num-workers 12 --random-fen-skipping=3 --batch-size 16384 --progress_bar_refresh_rate 300 --smart-fen-skipping --features=HalfKAv2_hm^   --lambda=1.00  --max_epochs=$epochs --seed $RANDOM --default_root_dir exp/run_$i
```
The datafile is T60T70wIsRightFarseerT60T74T75T76.binpack, the restart is from the master net.

passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 22728 W: 6197 L: 5945 D: 10586
Ptnml(0-2): 105, 2453, 6001, 2695, 110
https://tests.stockfishchess.org/tests/view/625cf944ff677a888877cd90

passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 35664 W: 9535 L: 9264 D: 16865
Ptnml(0-2): 30, 3524, 10455, 3791, 32
https://tests.stockfishchess.org/tests/view/625d3c32ff677a888877d7ca

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

Bench: 7269563

2 years agoRestore development version
Joost VandeVondele [Mon, 18 Apr 2022 21:05:24 +0000 (23:05 +0200)]
Restore development version

No functional change.

2 years agoStockfish 15
Joost VandeVondele [Mon, 18 Apr 2022 08:17:57 +0000 (10:17 +0200)]
Stockfish 15

Official release version of Stockfish 15

Bench: 8129754

---

A new major release of Stockfish is now available at https://stockfishchess.org

Stockfish 15 continues to push the boundaries of chess, providing unrivalled
analysis and playing strength. In our testing, Stockfish 15 is ahead of
Stockfish 14 by 36 Elo points and wins nine times more game pairs than it
loses[1].

Improvements to the engine have made it possible for Stockfish to end up
victorious in tournaments at all sorts of time controls ranging from bullet to
classical and even at Fischer random chess[2]. At CCC, Stockfish won all of
the latest tournaments: CCC 16 Bullet, Blitz and Rapid, CCC 960 championship,
and the CCC 17 Rapid. At TCEC, Stockfish won the Season 21, Cup 9, FRC 4 and
in the current Season 22 superfinal, at the time of writing, has won 16 game
pairs and not yet lost a single one.

This progress is the result of a dedicated team of developers that comes up
with new ideas and improvements. For Stockfish 15, we tested nearly 13000
different changes and retained the best 200. These include the fourth
generation of our NNUE network architecture, as well as various search
improvements. To perform these tests, contributors provide CPU time for
testing, and in the last year, they have collectively played roughly a
billion chess games. In the last few years, our distributed testing
framework, Fishtest, has been operated superbly and has been developed and
improved extensively. This work by Pasquale Pigazzini, Tom Vijlbrief, Michel
Van den Bergh, and various other developers[3] is an essential part of the
success of the Stockfish project.

Indeed, the Stockfish project builds on a thriving community of enthusiasts
to offer 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[4].

The Stockfish team

[1] https://tests.stockfishchess.org/tests/view/625d156dff677a888877d1be
[2] https://en.wikipedia.org/wiki/Stockfish_(chess)#Competition_results
[3] https://github.com/glinscott/fishtest/blob/master/AUTHORS
[4] https://stockfishchess.org/get-involved/

2 years agoDecrease LMR at PV nodes with low depth.
KJE-98 [Fri, 15 Apr 2022 02:09:50 +0000 (22:09 -0400)]
Decrease LMR at PV nodes with low depth.

This patch lessens the Late Move Reduction at PV nodes with low depth. Previously the affect of depth on LMR was independant of nodeType. The idea behind this patch is that at PV nodes, LMR at low depth is will miss out on potential alpha-raising moves.

Passed STC:
https://tests.stockfishchess.org/tests/view/625aa867d3367522c4b8965c
LLR: 2.93 (-2.94,2.94) <0.00,2.50>
Total: 19360 W: 5252 L: 5006 D: 9102
Ptnml(0-2): 79, 2113, 5069, 2321, 98

Passed LTC:
https://tests.stockfishchess.org/tests/view/625ae844d3367522c4b8a009
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 39264 W: 10636 L: 10357 D: 18271
Ptnml(0-2): 18, 3928, 11473, 4183, 30

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

bench: 8129754

2 years agoTuning classical and NNUE scaling terms
FauziAkram [Tue, 12 Apr 2022 17:45:25 +0000 (20:45 +0300)]
Tuning classical and NNUE scaling terms

changes to parameters in both classical and NNUE scaling, following up from an earlier successful #3958

passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 23936 W: 6490 L: 6234 D: 11212
Ptnml(0-2): 107, 2610, 6306, 2810, 135
https://tests.stockfishchess.org/tests/view/625820aa33c40bb9d964e6ae

passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 50376 W: 13629 L: 13327 D: 23420
Ptnml(0-2): 20, 4979, 14920, 5217, 52
https://tests.stockfishchess.org/tests/view/62584592c1d7f5008a33a4d1

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

Bench: 6964954

2 years agoUpdate WDL model for current SF
Joost VandeVondele [Fri, 15 Apr 2022 15:23:51 +0000 (17:23 +0200)]
Update WDL model for current SF

This updates the WDL model based on the LTC statistics for the last month (8M games).

for old results see:
https://github.com/official-stockfish/Stockfish/pull/3582
https://github.com/official-stockfish/Stockfish/pull/2778

the model changed a bit from the past, some images to follow in the PR

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

No functional change.

2 years agoUpdate CPU contributors
Joost VandeVondele [Thu, 14 Apr 2022 21:00:14 +0000 (23:00 +0200)]
Update CPU contributors

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

No functional change

2 years agoUse NNUE in low piece endgames close to the root.
Topologist [Sat, 9 Apr 2022 06:55:40 +0000 (08:55 +0200)]
Use NNUE in low piece endgames close to the root.

This patch enforces that NNUE evaluation is used for endgame positions at shallow depth (depth <= 9).
Classic evaluation will still be used for high imbalance positions when the depth is high or there are many pieces.

Passed STC:
https://tests.stockfishchess.org/tests/view/624c193b3a8a6ac93892dc27
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 255840 W: 68024 L: 67362 D: 120454
Ptnml(0-2): 1074, 27089, 70926, 27763, 1068

Passed LTC:
https://tests.stockfishchess.org/tests/view/624e8675e9e7821808467f77
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 67088 W: 17784 L: 17454 D: 31850
Ptnml(0-2): 45, 6209, 20715, 6521, 54

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

bench: 6602222

2 years agoMinor cleanups
mstembera [Thu, 31 Mar 2022 01:14:27 +0000 (18:14 -0700)]
Minor cleanups

simplify and relocate to position.cpp some of the recent threat calculations used in the movepicker.

passed STC:
https://tests.stockfishchess.org/tests/view/62468c301f682ea45ce3b3b9
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 76544 W: 20247 L: 20152 D: 36145
Ptnml(0-2): 327, 8113, 21317, 8168, 347

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

No functional change

2 years agoPlay more positional in endgames
Topologist [Mon, 28 Mar 2022 09:50:08 +0000 (11:50 +0200)]
Play more positional in endgames

This patch chooses the delta value (which skews the nnue evaluation between positional and materialistic)
depending on the material: If the material is low, delta will be higher and the evaluation is shifted
to the positional value. If the material is high, the evaluation will be shifted to the psqt value.
I don't think slightly negative values of delta should be a concern.

Passed STC:
https://tests.stockfishchess.org/tests/view/62418513b3b383e86185766f
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 28808 W: 7832 L: 7564 D: 13412
Ptnml(0-2): 147, 3186, 7505, 3384, 182

Passed LTC:
https://tests.stockfishchess.org/tests/view/62419137b3b383e861857842
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 58632 W: 15776 L: 15450 D: 27406
Ptnml(0-2): 42, 5889, 17149, 6173, 63

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

Bench: 7588855

2 years agoIn movepicker increase priority for moves that evade a capture
Michael Chaly [Mon, 28 Mar 2022 11:15:56 +0000 (14:15 +0300)]
In movepicker increase priority for moves that evade a capture

This idea is a mix of koivisto idea of threat history and heuristic that
was simplified some time ago in LMR - decreasing reduction for moves that evade a capture.
Instead of doing so in LMR this patch does it in movepicker - to do this it
calculates squares that are attacked by different piece types and pieces that are located
on this squares and boosts up weight of moves that make this pieces land on a square that is not under threat.
Boost is greater for pieces with bigger material values.
Special thanks to koivisto and seer authors for explaining me ideas behind threat history.

Passed STC:
https://tests.stockfishchess.org/tests/view/62406e473b32264b9aa1478b
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 19816 W: 5320 L: 5072 D: 9424
Ptnml(0-2): 86, 2165, 5172, 2385, 100

Passed LTC:
https://tests.stockfishchess.org/tests/view/62407f2e3b32264b9aa149c8
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 51200 W: 13805 L: 13500 D: 23895
Ptnml(0-2): 44, 5023, 15164, 5322, 47

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

bench 7736491

2 years agoRemove pos.capture_or_promotion()
Giacomo Lorenzetti [Wed, 23 Mar 2022 11:04:10 +0000 (12:04 +0100)]
Remove pos.capture_or_promotion()

This patch replaces `pos.capture_or_promotion()` with `pos.capture()`
and comes after a few attempts with elo-gaining bounds, two of which
failed yellow at LTC
(https://tests.stockfishchess.org/tests/view/622f8f0cc9e950cbfc237024
and
https://tests.stockfishchess.org/tests/view/62319a8bb3b498ba71a6b2dc).

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/623aff7eea447151c74828d3
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 246864 W: 65462 L: 65618 D: 115784
Ptnml(0-2): 1201, 28116, 65001, 27866, 1248

Passed non-regression LTC:
https://tests.stockfishchess.org/tests/view/623c1fdcea447151c7484fb0
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 30120 W: 8125 L: 7978 D: 14017
Ptnml(0-2): 22, 2993, 8881, 3144, 20

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

Bench: 6847732

2 years agoRemove ttPv tree shrinking.
Stefan Geschwentner [Tue, 15 Mar 2022 15:53:59 +0000 (16:53 +0100)]
Remove ttPv tree shrinking.

Via the ttPv flag an implicit tree of current and former PV nodes is maintained. In addition this tree is grown or shrinked at the leafs dependant on the search results. But now the shrinking step has been removed.

As the frequency of ttPv nodes decreases with depth the shown scaling behavior (STC barely passed but LTC scales well) of the tests was expected.

STC:
LLR: 2.93 (-2.94,2.94) <-2.25,0.25>
Total: 270408 W: 71593 L: 71785 D: 127030
Ptnml(0-2): 1339, 31024, 70630, 30912, 1299
https://tests.stockfishchess.org/tests/view/622fbf9dc9e950cbfc2376d6

LTC:
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 34368 W: 9135 L: 8992 D: 16241
Ptnml(0-2): 28, 3423, 10135, 3574, 24
https://tests.stockfishchess.org/tests/view/62305257c9e950cbfc238964

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

Bench: 7044203

2 years agoSmall cleanups (2)
mstembera [Sat, 12 Mar 2022 15:00:58 +0000 (07:00 -0800)]
Small cleanups (2)

- fix a small compile error under MSVC
- improve sigmoid comment and assert
- fix formatting in README.md

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

No functional change

2 years agoSmall cleanups
Giacomo Lorenzetti [Sat, 5 Feb 2022 09:18:50 +0000 (10:18 +0100)]
Small cleanups

Delete cast to int in movepick.
update AUTHORS.
adjust assert in sigmoid.
fix spelling mistakes in README

closes https://github.com/official-stockfish/Stockfish/pull/3922
closes https://github.com/official-stockfish/Stockfish/pull/3948
closes https://github.com/official-stockfish/Stockfish/pull/3942

No functional change

2 years agoImprovements in Evaluation
FauziAkram [Wed, 9 Mar 2022 15:40:54 +0000 (18:40 +0300)]
Improvements in Evaluation

adjust parameters in classical evaluation and NNUE scaling.

STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 37104 W: 9983 L: 9701 D: 17420
Ptnml(0-2): 154, 4187, 9651, 4343, 217
https://tests.stockfishchess.org/tests/view/6228cb13a9d47c8160e885ba

LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 266792 W: 71101 L: 70295 D: 125396
Ptnml(0-2): 214, 26928, 78353, 27640, 261
https://tests.stockfishchess.org/tests/view/6228d3c4a9d47c8160e887b0

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

Bench: 6739741

2 years agoDecrease reductions in Lmr for some Pv nodes
Michael Chaly [Tue, 8 Mar 2022 07:56:07 +0000 (10:56 +0300)]
Decrease reductions in Lmr for some Pv nodes

This patch makes us reduce less in Lmr at pv nodes in case of static eval being far away from static evaluation of position.
Idea is that if it's the case then probably position is pretty complex so we can't be sure about how reliable LMR is so we need to reduce less.

Passed STC:
https://tests.stockfishchess.org/tests/view/6226276aa9d47c8160e81220
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 262696 W: 69944 L: 69239 D: 123513
Ptnml(0-2): 1399, 29702, 68436, 30417, 1394

Passed LTC:
https://tests.stockfishchess.org/tests/view/6226b002a9d47c8160e82b91
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 64008 W: 17320 L: 16982 D: 29706
Ptnml(0-2): 60, 6378, 18811, 6674, 81

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

bench 6678390

2 years agoGeneralize the feature transform to use vec_t macros
Ben Chaney [Tue, 1 Mar 2022 22:49:02 +0000 (17:49 -0500)]
Generalize the feature transform to use vec_t macros

This commit generalizes the feature transform to use vec_t macros
that are architecture defined instead of using a seperate code path for each one.

It should make some old architectures (MMX, including improvements by Fanael) faster
and make further such improvements easier in the future.

Includes some corrections to CI for mingw.

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

No functional change

2 years agoSort captures
Giacomo Lorenzetti [Tue, 1 Mar 2022 08:34:40 +0000 (09:34 +0100)]
Sort captures

This patch (partially) sort captures in analogy to quiet moves. All
three movepickers are affected, hence `depth` is added as an argument in
probcut's.

Passed STC:
https://tests.stockfishchess.org/tests/view/621a4576da649bba32ef6fd4
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 103848 W: 27884 L: 27473 D: 48491
Ptnml(0-2): 587, 11691, 26974, 12068, 604

Passed LTC:
https://tests.stockfishchess.org/tests/view/621aaa5bda649bba32ef7c2d
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 212032 W: 56420 L: 55739 D: 99873
Ptnml(0-2): 198, 21310, 62348, 21933, 227

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

Bench: 6833580

2 years agoUse dynamic allocation for evaluation scratch TLS buffer.
Tomasz Sobczyk [Sun, 27 Feb 2022 16:02:13 +0000 (17:02 +0100)]
Use dynamic allocation for evaluation scratch TLS buffer.

fixes #3946 an issue related with the toolchain as found in xcode 12 on macOS,
related to previous commit 5f781d36.

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

No functional change

2 years agoClean up and simplify some nnue code.
mstembera [Thu, 24 Feb 2022 02:19:36 +0000 (18:19 -0800)]
Clean up and simplify some nnue code.

Remove some unnecessary code and it's execution during inference. Also the change on line 49 in nnue_architecture.h results in a more efficient SIMD code path through ClippedReLU::propagate().

passed STC:
https://tests.stockfishchess.org/tests/view/6217d3bfda649bba32ef25d5
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 12056 W: 3281 L: 3092 D: 5683
Ptnml(0-2): 55, 1213, 3312, 1384, 64

passed STC SMP:
https://tests.stockfishchess.org/tests/view/6217f344da649bba32ef295e
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 27376 W: 7295 L: 7137 D: 12944
Ptnml(0-2): 52, 2859, 7715, 3003, 59

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

No functional change

bench: 6820724

2 years agoAdjust usage of LMR for 2nd move in move ordering
Michael Chaly [Sat, 19 Feb 2022 15:24:11 +0000 (18:24 +0300)]
Adjust usage of LMR for 2nd move in move ordering

Current master prohibits usage of LMR for 2nd move at rootNode. This patch also disables LMR for 2nd move not only at rootNode but also at first PvNode that is a reply to rootNode.

passed STC:
https://tests.stockfishchess.org/tests/view/620e8c9026f5b17ec885143a
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 54096 W: 14305 L: 13996 D: 25795
Ptnml(0-2): 209, 6075, 14192, 6342, 230

passed LTC:
https://tests.stockfishchess.org/tests/view/620eb327b1792e8985f81fb8
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 110864 W: 29602 L: 29156 D: 52106
Ptnml(0-2): 112, 11147, 32455, 11619, 99

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

bench 6820724

2 years agoFix clang warning on unused variable
Joost VandeVondele [Sun, 20 Feb 2022 16:36:19 +0000 (17:36 +0100)]
Fix clang warning on unused variable

mark variable as used.

fixes https://github.com/official-stockfish/Stockfish/issues/3900
closes https://github.com/official-stockfish/Stockfish/pull/3941

No functional change

2 years agoAdd ARM NDK to Github Actions matrix
ppigazzini [Sun, 6 Feb 2022 18:20:30 +0000 (19:20 +0100)]
Add ARM NDK to Github Actions matrix

- set the variable only for the required tests to keep simple the yml file
- use NDK 21.x until will be fixed the Stockfish static build problem
  with NDK 23.x
- set the test for armv7, armv7-neon, armv8 builds:
  - use armv7a-linux-androideabi21-clang++ compiler for armv7 armv7-neon
  - enforce a static build
  - silence the Warning for the unused compilation flag "-pie" with
    the static build, otherwise the Github workflow stops
  - use qemu to bench the build and get the signature

Many thanks to @pschneider1968 that made all the hard work with NDK :)

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

No functional change

2 years agoTune search at very long time control
Michael Chaly [Thu, 17 Feb 2022 07:54:07 +0000 (10:54 +0300)]
Tune search at very long time control

This patch is a result of tuning done by user @candirufish after 150k games.

Since the tuned values were really interesting and touched heuristics
that are known for their non-linear scaling I decided to run limited
games LTC match, even if the STC test was really bad (which was expected).
After seeing the results of the LTC match, I also run a VLTC (very long
time control) SPRTtest, which passed.

The main difference is in extensions: this patch allows much more
singular/double extensions, both in terms of allowing them at lower
depths and with lesser margins.

Failed STC:
https://tests.stockfishchess.org/tests/view/620d66643ec80158c0cd3b46
LLR: -2.94 (-2.94,2.94) <0.00,2.50>
Total: 4968 W: 1194 L: 1398 D: 2376
Ptnml(0-2): 47, 633, 1294, 497, 13

Performed well at LTC in a fixed-length match:
https://tests.stockfishchess.org/tests/view/620d66823ec80158c0cd3b4a
ELO: 3.36 +-1.8 (95%) LOS: 100.0%
Total: 30000 W: 7966 L: 7676 D: 14358
Ptnml(0-2): 36, 2936, 8755, 3248, 25

Passed VLTC SPRT test:
https://tests.stockfishchess.org/tests/view/620da11a26f5b17ec884f939
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 4400 W: 1326 L: 1127 D: 1947
Ptnml(0-2): 13, 309, 1348, 526, 4

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

Bench: 6318903

2 years agoBig search tuning (version 2)
Michael Chaly [Sat, 12 Feb 2022 17:08:45 +0000 (20:08 +0300)]
Big search tuning (version 2)

One more tuning - this one includes newly introduced heuristics and
some other parameters that were not included in previous one. Result
of 400k games at 20+0.2 "as is". Tuning is continuing since there is
probably a lot more elo to gain.

STC:
https://tests.stockfishchess.org/tests/view/620782edd71106ed12a497d1
LLR: 2.99 (-2.94,2.94) <0.00,2.50>
Total: 38504 W: 10260 L: 9978 D: 18266
Ptnml(0-2): 142, 4249, 10230, 4447, 184

LTC:
https://tests.stockfishchess.org/tests/view/6207a243d71106ed12a49d07
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 25176 W: 6793 L: 6546 D: 11837
Ptnml(0-2): 20, 2472, 7360, 2713, 23

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

Bench: 4784796

2 years agoUpdate architecture to "SFNNv4". Update network to nn-6877cd24400e.nnue.
Tomasz Sobczyk [Sat, 27 Nov 2021 14:17:02 +0000 (15:17 +0100)]
Update architecture to "SFNNv4". Update network to nn-6877cd24400e.nnue.

Architecture:

The diagram of the "SFNNv4" architecture:
https://user-images.githubusercontent.com/8037982/153455685-cbe3a038-e158-4481-844d-9d5fccf5c33a.png

The most important architectural changes are the following:

* 1024x2 [activated] neurons are pairwise, elementwise multiplied (not quite pairwise due to implementation details, see diagram), which introduces a non-linearity that exhibits similar benefits to previously tested sigmoid activation (quantmoid4), while being slightly faster.
* The following layer has therefore 2x less inputs, which we compensate by having 2 more outputs. It is possible that reducing the number of outputs might be beneficial (as we had it as low as 8 before). The layer is now 1024->16.
* The 16 outputs are split into 15 and 1. The 1-wide output is added to the network output (after some necessary scaling due to quantization differences). The 15-wide is activated and follows the usual path through a set of linear layers. The additional 1-wide output is at least neutral, but has shown a slightly positive trend in training compared to networks without it (all 16 outputs through the usual path), and allows possibly an additional stage of lazy evaluation to be introduced in the future.

Additionally, the inference code was rewritten and no longer uses a recursive implementation. This was necessitated by the splitting of the 16-wide intermediate result into two, which was impossible to do with the old implementation with ugly hacks. This is hopefully overall for the better.

First session:

The first session was training a network from scratch (random initialization). The exact trainer used was slightly different (older) from the one used in the second session, but it should not have a measurable effect. The purpose of this session is to establish a strong network base for the second session. Small deviations in strength do not harm the learnability in the second session.

The training was done using the following command:

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

Every 20th net was saved and its playing strength measured against some baseline at 25k nodes per move with pure NNUE evaluation (modified binary). The exact setup is not important as long as it's consistent. The purpose is to sift good candidates from bad ones.

The dataset can be found https://drive.google.com/file/d/1UQdZN_LWQ265spwTBwDKo0t1WjSJKvWY/view

Second session:

The second training session was done starting from the best network (as determined by strength testing) from the first session. It is important that it's resumed from a .pt model and NOT a .ckpt model. The conversion can be performed directly using serialize.py

The LR schedule was modified to use gamma=0.995 instead of gamma=0.992 and LR=4.375e-4 instead of LR=8.75e-4 to flatten the LR curve and allow for longer training. The training was then running for 800 epochs instead of 400 (though it's possibly mostly noise after around epoch 600).

The training was done using the following command:

The training was done using the following command:

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

In particular note that we now use lambda=1.0 instead of lambda=0.8 (previous nets), because tests show that WDL-skipping introduced by vondele performs better with lambda=1.0. Nets were being saved every 20th epoch. In total 16 runs were made with these settings and the best nets chosen according to playing strength at 25k nodes per move with pure NNUE evaluation - these are the 4 nets that have been put on fishtest.

The dataset can be found either at ftp://ftp.chessdb.cn/pub/sopel/data_sf/T60T70wIsRightFarseerT60T74T75T76.binpack in its entirety (download might be painfully slow because hosted in China) or can be assembled in the following way:

Get the https://github.com/official-stockfish/Stockfish/blob/5640ad48ae5881223b868362c1cbeb042947f7b4/script/interleave_binpacks.py script.
Download T60T70wIsRightFarseer.binpack https://drive.google.com/file/d/1_sQoWBl31WAxNXma2v45004CIVltytP8/view
Download farseerT74.binpack http://trainingdata.farseer.org/T74-May13-End.7z
Download farseerT75.binpack http://trainingdata.farseer.org/T75-June3rd-End.7z
Download farseerT76.binpack http://trainingdata.farseer.org/T76-Nov10th-End.7z
Run python3 interleave_binpacks.py T60T70wIsRightFarseer.binpack farseerT74.binpack farseerT75.binpack farseerT76.binpack T60T70wIsRightFarseerT60T74T75T76.binpack

Tests:

STC: https://tests.stockfishchess.org/tests/view/6203fb85d71106ed12a407b7
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 16952 W: 4775 L: 4521 D: 7656
Ptnml(0-2): 133, 1818, 4318, 2076, 131

LTC: https://tests.stockfishchess.org/tests/view/62041e68d71106ed12a40e85
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 14944 W: 4138 L: 3907 D: 6899
Ptnml(0-2): 21, 1499, 4202, 1728, 22

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

Bench: 4919707

2 years agoBig search tuning
Michael Chaly [Wed, 9 Feb 2022 14:39:21 +0000 (17:39 +0300)]
Big search tuning

Most credits for this patch should go to @candirufish.
Based on his big search tuning (1M games at 20+0.1s)

https://tests.stockfishchess.org/tests/view/61fc7a6ed508ec6a1c9f4b7d

with some hand polishing on top of it, which includes :

a) correcting trend sigmoid - for some reason original tuning resulted in it being negative. This heuristic was proven to be worth some elo for years so reversing it sign is probably some random artefact;
b) remove changes to continuation history based pruning - this heuristic historically was really good at providing green STCs and then failing at LTC miserably if we tried to make it more strict, original tuning was done at short time control and thus it became more strict - which doesn't scale to longer time controls;
c) remove changes to improvement - not really indended :).

passed STC
https://tests.stockfishchess.org/tests/view/6203526e88ae2c84271c2ee2
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 16840 W: 4604 L: 4363 D: 7873
Ptnml(0-2): 82, 1780, 4449, 2033, 76

passed LTC
https://tests.stockfishchess.org/tests/view/620376e888ae2c84271c35d4
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 17232 W: 4771 L: 4542 D: 7919
Ptnml(0-2): 14, 1655, 5048, 1886, 13

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

bench 5030992

2 years agoDo less depth reduction in null move pruning for complex positions
Michael Chaly [Mon, 7 Feb 2022 10:32:21 +0000 (13:32 +0300)]
Do less depth reduction in null move pruning for complex positions

This patch makes us reduce less depth in null move pruning if complexity is high enough.
Thus, null move pruning now depends in two distinct ways on complexity,
while being the only search heuristic that exploits complexity so far.

passed STC
https://tests.stockfishchess.org/tests/view/61fde60fd508ec6a1c9f7754
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 170000 W: 45555 L: 45027 D: 79418
Ptnml(0-2): 760, 19352, 44359, 19658, 871

passed LTC
https://tests.stockfishchess.org/tests/view/61fe91febf46cb834cbd5c90
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 145272 W: 39182 L: 38651 D: 67439
Ptnml(0-2): 127, 14864, 42157, 15327, 161

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

bench 4461945

2 years agoReintroduce razoring
Michael Chaly [Sat, 5 Feb 2022 01:03:02 +0000 (04:03 +0300)]
Reintroduce razoring

Razoring was simplified away some years ago, this patch reintroduces it in a slightly different form.
Now for low depths if eval is far below alpha we check if qsearch can push it above alpha - and if it can't we return a fail low.

passed STC
https://tests.stockfishchess.org/tests/view/61fbf968d508ec6a1c9f3274
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 226120 W: 61106 L: 60472 D: 104542
Ptnml(0-2): 1118, 25592, 59080, 26078, 1192

passed LTC
https://tests.stockfishchess.org/tests/view/61fcc569d508ec6a1c9f5617
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 113128 W: 30851 L: 30397 D: 51880
Ptnml(0-2): 114, 11483, 32926, 11917, 124

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

bench 4684080

2 years agoIntroduce movecount pruning for quiet check evasions in qsearch
Michael Chaly [Fri, 4 Feb 2022 19:42:41 +0000 (22:42 +0300)]
Introduce movecount pruning for quiet check evasions in qsearch

Idea of this patch is that we usually don't consider quiet check evasions as "good" ones and prefer capture based ones instead. So it makes sense to think that if in qsearch 2 quiet check evasions failed to produce anything good 3rd and further ones wouldn't be good either.

passed STC
https://tests.stockfishchess.org/tests/view/61fc1b1ed508ec6a1c9f397c
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 58800 W: 15947 L: 15626 D: 27227
Ptnml(0-2): 273, 6568, 15462, 6759, 338

passed LTC
https://tests.stockfishchess.org/tests/view/61fcc56dd508ec6a1c9f5619
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 89544 W: 24208 L: 23810 D: 41526
Ptnml(0-2): 81, 9038, 26134, 9440, 79

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

bench 4830082

2 years agoDrop sse from target "x86-32"
ppigazzini [Mon, 31 Jan 2022 13:37:45 +0000 (14:37 +0100)]
Drop sse from target "x86-32"

have maximal compatibility on legacy target arch, now supporting AMD Athlon

The old behavior can anyway be selected by the user if needed, for example

make -j profile-build ARCH=x86-32 sse=yes

fixes #3904
closes https://github.com/official-stockfish/Stockfish/pull/3918

No functional change

2 years agoCleanup and update CPU contributors
Michael Chaly [Mon, 31 Jan 2022 04:25:10 +0000 (07:25 +0300)]
Cleanup and update CPU contributors

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

No functional change

2 years agoDo stats updates after LMR for captures
Michael Chaly [Sat, 29 Jan 2022 03:39:40 +0000 (06:39 +0300)]
Do stats updates after LMR for captures

Since captures that are in LMR use continuation histories of corresponding quiet moves it makes sense to update this histories if this capture passes LMR by analogy to existing logic for quiet moves.

Passed STC
https://tests.stockfishchess.org/tests/view/61f367eef7fba9f1a4f1318b
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 208464 W: 56006 L: 55407 D: 97051
Ptnml(0-2): 964, 23588, 54655, 23935, 1090

Passed LTC
https://tests.stockfishchess.org/tests/view/61f41e34f7fba9f1a4f15241
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 69144 W: 18793 L: 18441 D: 31910
Ptnml(0-2): 65, 6982, 20142, 7302, 81

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

bench 4637392

2 years agoScale child node futility pruning with previous move history.
Michael Chaly [Mon, 24 Jan 2022 23:22:03 +0000 (02:22 +0300)]
Scale child node futility pruning with previous move history.

Idea is to do more futility pruning if previous move has bad histories and less if it has good histories.

passed STC
https://tests.stockfishchess.org/tests/view/61e3757fbabab931824e0db7
LLR: 2.96 (-2.94,2.94) <0.00,2.50>
Total: 156816 W: 42282 L: 41777 D: 72757
Ptnml(0-2): 737, 17775, 40913, 18212, 771

passed LTC
https://tests.stockfishchess.org/tests/view/61e43496928632f7813a5535
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 349968 W: 94612 L: 93604 D: 161752
Ptnml(0-2): 300, 35934, 101550, 36858, 342

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

bench 4720954

2 years agoFix Makefile for Android NDK cross-compile
pschneider1968 [Fri, 21 Jan 2022 13:11:53 +0000 (14:11 +0100)]
Fix Makefile for Android NDK cross-compile

For cross-compiling to Android on windows, the Makefile needs some tweaks.

Tested with Android NDK 23.1.7779620 and 21.4.7075529, using
Windows 10 with clean MSYS2 environment (i.e. no MINGW/GCC/Clang
toolchain in PATH) and Fedora 35, with build target:
build ARCH=armv8 COMP=ndk

The resulting binary runs fine inside Droidfish on my Samsung
Galaxy Note20 Ultra and Samsung Galaxy Tab S7+

Other builds tested to exclude regressions: MINGW64/Clang64 build
on Windows; MINGW64 cross build, native Clang and GCC builds on Fedora.

wiki docs https://github.com/glinscott/fishtest/wiki/Cross-compiling-Stockfish-for-Android-on-Windows-and-Linux

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

No functional change

2 years agoSimplify limiting extensions.
J. Oster [Sat, 15 Jan 2022 17:18:52 +0000 (18:18 +0100)]
Simplify limiting extensions.

Replace the current method for limiting extensions to avoid search getting stuck
with a much simpler method.

the test position in https://github.com/official-stockfish/Stockfish/commit/73018a03375b4b72ee482eb5a4a2152d7e4f0aac
can still be searched without stuck search.

fixes #3815 where the search now makes progress with rootDepth

shows robust behavior in a d10 search for 1M positions.

passed STC
https://tests.stockfishchess.org/tests/view/61e303e3babab931824dfb18
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 57568 W: 15449 L: 15327 D: 26792
Ptnml(0-2): 243, 6211, 15779, 6283, 268

passed LTC
https://tests.stockfishchess.org/tests/view/61e3586cbabab931824e091c
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 128200 W: 34632 L: 34613 D: 58955
Ptnml(0-2): 124, 12559, 38710, 12588, 119

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

Bench: 4550528

2 years agoRevert -flto=auto on mingw
Joost VandeVondele [Thu, 20 Jan 2022 16:49:27 +0000 (17:49 +0100)]
Revert -flto=auto on mingw

causes issues on some installations (glinscott/fishtest#1255).

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

No functional change

2 years agoImprove Makefile for Windows native builds
ppigazzini [Mon, 17 Jan 2022 13:03:16 +0000 (14:03 +0100)]
Improve Makefile for Windows native builds

A Windows Native Build (WNB) can be done:
 - on Windows, using a recent mingw-w64 g++/clang compiler
   distributed by msys2, cygwin and others
 - on Linux, using mingw-w64 g++ to cross compile

Improvements:
 - check for a WNB in a proper way and set a variable to simplify the code
 - set the proper EXE for a WNB
 - use the proper name for the mingw-w64 clang compiler
 - use the static linking for a WNB
 - use wine to make a PGO cross compile on Linux (also with Intel SDE)
 - enable the LTO build for mingw-w64 g++ compiler
 - set `lto=auto` to use the make's job server, if available, or otherwise
   to fall back to autodetection of the number of CPU threads
 - clean up all the temporary LTO files saved in the local directory

Tested on:
 - msys2 MINGW64 (g++), UCRT64 (g++), MINGW32 (g++), CLANG64 (clang)
   environments
 - cygwin mingw-w64 g++
 - Ubuntu 18.04 & 21.10 mingw-w64 PGO cross compile (also with Intel SDE)

closes #3891

No functional change

2 years agoAdd msys2 Clang x86_64 to GitHub Action matrix
ppigazzini [Wed, 19 Jan 2022 15:56:38 +0000 (16:56 +0100)]
Add msys2 Clang x86_64 to GitHub Action matrix

Also use Windows Server 2022 virtual environment for msys2 builds.

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

No functional change

2 years agoUse average complexity for time management
Rui Coelho [Mon, 17 Jan 2022 16:51:20 +0000 (16:51 +0000)]
Use average complexity for time management

This patch is a variant of the idea by locutus2 (https://tests.stockfishchess.org/tests/view/61e1f24cb1f9959fe5d88168) to adjust the total time depending on the average complexity of the position.

Passed STC
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 39664 W: 10765 L: 10487 D: 18412
Ptnml(0-2): 162, 4213, 10837, 4425, 195
https://tests.stockfishchess.org/tests/view/61e2df8b65a644da8c9ea708

Passed LTC
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 127656 W: 34505 L: 34028 D: 59123
Ptnml(0-2): 116, 12435, 38261, 12888, 128
https://tests.stockfishchess.org/tests/view/61e31db5babab931824dff5e

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

Bench: 4464962

2 years agoImprove logic on mingw
proukornew [Thu, 16 Dec 2021 22:30:23 +0000 (01:30 +0300)]
Improve logic on mingw

There is no need to point g++, if we explicitly choose mingw.

Now for cygwin:

make COMP=mingw ARCH=x86-64-modern build

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

No functional change

2 years agoUse complexity in search
Rui Coelho [Thu, 13 Jan 2022 18:30:53 +0000 (18:30 +0000)]
Use complexity in search

This patch uses the complexity measure (from #3875) as a heuristic for null move pruning.
Hopefully, there may be room to use it in other pruning techniques.
I would like to thank vondele and locutus2 for the feedback and suggestions during testing.

Passed STC
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 35000 W: 9624 L: 9347 D: 16029
Ptnml(0-2): 156, 3894, 9137, 4143, 170
https://tests.stockfishchess.org/tests/view/61dda784c65bf87d6c45ab80

Passed LTC
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 230776 W: 64227 L: 63454 D: 103095
Ptnml(0-2): 1082, 23100, 66380, 23615, 1211
https://tests.stockfishchess.org/tests/view/61ddd0cf3ddbc32543e72c2b

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

Bench: 4464962

2 years agoFix Makefile for compilation with clang on Windows
pschneider1968 [Mon, 27 Dec 2021 20:16:04 +0000 (21:16 +0100)]
Fix Makefile for compilation with clang on Windows

use static compilation and
added exclusion of -latomic for Clang/MSYS2 as per ppigazzini's suggestion

fixes #3872

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

No functional change

2 years agoAdjust pruning constants
Michael Chaly [Mon, 10 Jan 2022 18:29:25 +0000 (21:29 +0300)]
Adjust pruning constants

This patch is a modification of original tuning done by vondele that failed yellow.
Value differences are divided by 2.

Passed STC
https://tests.stockfishchess.org/tests/view/61d918239fea7913d9c64cdf
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 98968 W: 26248 L: 25858 D: 46862
Ptnml(0-2): 392, 11085, 26156, 11443, 408

Passed LTC
https://tests.stockfishchess.org/tests/view/61d99e3c9fea7913d9c663e4
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 215232 W: 58191 L: 57492 D: 99549
Ptnml(0-2): 271, 22124, 62138, 22801, 282

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

bench 4572746

2 years agoTune FRC trapped Bishop patch
Joost VandeVondele [Fri, 7 Jan 2022 21:57:09 +0000 (22:57 +0100)]
Tune FRC trapped Bishop patch

now that fishtest can deal with FRC, retune this correction.

Add an additional fen to bench with cornered B and N.

passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 49672 W: 7358 L: 7082 D: 35232
Ptnml(0-2): 241, 4329, 15458, 4529, 279
https://tests.stockfishchess.org/tests/view/61d8b7bf9fea7913d9c63cb7

passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 86688 W: 8308 L: 8007 D: 70373
Ptnml(0-2): 92, 4943, 32989, 5212, 108
https://tests.stockfishchess.org/tests/view/61d92dcb9fea7913d9c650ad

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

Bench: 4326560

2 years agoTune a few parameters related to evaluation
Joost VandeVondele [Thu, 6 Jan 2022 06:44:41 +0000 (07:44 +0100)]
Tune a few parameters related to evaluation

based on a SPSA tune (using Autoselect)
https://tests.stockfishchess.org/tests/view/61d5aa63a314fed318a57046

passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.50>
Total: 61960 W: 16640 L: 16316 D: 29004
Ptnml(0-2): 278, 6934, 16204, 7314, 250
https://tests.stockfishchess.org/tests/view/61d7fe4af5fd40f357469a8d

passed LTC:
LLR: 2.97 (-2.94,2.94) <0.50,3.00>
Total: 79408 W: 21994 L: 21618 D: 35796
Ptnml(0-2): 106, 7887, 23331, 8285, 95
https://tests.stockfishchess.org/tests/view/61d836b7f5fd40f35746a3d5

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

Bench: 4266621

2 years agoUpdate AUTHORS and CPU contributors files
Stéphane Nicolet [Fri, 7 Jan 2022 06:55:50 +0000 (07:55 +0100)]
Update AUTHORS and CPU contributors files

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

No functional change

2 years agoUpdate copyright years
Brad Knox [Tue, 4 Jan 2022 02:33:26 +0000 (20:33 -0600)]
Update copyright years

Happy New Year!

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

No functional change

2 years agoSimplify away rangeReduction
lonfom169 [Sat, 1 Jan 2022 17:09:08 +0000 (14:09 -0300)]
Simplify away rangeReduction

Remove rangeReduction, introduced in [#3717](https://github.com/official-stockfish/Stockfish/pull/3717),
as it seemingly doesn't bring enough ELO anymore. It might be interesting to add
new forms of reduction or tune the reduction formula in the future.

STC:
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 45008 W: 12114 L: 11972 D: 20922
Ptnml(0-2): 174, 5031, 11952, 5173, 174
https://tests.stockfishchess.org/tests/view/61d08b7b069ca917749c9f6f

LTC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 30792 W: 8235 L: 8086 D: 14471
Ptnml(0-2): 24, 3162, 8882, 3297, 31
https://tests.stockfishchess.org/tests/view/61d0a6ad069ca917749ca420

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

Bench: 4048312

2 years agoSmooth out doDeeperSearch
lonfom169 [Fri, 31 Dec 2021 01:50:20 +0000 (22:50 -0300)]
Smooth out doDeeperSearch

Adjust threshold based on the difference between newDepth and LMR depth.
With more reduction, bigger fail-high is required in order to perform the deeper search.

STC:
LLR: 2.96 (-2.94,2.94) <0.00,2.50>
Total: 93576 W: 24133 L: 23758 D: 45685
Ptnml(0-2): 260, 10493, 24935, 10812, 288
https://tests.stockfishchess.org/tests/view/61cbb5cee68b2a714b6eaf09

LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 109280 W: 28198 L: 27754 D: 53328
Ptnml(0-2): 60, 11225, 31637, 11647, 71
https://tests.stockfishchess.org/tests/view/61cc03fee68b2a714b6ec091

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

Bench: 4464723

2 years agoTweak optimism with complexity
Stéphane Nicolet [Thu, 30 Dec 2021 10:23:40 +0000 (11:23 +0100)]
Tweak optimism with complexity

This patch increases the optimism bonus for "complex positions", where the
complexity is measured as the absolute value of the difference between material
and the sophisticated NNUE evaluation (idea by Joost VandeVondele).

Also rename some variables in evaluate() while there.

passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 88392 W: 23150 L: 22781 D: 42461
Ptnml(0-2): 318, 9961, 23257, 10354, 306
https://tests.stockfishchess.org/tests/view/61cbbedee68b2a714b6eb110

passed LTC:
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 37848 W: 10043 L: 9766 D: 18039
Ptnml(0-2): 26, 3815, 10961, 4100, 22
https://tests.stockfishchess.org/tests/view/61cc0cc3e68b2a714b6ec28c

Closes https://github.com/official-stockfish/Stockfish/pull/3875
Follow-up from https://github.com/official-stockfish/Stockfish/commit/a5a89b27c8e3225fb453d603bc4515d32bb351c3

Bench: 4125221

2 years agoDon't direct prune a move if it's a retake
bmc4 [Sat, 25 Dec 2021 11:54:16 +0000 (08:54 -0300)]
Don't direct prune a move if it's a retake

STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 36304 W: 9499 L: 9226 D: 17579
Ptnml(0-2): 96, 4102, 9508, 4325, 121
https://tests.stockfishchess.org/tests/view/61c7069ae68b2a714b6dca27

LTC:
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 93824 W: 24478 L: 24068 D: 45278
Ptnml(0-2): 70, 9644, 27082, 10038, 78
https://tests.stockfishchess.org/tests/view/61c725fee68b2a714b6dcfa2

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

Bench: 4106806

2 years agoUpdate default net to nn-ac07bd334b62.nnue
Joost VandeVondele [Fri, 17 Dec 2021 18:34:30 +0000 (19:34 +0100)]
Update default net to nn-ac07bd334b62.nnue

Trained with essentially the same data as provided and used by Farseer (mbabigian)
for the previous master net.

T60T70wIsRightFarseerT60T74T75T76.binpack (99GB):
['T60T70wIsRightFarseer.binpack', 'farseerT74.binpack', 'farseerT75.binpack', 'farseerT76.binpack']
using the trainer branch tweakLR1PR (https://github.com/glinscott/nnue-pytorch/pull/158) and
`--gpus 1 --threads 4 --num-workers 4 --batch-size 16384 --progress_bar_refresh_rate 300 --smart-fen-skipping --random-fen-skipping 12 --features=HalfKAv2_hm^   --lambda=1.00` options

passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 108280 W: 28042 L: 27636 D: 52602
Ptnml(0-2): 328, 12382, 28401, 12614, 415
https://tests.stockfishchess.org/tests/view/61bcd8c257a0d0f327c34fbd

passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 259296 W: 66974 L: 66175 D: 126147
Ptnml(0-2): 146, 27096, 74452, 27721, 233
https://tests.stockfishchess.org/tests/view/61bda70957a0d0f327c37817

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

Bench: 4633875

2 years agoFall back to NNUE if classical evaluation is much lower than threshold
Michael Chaly [Wed, 22 Dec 2021 04:54:10 +0000 (07:54 +0300)]
Fall back to NNUE if classical evaluation is much lower than threshold

The idea is that if classical eval returns a value much lower than the threshold of
its usage it most likely means that position isn't that simple
so we need the more precise NNUE evaluation.

passed STC:
https://tests.stockfishchess.org/tests/view/61bf3e7557a0d0f327c3c47a
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 108072 W: 28007 L: 27604 D: 52461
Ptnml(0-2): 352, 12147, 28650, 12520, 367

passed LTC:
https://tests.stockfishchess.org/tests/view/61c0581657a0d0f327c3fa0c
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 155096 W: 40392 L: 39841 D: 74863
Ptnml(0-2): 88, 15983, 44843, 16558, 76

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

bench 4310422

2 years agoUpdate Elo estimates for terms in search
bmc4 [Mon, 20 Dec 2021 19:20:08 +0000 (16:20 -0300)]
Update Elo estimates for terms in search

This updates estimates from 2yr ago #2401, and adds missing terms.
All tests run at 10+0.1 (STC), 20000 games, error bars +- 1.8 Elo, book 8moves_v3.png.

A table of Elo values with the links to the corresponding tests can be found at the PR

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

Non-functional Change

2 years agoRemove Capture history pruning
bmc4 [Mon, 20 Dec 2021 11:08:09 +0000 (08:08 -0300)]
Remove Capture history pruning

Fixed number of games. (book: 8moves_v3.png):
ELO: -0.69 +-1.8 (95%) LOS: 22.1%
Total: 20000 W: 1592 L: 1632 D: 16776
Ptnml(0-2): 44, 1194, 7566, 1150, 46
https://tests.stockfishchess.org/tests/view/61bb8eb657a0d0f327c30ce8

STC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 139976 W: 36039 L: 36036 D: 67901
Ptnml(0-2): 435, 16138, 36885, 16049, 481
https://tests.stockfishchess.org/tests/view/61be731857a0d0f327c39ea2

LTC:
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 70656 W: 18284 L: 18189 D: 34183
Ptnml(0-2): 34, 7317, 20529, 7416, 32
https://tests.stockfishchess.org/tests/view/61bf39b657a0d0f327c3c37b

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

bench: 4281737

2 years agoRemove Capture Extension
bmc4 [Sat, 18 Dec 2021 00:14:34 +0000 (21:14 -0300)]
Remove Capture Extension

This revert the patch #3692, probably can be simplified after the introduction of #3838.

Fixed-game test:
ELO: -1.41 +-1.8 (95%) LOS: 5.9%
Total: 20000 W: 1552 L: 1633 D: 16815
Ptnml(0-2): 38, 1242, 7517, 1169, 34
https://tests.stockfishchess.org/tests/view/61bc1a2057a0d0f327c32a3c

STC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 44528 W: 11619 L: 11478 D: 21431
Ptnml(0-2): 146, 5020, 11771, 5201, 126
https://tests.stockfishchess.org/tests/view/61bc638c57a0d0f327c338fe

LTC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 34136 W: 8847 L: 8704 D: 16585
Ptnml(0-2): 23, 3475, 9925, 3626, 19
https://tests.stockfishchess.org/tests/view/61bcb24257a0d0f327c34813

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

Bench: 4054695

2 years agoSimplification in evaluate_nnue.cpp
Stéphane Nicolet [Sun, 19 Dec 2021 14:15:30 +0000 (15:15 +0100)]
Simplification in evaluate_nnue.cpp

Removes the test on non-pawn-material before applying the positional/materialistic bonus.

Passed STC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 46904 W: 12197 L: 12059 D: 22648
Ptnml(0-2): 170, 5243, 12479, 5399, 161
https://tests.stockfishchess.org/tests/view/61be57cf57a0d0f327c3999d

Passed LTC:
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 18760 W: 4958 L: 4790 D: 9012
Ptnml(0-2): 14, 1942, 5301, 2108, 15
https://tests.stockfishchess.org/tests/view/61bed1fb57a0d0f327c3afa9

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

Bench: 4826206

2 years agoFixes build failure on Apple M1 Silicon
George Sobala [Mon, 13 Dec 2021 16:05:35 +0000 (16:05 +0000)]
Fixes build failure on Apple M1 Silicon

This pull request selectively avoids `-mdynamic-no-pic` for gcc on Apple Silicon
(there was no problem with the default clang compiler).

fixes https://github.com/official-stockfish/Stockfish/issues/3847
closes https://github.com/official-stockfish/Stockfish/pull/3850

No functional change

2 years agoReintroduce futility pruning for captures
Michael Chaly [Sat, 18 Dec 2021 23:30:45 +0000 (02:30 +0300)]
Reintroduce futility pruning for captures

This is a reintroduction of an idea that was simplified away approximately 1 year ago.
There are some tweaks to it :
a) exclude promotions;
b) exclude Pv Nodes from it - Pv Nodes logic for captures is really different from non Pv nodes so it makes a lot of sense;
c) use a big grain of capture history - idea is taken from my recent patches in futility pruning.

passed STC
https://tests.stockfishchess.org/tests/view/61bd90f857a0d0f327c373b7
LLR: 2.96 (-2.94,2.94) <0.00,2.50>
Total: 86640 W: 22474 L: 22110 D: 42056
Ptnml(0-2): 268, 9732, 22963, 10082, 275

passed LTC
https://tests.stockfishchess.org/tests/view/61be094457a0d0f327c38aa3
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 23240 W: 6079 L: 5838 D: 11323
Ptnml(0-2): 14, 2261, 6824, 2512, 9

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

bench 4493723

2 years agoAdjust reductions based on current node delta and root delta
Michael Chaly [Sat, 18 Dec 2021 08:51:19 +0000 (11:51 +0300)]
Adjust reductions based on current node delta and root delta

This patch is a follow up of previous 2 patches that introduced more reductions for PV nodes with low delta and more pruning for nodes with low delta. Instead of writing separate heuristics now it adjust reductions based on delta / rootDelta - it allows to remove 3 separate adjustements of pruning/LMR in different places and also makes reduction dependence on delta and rootDelta smoother. Also now it works for all pruning heuristics and not just 2.

Passed STC
https://tests.stockfishchess.org/tests/view/61ba9b6c57a0d0f327c2d48b
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 79192 W: 20513 L: 20163 D: 38516
Ptnml(0-2): 238, 8900, 21024, 9142, 292

passed LTC
https://tests.stockfishchess.org/tests/view/61baf77557a0d0f327c2eb8e
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 158400 W: 41134 L: 40572 D: 76694
Ptnml(0-2): 101, 16372, 45745, 16828, 154

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

bench 4651538

2 years agoFix for profile-build failure using gcc on MacOS
George Sobala [Mon, 13 Dec 2021 15:29:31 +0000 (15:29 +0000)]
Fix for profile-build failure using gcc on MacOS

Fixes https://github.com/official-stockfish/Stockfish/issues/3846 ,
where the profiling SF binary generated by GCC on MacOS would launch
but failed to quit. Tested with gcc-8, gcc9, gcc10, gcc-11.

The problem can be fixed by adding -fvisibility=hidden to the compiler
flags, see for example the following piece of Apple documentation:
https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

For instance this now works:
   make -j8 profile-build ARCH=x86-64-avx2 COMP=gcc COMPCXX=g++-11

No functional change

2 years agoRemove lowPly history
pb00067 [Wed, 15 Dec 2021 07:49:44 +0000 (08:49 +0100)]
Remove lowPly history

Seems that after pull request #3731 (Capping stat bonus at 2000) this
heuristic is no longer useful.

STC:
https://tests.stockfishchess.org/tests/view/61b8d0e2dffbe89a35815444
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 30672 W: 7974 L: 7812 D: 14886
Ptnml(0-2): 106, 3436, 8072, 3634, 88

LTC:
https://tests.stockfishchess.org/tests/view/61b8e90cdffbe89a35815a67
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 42448 W: 10884 L: 10751 D: 20813
Ptnml(0-2): 23, 4394, 12267, 4507, 33

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

bench: 4474950

2 years agoSimplify away singularQuietLMR
bmc4 [Tue, 14 Dec 2021 15:00:45 +0000 (12:00 -0300)]
Simplify away singularQuietLMR

While at it, we also update the Elo estimate of reduction at non-PV nodes
(source: https://tests.stockfishchess.org/tests/view/61acf97156fcf33bce7d6303 )

STC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 243632 W: 62874 L: 63022 D: 117736
Ptnml(0-2): 810, 28024, 64249, 27970, 763
https://tests.stockfishchess.org/tests/view/61b8b1b7dffbe89a35814c0d

LTC:
LLR: 2.93 (-2.94,2.94) <-2.25,0.25>
Total: 91392 W: 23520 L: 23453 D: 44419
Ptnml(0-2): 51, 9568, 26387, 9643, 47
https://tests.stockfishchess.org/tests/view/61b97316dffbe89a35817da7

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

bench: 4217785

2 years agoUpdate default net to nn-4401e826ebcc.nnue
farseer [Thu, 16 Dec 2021 00:28:16 +0000 (16:28 -0800)]
Update default net to nn-4401e826ebcc.nnue

Using data T60 12/1/20 to 11/2/2021, T74 4/22/21 to 7/27/21, T75 6/3/21 to 10/16/21, T76
(half of the randomly interleaved dataset due to a mistake merging) 11/10/21 to 11/21/21,
wrongIsRight_nodes5000pv2.binpack, and WrongIsRight-Reloaded.binpack combined and shuffled
position by position.

Trained with LR=4.375e-4 and WDL filtering enabled:

python train.py --smart-fen-skipping --random-fen-skipping 0 --features=HalfKAv2_hm^
--lambda=1.0 --max_epochs=800 --seed 910688689 --batch-size 16384
--progress_bar_refresh_rate 30 --threads 4 --num-workers 4 --gpus 1
--resume-from-model C:\msys64\home\Mike\nnue-pytorch\9b3d.pt
E:\trainingdata\T60-T74-T75-T76-WiR-WiRR-PbyP.binpack
E:\trainingdata\T60-T74-T75-T76-WiR-WiRR-PbyP.binpack

Passed STC
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 41848 W: 10962 L: 10676 D: 20210 Elo +2.16
Ptnml(0-2): 142, 4699, 11016, 4865, 202
https://tests.stockfishchess.org/tests/view/61ba886857a0d0f327c2cfd6

Passed LTC
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 27776 W: 7208 L: 6953 D: 13615 Elo + 3.00
Ptnml(0-2): 14, 2808, 8007, 3027, 32
https://tests.stockfishchess.org/tests/view/61baae4d57a0d0f327c2d96f

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

Bench: 4667591

2 years agoRemove NNUE scaling term
Joost VandeVondele [Tue, 7 Dec 2021 22:03:35 +0000 (23:03 +0100)]
Remove NNUE scaling term

remove pawns scaling, probably correlated with piece scaling, and might be less useful with the recent improved nets. Might allow for another tune of the scaling params.

passed STC
https://tests.stockfishchess.org/tests/view/61afdb2e56fcf33bce7df31a
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 280864 W: 72198 L: 72399 D: 136267
Ptnml(0-2): 854, 32356, 74346, 31889, 987

passed LTC
https://tests.stockfishchess.org/tests/view/61b233a606b4c2dcb1b16140
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 400136 W: 102669 L: 103012 D: 194455
Ptnml(0-2): 212, 42005, 116047, 41522, 282

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

Bench: 4735679

2 years agoUpdate default net to nn-d93927199b3d.nnue
Joost VandeVondele [Sun, 12 Dec 2021 16:09:21 +0000 (17:09 +0100)]
Update default net to nn-d93927199b3d.nnue

Using the same dataset as before but slightly reduced initial LR as in
https://github.com/vondele/nnue-pytorch/tree/tweakLR1

passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 51368 W: 13492 L: 13191 D: 24685
Ptnml(0-2): 168, 5767, 13526, 6042, 181
https://tests.stockfishchess.org/tests/view/61b61f43dffbe89a3580b529

passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 45128 W: 11763 L: 11469 D: 21896
Ptnml(0-2): 24, 4583, 13063, 4863, 31
https://tests.stockfishchess.org/tests/view/61b6612edffbe89a3580c447

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

Bench: 5121336

2 years agoSimplify falling eval time factor.
Stefan Geschwentner [Fri, 10 Dec 2021 17:42:05 +0000 (18:42 +0100)]
Simplify falling eval time factor.

Remove the difference to previous best score in falling eval calculation. As compensation double the effect of the difference to previous best average score.

STC:
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 86944 W: 22363 L: 22285 D: 42296
Ptnml(0-2): 273, 9227, 24396, 9301, 275
https://tests.stockfishchess.org/tests/view/61b111ce06b4c2dcb1b11546

LTC:
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 134944 W: 34606 L: 34596 D: 65742
Ptnml(0-2): 66, 12941, 41456, 12935, 74
https://tests.stockfishchess.org/tests/view/61b19ca206b4c2dcb1b13a8b

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

Bench: 4729473

2 years agoUpdate Top CPU Contributors
Joost VandeVondele [Sat, 11 Dec 2021 14:23:55 +0000 (15:23 +0100)]
Update Top CPU Contributors

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

No functional change

2 years agoAdjust singular extension depth restriction
Michael Chaly [Thu, 9 Dec 2021 16:33:06 +0000 (19:33 +0300)]
Adjust singular extension depth restriction

This patch is a modification of original idea by lonfom169 which had a good yellow run
- do singular extension search with depth threshold 6 unless this is a PvNode with is a part of a PV line -
for them set threshold to 8 instead.

Passed STC
https://tests.stockfishchess.org/tests/view/61b1080406b4c2dcb1b1128c
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 84352 W: 21917 L: 21555 D: 40880
Ptnml(0-2): 288, 9524, 22185, 9896, 283

Passed LTC
https://tests.stockfishchess.org/tests/view/61b1860a06b4c2dcb1b134a1
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 63520 W: 16575 L: 16237 D: 30708
Ptnml(0-2): 27, 6519, 18350, 6817, 47

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

bench 4729473

2 years agoImprove transposition table remplacement strategy
Stefan Geschwentner [Wed, 8 Dec 2021 11:23:39 +0000 (12:23 +0100)]
Improve transposition table remplacement strategy

Increase chance that PV node replaces old entry in transposition table.

STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.50>
Total: 46744 W: 12108 L: 11816 D: 22820
Ptnml(0-2): 156, 5221, 12344, 5477, 174
https://tests.stockfishchess.org/tests/view/61ae068356fcf33bce7d99d0

LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 88464 W: 22912 L: 22513 D: 43039
Ptnml(0-2): 84, 9133, 25393, 9544, 78
https://tests.stockfishchess.org/tests/view/61ae973656fcf33bce7db3e1

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

Bench: 5292488

2 years agoIntroduce post-lmr extensions
Michael Chaly [Tue, 7 Dec 2021 16:46:21 +0000 (19:46 +0300)]
Introduce post-lmr extensions

This idea is somewhat similar to extentions in LMR but has a different flavour.
If result of LMR was really good - thus exceeded alpha by some pretty
big given margin, we can extend move after LMR in full depth search with 0 window.
The idea is that this move is probably a fail high with somewhat of a big
probability so extending it makes a lot of sense

passed STC
https://tests.stockfishchess.org/tests/view/61ad45ea56fcf33bce7d74b7
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 59680 W: 15531 L: 15215 D: 28934
Ptnml(0-2): 193, 6711, 15734, 6991, 211

passed LTC
https://tests.stockfishchess.org/tests/view/61ad9ff356fcf33bce7d8646
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 59104 W: 15321 L: 14992 D: 28791
Ptnml(0-2): 53, 6023, 17065, 6364, 47

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

bench 4881329

2 years agoOptimize FT activation and affine transform for NEON.
Tomasz Sobczyk [Thu, 2 Dec 2021 11:29:11 +0000 (12:29 +0100)]
Optimize FT activation and affine transform for NEON.

This patch optimizes the NEON implementation in two ways.

    The activation layer after the feature transformer is rewritten to make it easier for the compiler to see through dependencies and unroll. This in itself is a minimal, but a positive improvement. Other architectures could benefit from this too in the future. This is not an algorithmic change.
    The affine transform for large matrices (first layer after FT) on NEON now utilizes the same optimized code path as >=SSSE3, which makes the memory accesses more sequential and makes better use of the available registers, which allows for code that has longer dependency chains.

Benchmarks from Redshift#161, profile-build with apple clang

george@Georges-MacBook-Air nets % ./stockfish-b82d93 bench 2>&1 | tail -4 (current master)
===========================
Total time (ms) : 2167
Nodes searched  : 4667742
Nodes/second    : 2154011
george@Georges-MacBook-Air nets % ./stockfish-7377b8 bench 2>&1 | tail -4 (this patch)
===========================
Total time (ms) : 1842
Nodes searched  : 4667742
Nodes/second    : 2534061

This is a solid 18% improvement overall, larger in a bench with NNUE-only, not mixed.

Improvement is also observed on armv7-neon (Raspberry Pi, and older phones), around 5% speedup.

No changes for architectures other than NEON.

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

No functional changes.

2 years agoUpdate default net to nn-63376713ba63.nnue.
Joost VandeVondele [Sat, 4 Dec 2021 22:18:46 +0000 (23:18 +0100)]
Update default net to nn-63376713ba63.nnue.

same data set as previous trained nets, tuned the wdl model slightly for training.
https://github.com/vondele/nnue-pytorch/tree/wdlTweak1

passed STC:
https://tests.stockfishchess.org/tests/view/61abe9e456fcf33bce7d2834
LLR: 2.93 (-2.94,2.94) <0.00,2.50>
Total: 31720 W: 8385 L: 8119 D: 15216
Ptnml(0-2): 117, 3534, 8273, 3838, 98

passed LTC:
https://tests.stockfishchess.org/tests/view/61ac293756fcf33bce7d36cf
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 136136 W: 35255 L: 34741 D: 66140
Ptnml(0-2): 114, 14217, 38894, 14727, 116

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

Bench: 4667742

2 years agoAssign extra bonus for previous move that caused a fail low more often
Michael Chaly [Mon, 6 Dec 2021 00:52:44 +0000 (03:52 +0300)]
Assign extra bonus for previous move that caused a fail low more often

This patch allows to assign extra bonus for previous move that caused a fail low not only for PvNodes and cutNodes but also fo some allNodes - namely if the best result we could've got from the search is still far below alpha.

passed STC
https://tests.stockfishchess.org/tests/view/61aa26a49e8855bba1a36d96
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 73808 W: 19183 L: 18842 D: 35783
Ptnml(0-2): 251, 8257, 19564, 8564, 268

passed LTC
https://tests.stockfishchess.org/tests/view/61aa7dc29e8855bba1a3814f
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 142416 W: 36717 L: 36192 D: 69507
Ptnml(0-2): 106, 14799, 40862, 15346, 95

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

bench 4724181

2 years agoTweak history initialization
Stefan Geschwentner [Sun, 5 Dec 2021 15:29:51 +0000 (16:29 +0100)]
Tweak history initialization

Initialize continuation history with a slighlty negative value -71 instead of zero.

The idea is, because the most history entries will be later negative anyway, to shift
the starting values a little bit in the "correct" direction. Of course the effect of
initialization dimishes with greater depth so I had the apprehension that the LTC test
would be difficult to pass, but it passed.

STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 34520 W: 9076 L: 8803 D: 16641
Ptnml(0-2): 136, 3837, 9047, 4098, 142
https://tests.stockfishchess.org/tests/view/61aa52e39e8855bba1a3776b

LTC:
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 75568 W: 19620 L: 19254 D: 36694
Ptnml(0-2): 44, 7773, 21796, 8115, 56
https://tests.stockfishchess.org/tests/view/61aa87d39e8855bba1a383a5

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

Bench: 4674029

2 years agoTweak time management
Stefan Geschwentner [Sun, 5 Dec 2021 15:18:33 +0000 (16:18 +0100)]
Tweak time management

Use for adjustment of the falling eval time factor now also the difference
between previous best average score and current best score.

STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 109216 W: 28296 L: 27900 D: 53020
Ptnml(0-2): 312, 11759, 30148, 11999, 390
https://tests.stockfishchess.org/tests/view/61aafa8d1b31b85bcfa29d9c

LTC:
LLR: 2.93 (-2.94,2.94) <0.50,3.00>
Total: 54096 W: 14091 L: 13787 D: 26218
Ptnml(0-2): 29, 5124, 16447, 5410, 38
https://tests.stockfishchess.org/tests/view/61abbbbd56fcf33bce7d1d64

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

Bench: 4829419

2 years agoSimplifies bestMoveChanges from LMR
bmc4 [Sat, 4 Dec 2021 12:09:09 +0000 (09:09 -0300)]
Simplifies bestMoveChanges from LMR

As bestMoveChanges is only reset on mainThread and it could change how other
threads search, a multi-threads test was made.

STC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 146776 W: 37934 L: 37941 D: 70901
Ptnml(0-2): 477, 15644, 41173, 15597, 497
https://tests.stockfishchess.org/tests/view/61a8f9f34ed77d629d4ea2d6

LTC:
LLR: 3.11 (-2.94,2.94) <-2.25,0.25>
Total: 114040 W: 29314 L: 29269 D: 55457
Ptnml(0-2): 50, 10584, 35722, 10599, 65
https://tests.stockfishchess.org/tests/view/61a9d4bf9e8855bba1a35c4f

(SMP, 8 threads) STC:
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 23888 W: 6308 L: 6143 D: 11437
Ptnml(0-2): 36, 2557, 6600, 2708, 43
https://tests.stockfishchess.org/tests/view/61ac27a756fcf33bce7d3677

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

bench: 4829419

2 years agoUpdate default net to nn-cdf1785602d6.nnue
Joost VandeVondele [Thu, 2 Dec 2021 05:58:40 +0000 (06:58 +0100)]
Update default net to nn-cdf1785602d6.nnue

Same process as in https://github.com/official-stockfish/Stockfish/commit/e4a0c6c75950bf27b6dc32490a1102499643126b
with the training started from the current master net.

passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 38224 W: 10023 L: 9742 D: 18459
Ptnml(0-2): 133, 4328, 9940, 4547, 164
https://tests.stockfishchess.org/tests/view/61a8611e4ed77d629d4e836e

passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 115176 W: 29783 L: 29321 D: 56072
Ptnml(0-2): 68, 12039, 32936, 12453, 92
https://tests.stockfishchess.org/tests/view/61a8963e4ed77d629d4e8d9b

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

Bench: 4829419

2 years agoDo more aggressive pruning for some node types
Michael Chaly [Thu, 2 Dec 2021 20:41:23 +0000 (23:41 +0300)]
Do more aggressive pruning for some node types

This patch allows more aggressive futility/see based pruning for PV nodes with low delta and non-pv nodes.

Fixes some white space issues.

Passed STC
https://tests.stockfishchess.org/tests/view/61a5ed33d16c530b5dcc27cc
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 182088 W: 47121 L: 46584 D: 88383
Ptnml(0-2): 551, 20687, 48037, 21212, 557

Passed LTC
https://tests.stockfishchess.org/tests/view/61a74dfdbd5c4360bcded0ac
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 87136 W: 22494 L: 22103 D: 42539
Ptnml(0-2): 38, 8918, 25272, 9295, 45

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

bench 4332259

2 years agoAdd AVX-VNNI support for Alder Lake and later.
Gian-Carlo Pascutto [Wed, 1 Dec 2021 22:36:14 +0000 (23:36 +0100)]
Add AVX-VNNI support for Alder Lake and later.

In their infinite wisdom, Intel axed AVX512 from Alder Lake
chips (well, not entirely, but we kind of want to use the Gracemont
cores for chess!) but still added VNNI support.
Confusingly enough, this is not the same as VNNI256 support.

This adds a specific AVX-VNNI target that will use this AVX-VNNI
mode, by prefixing the VNNI instructions with the appropriate VEX
prefix, and avoiding AVX512 usage.

This is about 1% faster on P cores:

Result of  20 runs
==================
base (./clang-bmi2   ) =    3306337  +/- 7519
test (./clang-vnni   ) =    3344226  +/- 7388
diff                   =     +37889  +/- 4153

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

But a nice 3% faster on E cores:

Result of  20 runs
==================
base (./clang-bmi2   ) =    1938054  +/- 28257
test (./clang-vnni   ) =    1994606  +/- 31756
diff                   =     +56552  +/- 3735

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

This was measured on Clang 13. GCC 11.2 appears to generate
worse code for Alder Lake, though the speedup on the E cores
is similar.

It is possible to run the engine specifically on the P or E using binding,
for example in linux it is possible to use (for an 8 P + 8 E setup like i9-12900K):
taskset -c 0-15 ./stockfish
taskset -c 16-23 ./stockfish
where the first call binds to the P-cores and the second to the E-cores.

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

No functional change

2 years agoCorrectly reset bestMoveChanges
bmc4 [Mon, 29 Nov 2021 17:51:35 +0000 (14:51 -0300)]
Correctly reset bestMoveChanges

for searches not using time management (e.g. analysis, fixed node game play etc),
bestMoveChanges was not reset during search iterations. As LMR uses this quantity,
search was somewhat weaker.

Tested using fixed node playing games:
```
./c-chess-cli -each nodes=10000 option.Hash=16 -engine cmd=../Stockfish/src/fix -engine cmd=../Stockfish/src/master -concurrency 6 -openings file=../books/UHO_XXL_+0.90_+1.19.epd -games 10000
Score of Stockfish Fix vs Stockfish Master: 3187 - 3028 - 3785  [0.508] 10000

./c-chess-cli -each nodes=30000 option.Hash=16 -engine cmd=../Stockfish/src/fix -engine cmd=../Stockfish/src/master -concurrency 6 -openings file=../books/UHO_XXL_+0.90_+1.19.epd -games 10000
Score of Stockfish Fix vs Stockfish Master: 2946 - 2834 - 4220  [0.506] 10000
```

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

bench: 5061979

2 years agoSimplify reduction on rootNode when bestMoveChanges is high
bmc4 [Mon, 29 Nov 2021 12:30:07 +0000 (09:30 -0300)]
Simplify reduction on rootNode when bestMoveChanges is high

The reduction introduced in #3736 also consider on rootNode, so we don't have to reduce again.

STC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 28736 W: 7494 L: 7329 D: 13913
Ptnml(0-2): 95, 3247, 7503, 3444, 79
https://tests.stockfishchess.org/tests/view/61a3abe01b7fdf52228e74d8

LTC:
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 47816 W: 12434 L: 12308 D: 23074
Ptnml(0-2): 37, 4972, 13755, 5116, 28
https://tests.stockfishchess.org/tests/view/61a3c3e39f0c43dae1c71d71

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

bench: 6331638

2 years agoFix typos in comments, adjust readme
Michael Ortmann [Tue, 30 Nov 2021 20:01:34 +0000 (21:01 +0100)]
Fix typos in comments, adjust readme

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

also adjusts readme as requested in https://github.com/official-stockfish/Stockfish/pull/3816

No functional change

2 years agoSmall clean-up
hengyu [Fri, 26 Nov 2021 10:25:03 +0000 (18:25 +0800)]
Small clean-up

remove unneeded calculation.

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

No functional change.

2 years agoRemove depth dependence and use same limit (2000) as stat_bonus
pb00067 [Fri, 26 Nov 2021 07:03:15 +0000 (08:03 +0100)]
Remove depth dependence and use same limit (2000) as stat_bonus

STC:
https://tests.stockfishchess.org/tests/view/619df59dc0a4ea18ba95a424
LLR: 2.96 (-2.94,2.94) <-2.25,0.25>
Total: 83728 W: 21329 L: 21242 D: 41157
Ptnml(0-2): 297, 9669, 21847, 9752, 299

LTC:
https://tests.stockfishchess.org/tests/view/619e64d7c0a4ea18ba95a475
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 79888 W: 20238 L: 20155 D: 39495
Ptnml(0-2): 57, 8391, 22980, 8444, 73

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

bench: 6792010

2 years agoEnable compilation on older Windows systems
noobpwnftw [Tue, 30 Nov 2021 01:22:07 +0000 (09:22 +0800)]
Enable compilation on older Windows systems

Improve compatibility of the last NUMA patch when running under older versions of Windows,
for instance Windows Server 2003. Reported by user "g3g6" in the following comments:
https://github.com/official-stockfish/Stockfish/commit/7218ec4df9fef1146a451b71f0ed3bfd8123c9f9

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

No functional change

2 years agoUpdate default net to nn-4f56ecfca5b7.nnue
Joost VandeVondele [Sun, 28 Nov 2021 18:26:10 +0000 (19:26 +0100)]
Update default net to nn-4f56ecfca5b7.nnue

New net trained with nnue-pytorch, started from a master net on a data set of Leela
(T60.binpack+T74.binpck) Stockfish data (wrongIsRight_nodes5000pv2.binpack), and
Michael Babigian's conversion of T60 Leela data (including TB7 rescoring) (farseer.binpack)
available as a single interleaved binpack:

https://drive.google.com/file/d/1_sQoWBl31WAxNXma2v45004CIVltytP8/view?usp=sharing

The nnue-pytorch branch used is https://github.com/vondele/nnue-pytorch/tree/wdl

passed STC:
https://tests.stockfishchess.org/tests/view/61a3cc729f0c43dae1c71f1b
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 49152 W: 12842 L: 12544 D: 23766
Ptnml(0-2): 154, 5542, 12904, 5804, 172

passed LTC:
https://tests.stockfishchess.org/tests/view/61a43c6260afd064f2d724f1
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 25528 W: 6676 L: 6425 D: 12427
Ptnml(0-2): 9, 2593, 7315, 2832, 15

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

Bench: 6885242

2 years agoRefine futility pruning for parent nodes
Michael Chaly [Sun, 28 Nov 2021 12:19:18 +0000 (15:19 +0300)]
Refine futility pruning for parent nodes

This patch is a result of refining of tuning vondele did after
new net passed and some hand-made values adjustements - excluding
changes in other pruning heuristics and rounding value of history
divisor to the nearest power of 2.

With this patch futility pruning becomes more aggressive and
history influence on it is doubled again.

passed STC
https://tests.stockfishchess.org/tests/view/61a2c4c1a26505c2278c150d
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 33848 W: 8841 L: 8574 D: 16433
Ptnml(0-2): 100, 3745, 8988, 3970, 121

passed LTC
https://tests.stockfishchess.org/tests/view/61a327ffa26505c2278c26d9
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 22272 W: 5856 L: 5614 D: 10802
Ptnml(0-2): 12, 2230, 6412, 2468, 14

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

bench 6302543