Commit Graph
6944 Commits
Author SHA1 Message Date
Disservin 73b3b18595 Init threat offsets at compile time
Init threat offsets at compile time. Avoid another global init function call.

Passed STC Non-Regression:
https://tests.stockfishchess.org/tests/view/694971a83c8768ca4507275c
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 43296 W: 11284 L: 11077 D: 20935
Ptnml(0-2): 152, 4611, 11924, 4800, 161

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

No functional change
2025-12-23 21:42:45 +01:00
FauziAkramandDisservin 4d4c6ebd02 Simplify doDeeperSearch formula
Passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 211776 W: 54939 L: 54911 D: 101926
Ptnml(0-2): 714, 24971, 54484, 25011, 708
https://tests.stockfishchess.org/tests/view/6938971875b70713ef796b70

Passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 216774 W: 55346 L: 55326 D: 106102
Ptnml(0-2): 105, 23599, 60980, 23577, 126
https://tests.stockfishchess.org/tests/view/693fc91f46f342e1ec20f9f6

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

Bench: 3267755
2025-12-23 21:42:45 +01:00
Michael ChalyandDisservin 447f66acac Less penalty for quiet late moves that didn't beat the best move.
This moves since they are late in move ordering probably already have pretty bad stats anyway.
Passed STC:
https://tests.stockfishchess.org/tests/view/6943bcd546f342e1ec210e25
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 96704 W: 25206 L: 24798 D: 46700
Ptnml(0-2): 357, 11244, 24767, 11602, 382
Passed LTC:
https://tests.stockfishchess.org/tests/view/6946a8723c8768ca450722f0
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 89814 W: 23193 L: 22770 D: 43851
Ptnml(0-2): 53, 9532, 25321, 9941, 60
bench 2717363

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

Bench: 2791988
2025-12-23 21:42:45 +01:00
anematodeandDisservin 1a67ccc72e Share correction history between threads
We did quite a few tests because this is a pretty involved change with
unknown scaling behavior, but results are decent.

