Commit Graph
6932 Commits
Author SHA1 Message Date
anematodeandJoost VandeVondele 0d26c61ff2 fix return type of vmovl_high_s8
also add -flax-vector-conversions=none to the build

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

No functional change
2026-02-04 17:32:48 +01:00
DisservinandJoost VandeVondele 823b04e58a Restore development
closes https://github.com/official-stockfish/Stockfish/pull/6581

No functional change
2026-02-04 17:29:42 +01:00
Joost VandeVondele cb3d4ee9b4 Stockfish 18
Official release version of Stockfish 18

Bench: 2050811

---

Stockfish 18

Today, we have the pleasure of announcing Stockfish 18, a new major release. As
always, you can freely download it at [stockfishchess.org/download][1] and use
it as a drop-in replacement in the [GUI of your choice][2] to benefit from
stronger play and more accurate analysis.

Whether you can spare hours or days of CPU time, your help matters for the
ongoing development of Stockfish. Find out how you can help at
[stockfishchess.org/get-involved][3]. Join our [Discord server][4] to get in
touch with the community of developers and users of the project!

Quality of chess play

In tests against Stockfish 17, this new release brings an Elo gain of up to [46
points][5], and wins [four times as many game pairs][6] as it loses. Quality
improved throughout, including in [Fischer Random Chess][7].

Stockfish is stronger than any human, even when running on older or low-end
hardware. On the highest-end hardware, where Stockfish can search over [500
million positions per second][8], it continues to [dominate chess engine
tournaments][9].

Update highlights

Next-Generation Evaluation

This release introduces the SFNNv10 network architecture. The network’s input
layer has been augmented with 'Threat Inputs' features as part of a massive
community effort. These features allow the engine to 'see' which pieces are
threatened more naturally, resulting in more accurate evaluations.

Hardware and Performance Optimizations

A key highlight is the new 'Shared Memory' implementation, which allows
different Stockfish processes to share the same memory space for neural network
weights. This makes it the most efficient version for cloud analysis and
high-concurrency testing.

Significant efforts have also been made to utilize hardware more effectively by
adapting the code to make use of modern CPU instructions and refining how
threads interact during a search.

Search Improvements

Stockfish 18 features a heavily refined search, utilizing 'Correction History'
to dynamically adjust evaluations based on patterns found during the search
itself. These and other refinements allow the engine to detect stalemates and
evaluate fortresses significantly better than previous versions. A particularly
rare issue, involving threefold repetition detection, en passant, and pins, was
also fixed.

Refactored Training Workflow

The training of Stockfish's neural networks has transitioned to an automated
and reproducible model. This new framework allows the project to employ
standardized recipes to chain complex training stages together. This transition
facilitates the training of networks using over 100 billion positions of [Lc0
evaluation data][10].

Thank you

In this release in particular, we are deeply grateful to the contributors who
shared their research and ideas to help develop the new threat-input network
architecture.

The Stockfish project builds on a thriving community of enthusiasts (thanks to
everybody!) who contribute their expertise, time, and resources to build a free
and open-source chess engine that is robust, widely available, and very strong.

We would like to express our gratitude for the [14.6k stars][11] that light up
our GitHub project. Thank you for your support and encouragement – your
recognition means a lot to us. Programmers can contribute to the project either
directly to [Stockfish][12] (C++), to [Fishtest][13] (HTML, CSS, JavaScript,
and Python), to our trainer [nnue-pytorch][14] (C++ and Python), or to our
[website][15] (HTML, CSS/SCSS, and JavaScript).

The Stockfish team

[1]: https://stockfishchess.org/download
[2]: https://official-stockfish.github.io/docs/stockfish-wiki/Download-and-usage.html#download-a-chess-gui
[3]: https://stockfishchess.org/get-involved/
[4]: https://discord.gg/GWDRS3kU6R
[5]: https://tests.stockfishchess.org/tests/view/696a9e15cec152c6220c1d19
[6]: https://tests.stockfishchess.org/tests/view/696a9e4dcec152c6220c1d1b
[7]: https://tests.stockfishchess.org/tests/view/696a9e83cec152c6220c1d1d
[8]: https://openbenchmarking.org/test/pts/stockfish
[9]: https://en.wikipedia.org/wiki/Stockfish_(chess)#Competition_results
[10]: https://lczero.org/blog/2021/06/the-importance-of-open-data/
[11]: https://github.com/official-stockfish/Stockfish/stargazers
[12]: https://github.com/official-stockfish/Stockfish
[13]: https://github.com/official-stockfish/fishtest
[14]: https://github.com/official-stockfish/nnue-pytorch
[15]: https://github.com/official-stockfish/stockfish-web
stockfish-dev-20260131-cb3d4ee9 sf_18
2026-01-31 12:46:49 +01:00
anematodeandDisservin 253aaefbc0 Fix compilation on BSD/macOS
fixes github.com/official-stockfish/Stockfish/issues/6571

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