[STC 10+0.1 1th, non-regression](https://tests.stockfishchess.org/tests/live_elo/6941ce3b46f342e1ec210180)
```
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 83200 W: 21615 L: 21452 D: 40133
Ptnml(0-2): 247, 9064, 22844, 9169, 276
```

[STC 5+0.05 8th](https://tests.stockfishchess.org/tests/live_elo/693dc38346f342e1ec20f555)
```
LLR: 3.48 (-2.94,2.94) <0.00,2.00>
Total: 58536 W: 15067 L: 14688 D: 28781
Ptnml(0-2): 87, 6474, 15781, 6825, 101
```

[LTC 20+0.2 8th](https://tests.stockfishchess.org/tests/live_elo/693f2afb46f342e1ec20f847)
```
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 27716 W: 7211 L: 6925 D: 13580
Ptnml(0-2): 8, 2674, 8207, 2962, 7
```

[LTC 10+0.1 64th](https://tests.stockfishchess.org/tests/live_elo/694003aa46f342e1ec20fac4):
```
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 16918 W: 4439 L: 4182 D: 8297
Ptnml(0-2): 3, 1493, 5213, 1744, 6
```

[NUMA test, 5+0.05 256th](https://tests.stockfishchess.org/tests/view/6941ee4e46f342e1ec210203)
```
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 7124 W: 1910 L: 1678 D: 3536
Ptnml(0-2): 0, 560, 2211, 790, 1
```

[LTC 60+0.6 64th](https://tests.stockfishchess.org/tests/live_elo/6940a85346f342e1ec20fcde):
```
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 15504 W: 4045 L: 3826 D: 7633
Ptnml(0-2): 0, 1002, 5530, 1219, 1
```

Bonus (courtesy of Viz): The 1 double kill in this last test was master
blundering a cool mate in 3: https://lichess.org/jyNZuRl4

Basically the idea here is to share correction history between threads.
That way, T1 can use the correction values produced by T2, which already
searched positions with that pawn structure etc., so that T1 can search
more efficiently. The table size per thread is about the same, so we
shouldn't get a large increase in hash collisions; in fact, I'd expect a
lower collision rate overall.

Although I came up with and implemented the idea independently,
[Caissa](https://github.com/Witek902/Caissa) was the first engine to
implement corrhist sharing (and corrhist in the first place) – this idea
is not completely novel.

The table size is rounded to a power of two. In particular, it's `65536
* nextPowerOfTwo(threadCount)`. That way, the indexing operation becomes
an AND of the key bits with a mask, rather than something more expensive
(e.g., a `mul_hi64`-style approach or a modulo).

The updates are racy, like the TT, but because `entry` is hoisted into a
register, there's no risk of writing back a value that's out of the
designated range `[-D, D]`. Various attempts at rewriting using atomics
led to substantial slowdowns, so we begrudgingly ignored the functions
in thread sanitizer, but at some point we'd like to make this better.

We allocate one shared correction history per NUMA node, because the
penalty associated with crossing nodes is substantial – I get a 40% hit
with NPS=4 and 256 threads, which is intolerable. With separate tables
per NUMA node I get a 6% penalty for nodes per second, which isn't ideal
but apparently compensated for.

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

Bench: 2690604

Co-authored-by: Disservin <disservin.social@gmail.com>
2025-12-23 21:42:29 +01:00
FauziAkramandDisservin fb41f2953f Remove low ply history for check evasions scoring
Passed STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 81888 W: 21336 L: 21166 D: 39386
Ptnml(0-2): 284, 9438, 21342, 9584, 296
https://tests.stockfishchess.org/tests/view/692ada47b23dfeae38cffce5

Passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 107328 W: 27534 L: 27404 D: 52390
Ptnml(0-2): 55, 11390, 30659, 11490, 70
https://tests.stockfishchess.org/tests/view/692d7a01b23dfeae38d011ab

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

Bench: 3006182
2025-12-23 21:41:34 +01:00
AliceRoseliaandDisservin c467fe5ba4 Simplify futility pruning
Passed non regression STC:
https://tests.stockfishchess.org/tests/view/693e642c46f342e1ec20f68d
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 107968 W: 28080 L: 27937 D: 51951
Ptnml(0-2): 381, 12708, 27626, 12925, 344

Passed non regression LTC:
https://tests.stockfishchess.org/tests/view/693ff10c46f342e1ec20fa6a
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 334266 W: 85271 L: 85370 D: 163625
Ptnml(0-2): 179, 36395, 94086, 36292, 181

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

Bench: 2987379
2025-12-21 15:43:32 +01:00
Shawn XuandDisservin 495296fc76 Remove Secondary TT Aging
Passed VVLTC w/ STC Bounds:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 107006 W: 27676 L: 27326 D: 52004
Ptnml(0-2): 21, 9505, 34097, 9863, 17
https://tests.stockfishchess.org/tests/view/6939ac5b75b70713ef796f11

Passed VVLTC w/ LTC Bounds:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 263190 W: 67547 L: 66837 D: 128806
Ptnml(0-2): 32, 23939, 82942, 24651, 31
https://tests.stockfishchess.org/tests/view/692165823b03dd3a060e666d

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

Bench: 2800411
2025-12-21 15:43:32 +01:00
sscg13andDisservin 32292d1e62 Represent threat weights directly as i8
LEB128 adds no additional compression and adds extra complexity to the
code currently.

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

No functional change
2025-12-21 15:43:32 +01:00
Daniel MonroeandDisservin b4b01d0ca2 Remove rootDepth condition in newDepth clamping
Passed simplification STC
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 132256 W: 34462 L: 34347 D: 63447
Ptnml(0-2): 470, 15625, 33833, 15720, 480
https://tests.stockfishchess.org/tests/view/69325fe0a24a6df719fcca16

Passed simplification LTC
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 128220 W: 32503 L: 32392 D: 63325
Ptnml(0-2): 94, 13900, 35982, 14069, 65
https://tests.stockfishchess.org/tests/view/6934c2b3a24a6df719fcdf1e

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

Bench: 2926903
2025-12-21 15:43:32 +01:00
ppigazziniandDisservin d92e6b458a chore(ci): bump runner to macos-15
closes https://github.com/official-stockfish/Stockfish/pull/6475

No functional change
2025-12-21 15:43:32 +01:00
Pieter te BrakeandDisservin 955c927265 Removed redundant board updates
Contrary to what the comment says, `remove_piece` does in fact set the
relevant `board` elements to `NO_PIECE`.

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

No functional change
2025-12-21 15:43:32 +01:00
Timothy HerchenandDisservin e0e6fdf094 Tweak nnue_accumulator indexing
```
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 92736 W: 24149 L: 23764 D: 44823
Ptnml(0-2): 280, 10056, 25334, 10395, 303
```

The use of `IndexType` in the loops is suboptimal because it requires
truncation to 32 bits, and thereby defeats some optimizations. Using
`size_t` for the loop body works nicely, and a signed index into the
index lists allows the compiler to assume the case `added.size() ==
UINT_MAX`, which would be an infinite loop, to not happen.

Passed STC
https://tests.stockfishchess.org/tests/live_elo/692fd98ab23dfeae38d01d98

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

No functional change
2025-12-21 15:43:32 +01:00
mstemberaandDisservin e1c919fd7e Fix one error and all warnings on MSVC 2026
The error is "C1001: Internal compiler error." in uci.cpp on line 370 of
master.  For some reason the compiler can't handle the
std::size(hashfullAges) inside the lambda.  Older MSVC versions had no
problem.

Most of the warnings are due to implicit type conversions "conversion
from type A to type B, possible loss of data"
many of which have been present for a while.

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

No functional change
2025-12-21 15:43:32 +01:00
Daniel MonroeandDisservin 8449e5eb9d Remove non-functional term in isShuffling
closes https://github.com/official-stockfish/Stockfish/pull/6462

No functional change
2025-12-21 15:43:32 +01:00
Timothy HerchenandDisservin a98c3f6878 Small threat-related cleanups
Remove a couple unused things, mark `noRaysContaining` as
`[[maybe_unused]]` (suggested by Viz) to silence a warning on GCC 10,
update a comment, and replace inline constants

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

No functional change
2025-12-21 15:43:32 +01:00
FauziAkramandDisservin 863c0ec6d0 Simplify piece threat calculation
Passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 105984 W: 27206 L: 27067 D: 51711
Ptnml(0-2): 260, 11556, 29245, 11647, 284
https://tests.stockfishchess.org/tests/view/6914798e7ca87818523317cf

Passed LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 53028 W: 13635 L: 13456 D: 25937
Ptnml(0-2): 28, 5184, 15908, 5369, 25
https://tests.stockfishchess.org/tests/view/6918c5fc7ca8781852332312

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

No functional change
2025-12-21 15:43:25 +01:00
FauziAkramandDisservin 5edfabd070 Fix Typo
closes https://github.com/official-stockfish/Stockfish/pull/6436

No functional change
2025-12-21 15:22:06 +01:00
Timothy HerchenandJoost VandeVondele c109a88ebe fix missing condition
Fixes a bug in https://github.com/official-stockfish/Stockfish/pull/6453
https://github.com/official-stockfish/Stockfish/commit/abd835dcbc3a28481224f6253b00b7420d062513
The modifications to the DirtyThreats bitboards should only happen if PutPiece is true.
This somehow didn't affect bench at the default parameters.

Reference AVX2:
./stockfish.killdeer-fix.avx2 bench 64 1 23
Nodes searched  : 178140156
Nodes/second    : 1503152

before patch:
./stockfish.master.avx512icl  bench 64 1 23
Nodes searched  : 218349728
Nodes/second    : 1743450

after patch:
./stockfish.killdeer-fix.avx512icl bench 64 1 23
Nodes searched  : 178140156
Nodes/second    : 1727520

passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 39328 W: 10293 L: 10080 D: 18955
Ptnml(0-2): 113, 4306, 10629, 4487, 129
https://tests.stockfishchess.org/tests/view/692fb2d8b23dfeae38d01c81

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

Bench: 2912398
2025-12-03 12:32:29 +01:00
Daniel MonroeandJoost VandeVondele 5297ba0a1a Move hindsight reductions above cutoffs
Passed STC
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 52640 W: 13701 L: 13361 D: 25578
Ptnml(0-2): 168, 6143, 13356, 6487, 166
https://tests.stockfishchess.org/tests/view/6918dc407ca8781852332339

Passed LTC
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 207690 W: 53187 L: 52520 D: 101983
Ptnml(0-2): 93, 22515, 57994, 23118, 125
https://tests.stockfishchess.org/tests/view/6919dd307ca87818523324c7

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

Bench: 2912398
2025-12-01 17:35:34 +01:00
Timothy HerchenandJoost VandeVondele abd835dcbc Improve update_piece_threats
passed on avx512ICL:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 30240 W: 8026 L: 7726 D: 14488
Ptnml(0-2): 95, 3235, 8171, 3513, 106
https://tests.stockfishchess.org/tests/view/69281d9ab23dfeae38cfeeb8

passed on generic architectures:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 73184 W: 19183 L: 18821 D: 35180
Ptnml(0-2): 258, 7988, 19744, 8338, 264
https://tests.stockfishchess.org/tests/view/6928ba11b23dfeae38cff276

subsequent cleanups tested as:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 72480 W: 18678 L: 18502 D: 35300
Ptnml(0-2): 242, 7925, 19718, 8125, 230
https://tests.stockfishchess.org/tests/view/692a26adb23dfeae38cff566

We add an argument noRaysContaining, which skips all discoveries which contain
all bits in the argument; if the argument is from | to, then this will
eliminate the discovery. Separately, on AVX512ICL we can speed up the
computation of DirtyThreats by moving from a pop_lsb loop to a vector
extraction with vpcompressb. See PR for details.

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

No functional change
2025-12-01 17:26:50 +01:00
Joost VandeVondeleandDisservin 9e2ee13e77 Update main network to nn-2962dca31855.nnue
trained with https://github.com/vondele/nettest/blob/dd921672bd4ad8eb09fa45248078450857e81884/threats.yaml

on top off and tested against https://github.com/official-stockfish/Stockfish/pull/6452

passed STC
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 130720 W: 34028 L: 33570 D: 63122
Ptnml(0-2): 435, 15348, 33384, 15710, 483
https://tests.stockfishchess.org/tests/view/69294539b23dfeae38cff3ad

passed LTC
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 51144 W: 13140 L: 12794 D: 25210
Ptnml(0-2): 38, 5370, 14408, 5720, 36
https://tests.stockfishchess.org/tests/view/692a9c37b23dfeae38cffa4f

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

Bench: 2823033
2025-11-30 21:58:35 +01:00
KazAppsandDisservin 74303ca7f9 Update AUTHORS (KazApps)
closes https://github.com/official-stockfish/Stockfish/pull/6454

No functional change
2025-11-30 21:58:35 +01:00
Joost VandeVondeleandDisservin 4fe04a2cc6 Update main network to nn-87a9d7857d88.nnue
trained with https://github.com/vondele/nettest/blob/842d95177f882c0e9b5262247c38d8fcb3e0f3db/threats.yaml

passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 114880 W: 30291 L: 29851 D: 54738
Ptnml(0-2): 499, 13547, 28947, 13909, 538
https://tests.stockfishchess.org/tests/view/6923ec4bba083df4ca63dd39

passed LTC:
LLR: 2.97 (-2.94,2.94) <0.50,2.50>
Total: 113268 W: 29115 L: 28634 D: 55519
Ptnml(0-2): 114, 12295, 31340, 12766, 119
https://tests.stockfishchess.org/tests/view/6925cd01b23dfeae38cfe134

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

Bench: 3028457
2025-11-30 21:58:35 +01:00
FauziAkramandDisservin c95386256e Simplify the highBestMoveEffort formula in Time management
Passed STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 22272 W: 5885 L: 5655 D: 10732
Ptnml(0-2): 76, 2329, 6108, 2535, 88
https://tests.stockfishchess.org/tests/view/69244d07ba083df4ca63e02b

Passed LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 48690 W: 12405 L: 12221 D: 24064
Ptnml(0-2): 29, 4755, 14597, 4931, 33
https://tests.stockfishchess.org/tests/view/6924de9aba083df4ca63e327

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

No functional change
2025-11-30 21:58:35 +01:00
Timothy HerchenandDisservin 7c7c574e6b Fix msvc macro
closes https://github.com/official-stockfish/Stockfish/pull/6449

No functional change
2025-11-30 21:58:35 +01:00
Shawn XuandDisservin 45d034fa50 Formatting fixups
closes https://github.com/official-stockfish/Stockfish/pull/6446

No functional change
2025-11-30 21:58:35 +01:00
pb00067andDisservin c73f21df97 Fix for SF getting stuck during search (issue #5023)
Among several passed similar versions this is the simpliest one.

Passed STC non-regression
https://tests.stockfishchess.org/tests/view/691f3b4aacb6dbdf23d07d11
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 126368 W: 32607 L: 32489 D: 61272
Ptnml(0-2): 408, 13974, 34298, 14100, 404

Passed LTC non-regression
https://tests.stockfishchess.org/tests/view/69209712acb6dbdf23d0836a
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 114786 W: 29097 L: 28976 D: 56713
Ptnml(0-2): 53, 11841, 33488, 11954, 57

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

Bench: 2941767
2025-11-30 21:58:34 +01:00
Carlos EsparzaandDisservin f4244e13e4 Some more work on FullThreats::make_index
[Passed STC](https://tests.stockfishchess.org/tests/live_elo/691fc321acb6dbdf23d07e4b):

```
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 215360 W: 55651 L: 55108 D: 104601
Ptnml(0-2): 520, 22399, 61290, 22960, 511
```

This PR is on top of ces42's work so I'll rebase if that PR changes.
Essentially, it comprises my adjustments to `make_index` that remained
unmerged before threat inputs was finalized.

The unsigned intermediate variables let us skip a bunch of useless sign
extensions (because Square and Piece inherit from `int8_t`, and C/C++
semantics require narrow integers to be promoted to `int` before doing
arithmetic on them). Additionally, by removing the special usage of
`offsets[][64]` and `[65]` the indexing becomes more efficient. (This
usage was a temporary hack from sscg anyway, so I think he'll like that
it's gone.) Finally, the `sf_assume` condition was fixed so that it
actually makes a difference to the compiler.

The speedup is fairly nice locally (combining both ces42's and these changes):

```
Result of 100 runs
==================
base (...kfish.master) =    1691982  +/- 1907
test (./stockfish    ) =    1714349  +/- 1789
diff                   =     +22367  +/- 2465

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

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

No functional change
2025-11-30 21:45:14 +01:00
Shawn XuandDisservin 93f2d14d95 Simplify Incremental Updates
Passed Non-regression STC:
LLR: 3.03 (-2.94,2.94) <-1.75,0.25>
Total: 277856 W: 71575 L: 71611 D: 134670
Ptnml(0-2): 842, 30719, 75836, 30695, 836
https://tests.stockfishchess.org/tests/view/69169dc17ca8781852331d76

Supersedes #6430

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

No functional change
2025-11-30 21:43:54 +01:00
Shawn XuandDisservin 1132d893e0 Simplify Accumulator Updates
Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 146848 W: 37915 L: 37820 D: 71113
Ptnml(0-2): 415, 16159, 40186, 16244, 420
https://tests.stockfishchess.org/tests/view/691772217ca878185233202b

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

No functional change
2025-11-30 21:41:51 +01:00
Daniel MonroeandJoost VandeVondele d9fd516547 Post-NNUEv10 tune
Tune search parameters after the switch to NNUEv10.

The change is neutral at STC but increases with the TC. The main changes are more aggressive corrections, futility pruning, and extensions.

Failed STC
LLR: -2.96 (-2.94,2.94) <0.00,2.00>
Total: 108320 W: 27616 L: 27719 D: 52985
Ptnml(0-2): 332, 12833, 27884, 12828, 283
https://tests.stockfishchess.org/tests/view/69212e623b03dd3a060e6114

Passed LTC
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 43272 W: 11117 L: 10788 D: 21367
Ptnml(0-2): 20, 4543, 12180, 4874, 19
https://tests.stockfishchess.org/tests/view/692130813b03dd3a060e6123

Passed VLTC
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 22714 W: 5840 L: 5581 D: 11293
Ptnml(0-2): 2, 2152, 6795, 2401, 7
https://tests.stockfishchess.org/tests/view/6921387b3b03dd3a060e6191

Passed VLTC SMP
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 11868 W: 3142 L: 2896 D: 5830
Ptnml(0-2): 0, 1007, 3676, 1249, 2
https://tests.stockfishchess.org/tests/view/69212e953b03dd3a060e611b

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

bench 2907929
2025-11-22 07:56:47 +01:00
Shawn XuandJoost VandeVondele 035cb146d4 Do more futility pruning
closes https://github.com/official-stockfish/Stockfish/pull/6433

Bench: 2469519
2025-11-17 14:03:02 +01:00
Joost VandeVondele 61149ac9ee Update main net to nn-c0ae49f08b40.nnue
Trained using the recipe https://github.com/vondele/nettest/blob/d39f72420504e474a716b9977c1380541a7b482e/threats.yaml

fix CI check for negative evals.

fix format

passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 84032 W: 21876 L: 21490 D: 40666
Ptnml(0-2): 239, 9821, 21553, 10121, 282
https://tests.stockfishchess.org/tests/view/6914b81e7ca87818523318aa

passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 126420 W: 32429 L: 31927 D: 62064
Ptnml(0-2): 56, 13748, 35118, 14214, 74
https://tests.stockfishchess.org/tests/view/6916c1277ca8781852331dd8

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

Bench: 2513286
2025-11-17 14:00:33 +01:00
Joost VandeVondele a27fcd6274 Fix format
No functional change
2025-11-17 13:57:53 +01:00
Andreas MatthiesandJoost VandeVondele 563b4a9c4d Cleanup benchmark
Avoid unnecessary consecutive ucinewgame commands in benchmark setup.
Remove measuring time and nodes in speedtest warmup.

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

No functional change
2025-11-17 13:37:55 +01:00
Joost VandeVondele 4b8fffe3b3 Silence warning
for systems without shared memory support

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

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

No functional change
2025-11-17 13:36:11 +01:00
Carlos EsparzaandJoost VandeVondele 2084d94266 inline make_index() and avoid templating perspective
combination of two patches.

pass perspective as argument
passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 52832 W: 13725 L: 13528 D: 25579
Ptnml(0-2): 154, 5756, 14412, 5927, 167
https://tests.stockfishchess.org/tests/view/69162e307ca8781852331c6a

inline make_index
passed STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 68768 W: 17786 L: 17607 D: 33375
Ptnml(0-2): 187, 7591, 18694, 7680, 232
https://tests.stockfishchess.org/tests/view/6916859e7ca8781852331d36

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

No functional change
2025-11-17 13:34:45 +01:00
Timothy HerchenandJoost VandeVondele b083049fe0 Use non-locking operations for nodes count and tbHits
fetch_add and friends must produce a locking instruction because they guarantee
consistency in the presence of multiple writers. Because only one thread ever
writes to nodes and tbHits, we may use relaxed load and store to emit regular
loads and stores (on both x86-64 and arm64), while avoiding undefined behavior
and miscounting nodes.

Credit must go to Arseniy Surkov of Reckless (codedeliveryservice) for
uncovering this performance gotcha.

failed yellow as a gainer on fishtest:
LLR: -2.95 (-2.94,2.94) <0.00,2.00>
Total: 219616 W: 57165 L: 57105 D: 105346
Ptnml(0-2): 732, 24277, 59720, 24357, 722
https://tests.stockfishchess.org/tests/view/69086abfea4b268f1fac2809

potential small speedup on large core system:
```
==== master ====
1 Nodes/second : 294269736
2 Nodes/second : 295217629
Average (over 2):  294743682
==== patch ====
1 Nodes/second : 299003603
2 Nodes/second : 298111320
Average (over 2):  298557461
```

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

No functional change
2025-11-17 13:24:32 +01:00
Shawn XuandJoost VandeVondele 1d504b927f Fix undefined behavior
C++ standard does not define `uint8_t` as an allowed pointer alias type. Despite
`uint8_t` being `unsigned char` on most platforms, this is not enforced by the standard.

https://eel.is/c++draft/basic.lval#11
https://stackoverflow.com/a/16138470

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

No functional change
2025-11-14 17:43:44 +01:00
Robert NurnbergandJoost VandeVondele 4b71d8e202 Allow time checking after each DTZ probe
This PR allows for time checking within Tablebases::rank_root_moves(). The
principal application for now is syzygy_extend_pv().

In the past, Stockfish suffered some time losses at e.g. TCEC when the HDD with
the DTZ tables was too slow for the chosen move overhead setting, see #5894.

```
> ./fastchess -engine name="patch" cmd=./stockfish.patch -engine name="master" cmd=./stockfish.master -each tc=10+0.1 option.SyzygyPath=/disk1/syzygy/3-4-5-6/WDL:/disk2/syzygy/3-4-5-6/DTZ -draw movenumber=34 movecount=8 score=20 -openings file=UHO_Lichess_4852_v1.epd format=epd -rounds 50 -repeat -concurrency 16
...
Results of patch vs master (10+0.1, 1t, 16MB, UHO_Lichess_4852_v1.epd):
Elo: 59.64 +/- 35.35, nElo: 117.61 +/- 68.10
LOS: 99.96 %, DrawRatio: 56.00 %, PairsRatio: 4.50
Games: 100, Wins: 34, Losses: 17, Draws: 49, Points: 58.5 (58.50 %)
Ptnml(0-2): [0, 4, 28, 15, 3], WL/DD Ratio: 0.87
--------------------------------------------------

Player: master
  Timeouts: 19
  Crashed: 0

Finished match
```

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

No functional change
2025-11-14 17:38:55 +01:00
Shawn XuandJoost VandeVondele db824e26be Pass accumulator caches by reference
closes https://github.com/official-stockfish/Stockfish/pull/6416

No functional change
2025-11-14 17:32:17 +01:00
Daniel MonroeandJoost VandeVondele a191791f46 Clean up code and comments
closes https://github.com/official-stockfish/Stockfish/pull/6416

No functional change
2025-11-14 17:30:55 +01:00
Shawn XuandJoost VandeVondele bd82b9e01f Cleanup, fix style issues
use naming convention for variables, functions, constants

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

no functional change
2025-11-14 17:29:01 +01:00
AliceRoseliaandJoost VandeVondele 7b7a9485d6 Simplify indexing
Removes 1 function (from_to) from the Move type, change them to simpler raw.
Remove the "and" use in the correction history structure calculation. Adjust
the indexing.

Passed simplification STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 42880 W: 11327 L: 11113 D: 20440
Ptnml(0-2): 161, 4852, 11212, 5042, 173
https://tests.stockfishchess.org/tests/view/690593b8ea4b268f1fac1e8a

Passed simplification LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 43560 W: 11276 L: 11079 D: 21205
Ptnml(0-2): 17, 4679, 12197, 4864, 23
https://tests.stockfishchess.org/tests/view/6906f819ea4b268f1fac216b

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

Bench: 2523092
2025-11-14 17:28:17 +01:00
FauziAkramandJoost VandeVondele df88db16c6 Simplify NMP reduction formula
Passed STC:
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 178912 W: 46625 L: 46559 D: 85728
Ptnml(0-2): 540, 21167, 45975, 21235, 539
https://tests.stockfishchess.org/tests/view/69060677ea4b268f1fac1f25

Passed LTC:
LLR: 2.99 (-2.94,2.94) <-1.75,0.25>
Total: 140988 W: 36278 L: 36176 D: 68534
Ptnml(0-2): 82, 15520, 39215, 15568, 109
https://tests.stockfishchess.org/tests/view/6908bc32ea4b268f1fac288f

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

bench: 2959834
2025-11-14 17:24:16 +01:00
Timothy HerchenandJoost VandeVondele 229bd1e2e3 check for material key validity in tbprobe
During recent work on threat inputs, there was a hard-to-debug crash in tbprobe
caused by incorrectly computing st->materialKey. This PR adds correctness
checking to pos_is_ok and a faster check in tbprobe that will actually run in
CI (because pos_is_ok checking is disabled even in debug mode, for performance
purposes).

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

No functional change
2025-11-13 22:42:10 +01:00
Torsten HellwigandJoost VandeVondele 3f2405bf4e Print NEON before POPCNT in compilation settings
Normally, Stockfish outputs the compilation settings from advanced to less
advanced, e.g.: `AVX512ICL VNNI AVX512 BMI2 AVX2 SSE41 SSSE3 SSE2 POPCNT`

With NEON, however, POPCNT is printed first, followed by the more advanced NEON
options: `POPCNT NEON_DOTPROD`

This PR places POPCNT behind the NEON options as well.

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

no functional change
2025-11-13 22:36:30 +01:00
Daniel MonroeandJoost VandeVondele 9e38023a8c Simplify threat term in movepick
Passed simplification STC
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 71296 W: 18605 L: 18419 D: 34272
Ptnml(0-2): 250, 8374, 18183, 8622, 219
https://tests.stockfishchess.org/tests/view/690454c7ea4b268f1fac1bbe

Passed simplification LTC
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 240552 W: 61870 L: 61874 D: 116808
Ptnml(0-2): 113, 26300, 67460, 26284, 119
https://tests.stockfishchess.org/tests/view/69063956ea4b268f1fac1f66

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

bench 2697501
2025-11-13 22:35:33 +01:00
Didier DurandandJoost VandeVondele 55643baa3f Fix some doc typos
closes https://github.com/official-stockfish/Stockfish/pull/6400

No functional change
2025-11-13 22:32:12 +01:00
Daniel MonroeandJoost VandeVondele 8551f86efc Remove check term in capture movepick
Passed simplification STC
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 248448 W: 64697 L: 64708 D: 119043
Ptnml(0-2): 784, 29393, 63971, 29202, 874
https://tests.stockfishchess.org/tests/view/68fc7afb637acd2a11e72d86

Passed simplification LTC
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 193626 W: 49808 L: 49764 D: 94054
Ptnml(0-2): 162, 21415, 53621, 21447, 168
https://tests.stockfishchess.org/tests/view/6901ad09637acd2a11e73828

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

bench 2920273
2025-11-13 22:31:02 +01:00