No functional change
2026-01-28 20:28:27 +01:00
anematodeandJoost VandeVondele c0f245303b Make PGO builds deterministic again
some environment dependent execution (e.g. pid) were being std::hash'ed, and
net filenames put in unordered maps.  Also uses sprintf instead of
std::to_string.  Depending on precise content, this could lead to different
PGO'ed binaries. This is mitigated by using a basic hash function.

This also fixes a potential issue in net filename generation, in cases where
std::hash would use invocation dependent salt, which is not the cases today for
typical std libraries.

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

No functional change
2026-01-22 19:15:17 +01:00
anematodeandJoost VandeVondele f61d4317a3 use default signal handler after cleanup
With the current setup, on Linux, SIGILL (and SIGSEGV/SIGBUS etc., in the case
of a program bug) lead to no feedback if they occur after the signal handlers
are installed, they just exit silently. By invoking the default signal handler,
we can still get the appropriate feedback. This is particularly important for
feedback if someone downloads the wrong SF binary and runs it on Linux.

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

No functional change
2026-01-18 08:53:06 +01:00
Robert Nurnberg @ elitebookandJoost VandeVondele 71f53b92c7 update the WDL model
This PR updates the internal WDL model, using data from 3.1M games played by
the revisions since 44d5467. Note that the normalizing constant increases only
moderately from 377 to 385.

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

No functional change
2026-01-15 22:19:50 +01:00
anematodeandJoost VandeVondele 5b8b304ebd Skip munmap when exiting via a signal
avoid munmap of memory when exiting via signal, which avoids side effects such
as triggering asserts or (caught) segfaults while the process exists.

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

No functional change
2026-01-15 22:17:14 +01:00
Joost VandeVondele 0b9068d510 Fix integer overflow.
scaledBonus can reach rather large values,
which lead to an int overflow as detected anematode using ubsan.
(see https://github.com/official-stockfish/Stockfish/issues/6505#issuecomment-3696988889)

It can be fixed by scaling nominator and denominator appropriately,
which doesn't change the bench, as long as there is no overflow.

First overflow/bench change happens at depth 26

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

Bench: 2050811
2026-01-15 22:13:26 +01:00
Timothy HerchenandJoost VandeVondele eb5a65aeb0 Fix RelationCache on Windows 10 compiles
Windows 10 is missing the GroupMasks and GroupCount members, this breaks compiles on Windows 10.
Windows 11 builds, including the official ones, run fine on Windows 10/11.
To support developers/testers on Windows 10, fallback conditionally to the Windows 10 struct definition.

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

No functional change
2026-01-11 09:13:37 +01:00
KazAppsandJoost VandeVondele e9b2864579 Simplify make_index
Refactor index LUT construction to simplify make_index.

Passed STC Non-Regression:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 62432 W: 16193 L: 16006 D: 30233
Ptnml(0-2): 189, 6950, 16764, 7111, 202
https://tests.stockfishchess.org/tests/view/6959985ad844c1ce7cc7eac8

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

No functional change.
2026-01-11 09:09:55 +01:00
KazAppsandJoost VandeVondele d852a9195e Make enums unsigned
Speed up by using unsigned enums.

Passed STC:
LLR: 2.98 (-2.94,2.94) <0.00,2.00>
Total: 49248 W: 12894 L: 12568 D: 23786
Ptnml(0-2): 119, 5353, 13397, 5593, 16
https://tests.stockfishchess.org/tests/view/695e3e5002d0182a589fe965

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

No functional change
2026-01-10 16:06:18 +01:00
FauziAkramandJoost VandeVondele 9b8c5c9f75 Simplify fail high reduction formula
Passed STC:
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 165792 W: 42849 L: 42768 D: 80175
Ptnml(0-2): 512, 19499, 42800, 19566, 519
https://tests.stockfishchess.org/tests/view/695cdd95912b7ff140de60c2

Passed LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 80448 W: 20619 L: 20459 D: 39370
Ptnml(0-2): 47, 8693, 22596, 8829, 59
https://tests.stockfishchess.org/tests/view/695f7e84ca95f52e4b852536

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

bench: 2050811
2026-01-10 15:47:11 +01:00
anematodeandJoost VandeVondele b4d4eecfb2 Make shared history allocation aware of non-uniform cache access
Although shared history has been successful overall, it led to some speed
issues with large numbers of threads. Originally we just split by NUMA node,
but on systems with non-unified L3 caches (most AMD workstation and server
CPUs, and some Intel E-core based server CPUs), this can still lead to a speed
penalty at the default config. Thus, we decided to further subdivide the shared
history based on the L3 cache structure.

Based on this test, the original SPRTs, and speed experiments, we decided that
grouping L3 domains to reach 32 threads per SharedHistories was a reasonable
balance for affected systems – but we may revisit this in the future. See the
PR for full details.

In an extreme case, a single-socket EPYC 9755 configured with 1 numa domain per socket,
the nps increases from:
Nodes/second               : 182827480
to
Nodes/second               : 229118365

In many cases, when L3 caches are shared between many threads, or when several
numa nodes are already configured per socket, this patch does not influence the
default. This default setting can adjusted with the existing NumaPolicy option.

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

No functional change.
2026-01-10 15:46:01 +01:00
DisservinandJoost VandeVondele 1928ef9571 Compiler Check
Compiles and Runs Stockfish on all supported gcc & clang compilers.
Only linux and avx2 currently.

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

No functional change
2026-01-10 15:36:52 +01:00
DisservinandJoost VandeVondele 5d5e795746 Fix Compiler Warning
Only the one on line 158 is actually required but doesn't hurt to add constexpr where applicable here.

Warning was

"comparison of unsigned expression in '< 0' is always false"

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

No functional change
2026-01-10 15:34:37 +01:00
DisservinandJoost VandeVondele d39bfb61a2 Fix Clang Tbprobe Miscompilation
Recent changes to the Square enum (reducing it from int32_t to int8_t)
now allow the compiler to vectorize loops that were previously too wide
for targets below AVX-512. However, this vectorization which Clang
performs is not correct and causes a miscompilation.

Disable this vectorization.

This particular issue was noticable with Clang 15 and Clang 19,
on avx2 as well as applie-silicon.

Ref: #6063
Original Clang Issue: llvm/llvm-project#80494

First reported by #6528, though misinterpreted.

closes #6529

No functional change
2026-01-10 15:33:36 +01:00
Jakub CiolekandJoost VandeVondele c27c1747e3 qsearch: prevent bestValue from going down
The bestValue can sometimes go down. This happens 2% of the time or so.
This fix stops it from decreasing.

Failed gainer STC:
LLR: -2.94 (-2.94,2.94) <0.00,2.00>
Total: 146176 W: 37930 L: 37976 D: 70270
Ptnml(0-2): 480, 17422, 37366, 17304, 516
https://tests.stockfishchess.org/tests/view/6953be19572093c1986da66a

Passed Non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 257796 W: 65662 L: 65683 D: 126451
Ptnml(0-2): 164, 28247, 72087, 28246, 154
https://tests.stockfishchess.org/tests/view/69554ff0d844c1ce7cc7e333

closes https://github.com/official-stockfish/Stockfish/pull/6520
fixes https://github.com/official-stockfish/Stockfish/issues/6519

Bench: 2477446
2026-01-06 12:08:08 +01:00
anematodeandJoost VandeVondele 8be6b14218 Network loading refactoring
closes https://github.com/official-stockfish/Stockfish/pull/6523

No functional change
2026-01-06 12:02:37 +01:00
Syine MinetaandJoost VandeVondele d678f839d8 Fix remote access bug across NUMA nodes
Ensure that thread-local data is created within the correct NUMA
context, so that thread stacks or thread-local storage are allocated
to proper NUMA nodes.

refs https://github.com/official-stockfish/Stockfish/issues/6516

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

No functional change
2026-01-06 12:01:01 +01:00
Joost VandeVondele 28844fc697 Update of the year
Happy New Year!

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

No functional change
2026-01-01 16:17:38 +01:00
mstemberaandJoost VandeVondele 8815d1ef02 Minor cleanup in full_threats.cpp
closes https://github.com/official-stockfish/Stockfish/pull/6509

No functional change
2026-01-01 16:13:44 +01:00
FauziAkramandJoost VandeVondele 5b9259e51f Replacing nested loops with a single range-based for loop
closes https://github.com/official-stockfish/Stockfish/pull/6503

No functional change
2026-01-01 16:12:35 +01:00
anematodeandJoost VandeVondele 593eeaf24c simplify find_nnz a bit
This code path is never taken for vector sizes >= 512, so we can simplify it.

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

No functional change
2026-01-01 16:08:03 +01:00
ppigazziniandJoost VandeVondele 0317c6ccec build: rename WINE_PATH to RUN_PREFIX for wrapper execution
WINE_PATH started as a Wine-specific knob, but it’s now used more generally
as a command prefix to run the built engine under wrappers
like Intel SDE, qemu-user, etc.

- Add RUN_PREFIX as the supported “run wrapper/prefix” variable in Makefile
- Set WINE_PATH as a deprecated alias
- Update CI and scripts to use RUN_PREFIX

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

No functional change
2026-01-01 16:06:25 +01:00
anematodeandJoost VandeVondele aeb3bf33a9 port get_changed_pieces to ARM NEON
passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 71968 W: 18833 L: 18489 D: 34646
Ptnml(0-2): 192, 7310, 20643, 7640, 199
https://tests.stockfishchess.org/tests/view/69509e5c572093c1986d7a0a

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

No functional change
2026-01-01 16:04:43 +01:00
Michael ChalyandJoost VandeVondele ced9f69834 Adjust main history with every new root position
this patch dampens down main history to 3/4 of it value for all possible moves
at the start of ID loop, making it partially refresh with every new root
position.

Passed STC:
https://tests.stockfishchess.org/tests/view/694e33ff572093c1986d7234
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 115520 W: 30164 L: 29735 D: 55621
Ptnml(0-2): 395, 13192, 30192, 13551, 430

Passed LTC:
https://tests.stockfishchess.org/tests/view/6950cbe6572093c1986d816c
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 63672 W: 16480 L: 16114 D: 31078
Ptnml(0-2): 46, 6524, 18329, 6892, 45

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

bench 2710946
2026-01-01 15:53:04 +01:00
Steinar H. GundersonandJoost VandeVondele 1453691496 Fix feature check
Use _POSIX_C_SOURCE to check for PTHREAD_MUTEX_ROBUST support. The latter is a enum, not a defined variable.

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

No functional change
2026-01-01 15:52:01 +01:00
Joost VandeVondele e0fb783c30 Fix incorrect initialization
Fixes https://github.com/official-stockfish/Stockfish/issues/6505

Missing initialization seemingly resulting in side effects, as discussed in the issue.

Credit to Sopel for spotting the bug.

PR used as a testcase for CoPilot, doing the right thing https://github.com/official-stockfish/Stockfish/pull/6478#discussion_r2655467218

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

No functional change
2026-01-01 15:51:09 +01:00
Timothy HerchenandDisservin 44d5467bbe Remove -Wstack-usage on (apple) clang
Clang pretends to be GCC, but is enraged by `-Wstack-usage`:

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

No functional change
2025-12-28 14:59:26 +01:00
969285fa5d Shared pawn history
[Passed STC SMP](https://tests.stockfishchess.org/tests/view/694e506c572093c1986d7276):
```
LLR: 2.97 (-2.94,2.94) <0.00,2.00>
Total: 14992 W: 3924 L: 3653 D: 7415
Ptnml(0-2): 20, 1547, 4090, 1820, 19
```

[Passed LTC SMP](https://tests.stockfishchess.org/tests/live_elo/694ead61572093c1986d7365):
```
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 41146 W: 10654 L: 10342 D: 20150
Ptnml(0-2): 17, 3999, 12225, 4319, 13
```

[Passed a sanity check STC SMP post-refactoring](https://tests.stockfishchess.org/tests/view/69503997572093c1986d763a):
```
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 46728 W: 12178 L: 11863 D: 22687
Ptnml(0-2): 82, 5093, 12685, 5436, 68
```

(The large gain of the first STC was probably a fluke, and this result
is more reasonable!)

After shared correction history, Viz suggested we try sharing other
histories, especially `pawnHistory`. As far as we're aware, sharing
history besides correction history (like Caissa does) is novel. The
implementation follows the same pattern as shared correction history –
the size of the history table is scaled with
`next_power_of_two(threadsInNumaNode)` and the entry is prefetched in
`do_move`.

A bit of refactoring was done to accommodate this new history. Note that
we prefetch `&history->pawn_entry(*this)[pc][to]` rather than
`&history->pawn_entry(*this)` because unlike the other entries, each
entry contains multiple cache lines.

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

Bench: 2503391

Co-authored-by: Michael Chaly <Vizvezdenec@gmail.com>
2025-12-28 14:59:09 +01:00
Stefan GeschwentnerandDisservin 1780c1fd6e For expected ALL nodes scale up reduction with depth dependent factor.
Passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 141120 W: 36860 L: 36390 D: 67870
Ptnml(0-2): 470, 16441, 36314, 16819, 516
https://tests.stockfishchess.org/tests/view/694978e93c8768ca45072763

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 66576 W: 17078 L: 16700 D: 32798
Ptnml(0-2): 45, 7093, 18628, 7483, 39
https://tests.stockfishchess.org/tests/view/694bb608572093c1986d6ba6

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

Bench: 2503391
2025-12-28 14:55:55 +01:00
KazAppsandDisservin b2e60960b3 Fix nonPawnKey
Fix incorrect nonPawnKey update

Passed non-reg SMP STC:
```
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 139424 W: 35792 L: 35690 D: 67942
Ptnml(0-2): 197, 15783, 37665, 15855, 212
```
https://tests.stockfishchess.org/tests/view/694b7b7e572093c1986d6b0d

Passed non-reg SMP LTC:
```
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 88880 W: 22863 L: 22718 D: 43299
Ptnml(0-2): 16, 8947, 26401, 9028, 48
```
https://tests.stockfishchess.org/tests/view/694d2ceb572093c1986d6fc8

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

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

Bench: 2475788
2025-12-28 14:55:47 +01:00
Daniel MonroeandDisservin 1047f844d1 Simplify doDeeperSearch
Passed simplification STC
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 92096 W: 23888 L: 23728 D: 44480
Ptnml(0-2): 336, 10796, 23608, 10988, 320
https://tests.stockfishchess.org/tests/view/694b6b9d572093c1986d6ae0

Passed simplification LTC
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 50064 W: 12789 L: 12598 D: 24677
Ptnml(0-2): 24, 5350, 14103, 5521, 34
https://tests.stockfishchess.org/tests/view/694d49aa572093c1986d7021

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

Bench: 2494221
2025-12-28 14:53:12 +01:00
Joost VandeVondeleandDisservin 06819ad54c Update Top CPU Contributors
update to current

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

No functional change
2025-12-28 14:51:56 +01:00
FauziAkramandDisservin 9d69577e19 Removing redundant parentheses
closes https://github.com/official-stockfish/Stockfish/pull/6490

No functional change
2025-12-28 14:50:36 +01:00
FauziAkramandDisservin cd3a837324 Refine reduction logic based on next-ply cutoff count
Passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 38208 W: 10076 L: 9754 D: 18378
Ptnml(0-2): 139, 4390, 9742, 4676, 157
https://tests.stockfishchess.org/tests/view/6945bb6446f342e1ec211d93

Passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 64086 W: 16529 L: 16157 D: 31400
Ptnml(0-2): 34, 6808, 17990, 7174, 37
https://tests.stockfishchess.org/tests/view/69479d303c8768ca45072446

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

Bench: 2442415
2025-12-28 14:49:19 +01:00
Taras VukandDisservin c475024be7 Incorporate statscore into history bonus
Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 80128 W: 20879 L: 20498 D: 38751
Ptnml(0-2): 274, 9318, 20496, 9705, 271
https://tests.stockfishchess.org/tests/view/6945d11f3c8768ca45072218

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 134298 W: 34497 L: 33983 D: 65818
Ptnml(0-2): 81, 14334, 37812, 14834, 88
https://tests.stockfishchess.org/tests/view/6947bf033c8768ca45072491

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

Bench: 2325401
2025-12-23 21:42:45 +01:00
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