Commit Graph
7041 Commits
Author SHA1 Message Date
anematodeandDisservin c41c9bb973 Add -fno-ipa-cp-clone on GCC
Passed non-regression STC at
tests.stockfishchess.org/tests/view/69c9b8c3a54395a761335044 (set to
gainer bounds, *mea culpa*)

There's a major performance penalty when compiling the fish with GCC 16.
@Torom 's measurements (similar to mine, but more precise):

```
GCC 15 (master) vs. 16 (master)
sf_base =  2549174 +/-   2984 (95%)
sf_test =  2435456 +/-   2239 (95%)
diff    =  -113718 +/-   3599 (95%)
speedup = -4.46100% +/- 0.141% (95%)

GCC 15 (master) vs. 16 (patch)
sf_base =  2544107 +/-   3091 (95%)
sf_test =  2568837 +/-   3164 (95%)
diff    =    24729 +/-   4359 (95%)
speedup = 0.97204% +/- 0.171% (95%)
```

Based on looking at the disassembly + profiling data of the builds, the
root cause appears to be overly aggressive code duplication from
constant propagation of various functions especially in `search.cpp`.
The worst offender is `Worker::search`, which I think is being cloned
and optimized based on the value of `cutNode`. `perf stat` indicates
that the instruction cache miss rate goes up by ~50% on the GCC 16
build.

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

No functional change
2026-04-02 20:32:34 +02:00
anematodeandDisservin 347fcaa392 Stack allocate NNUE buffer
Passed simp STC

LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 29632 W: 7772 L: 7552 D: 14308
Ptnml(0-2): 76, 3155, 8147, 3349,

Id expect there to be a small speedup (bc the compiler can skip some
stores) but i haven’t tried to measure it

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

No functional change
2026-04-02 20:30:44 +02:00
mstemberaandDisservin 7926f16ea7 Minor cleanups
closes https://github.com/official-stockfish/Stockfish/pull/6685

No functional change
2026-04-02 20:30:33 +02:00
anematodeandDisservin 8132dbcb5a split affine_transform on VNNI as well
```
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 184544 W: 47990 L: 47474 D: 89080
Ptnml(0-2): 551, 20238, 50206, 20698, 579
```

Torom measured

```
sf_base =  2538696 +/-   2915 (95%)
sf_test =  2546510 +/-   3011 (95%)
diff    =     7814 +/-   4146 (95%)
speedup = 0.30782% +/- 0.163% (95%)
```

I get something similar. The benefit would be larger if we ever decide
to further increase the L2 size I think

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

No functional change
2026-04-02 20:30:33 +02:00
Linmiao XuandDisservin f614ff90e2 Neon dotprod speedup in sparse-input affine transform
Also apply VNNI accumulator splitting strategy to NEON dotprod.

Speedup measured locally with profile-build, apple-silicon M3 Pro:
```
Result of  20 runs
==================
base (...kfish-master) =    1582485  +/- 12985
test (...parse-affine) =    1605204  +/- 13801
diff                   =     +22720  +/- 1212

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

CPU: 11 x arm
Hyperthreading: off
```

Passed STC:
https://tests.stockfishchess.org/tests/view/69c04c71f690a4b7f5fb0cde
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 80576 W: 20748 L: 20391 D: 39437
Ptnml(0-2): 161, 8472, 22658, 8843, 154

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

No functional change
2026-04-02 20:30:26 +02:00
Robert Nurnberg @ elitebookandDisservin b9f3273af1 Align ponder move and final PV output
In master for various reasons the given ponder move may get out of sync
with (the second move of) the last PV sent to the GUI:
1. If a ponder move is extracted from the TT despite bestmove leading to
a game ending draw.
2. If a ponder move is extracted from the TT from a fail high/low, since
after the ponder move extraction no new PV is sent to the GUI.
3. If `syzygy_extend_pv()` from within the call to `pv()` changes the PV
after the ponder move has been selected.
4. If the PV roll-back to protect mated-in scores differs in the second
move from the final PV sent to the GUI.

This PR keeps ponder move and the last printed PV in sync.

Fixes #6676.

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

No functional change
2026-04-02 20:30:12 +02:00
anematodeandDisservin d173a0655d Speedup splat_moves on avx512icl
STC
```
LLR: 5.45 (-2.94,2.94) <0.00,2.00>
Total: 612192 W: 158602 L: 157260 D: 296330
Ptnml(0-2): 1634, 67783, 166027, 68911, 1741
```

@Torom measured:
```
sf_base =  2380902 +/-   1016 (95%)
sf_test =  2391426 +/-   1065 (95%)
diff    =    10524 +/-   1336 (95%)
speedup = 0.44203% +/- 0.056% (95%)
```

I've verified that `_mm512_slli_epi16(v, 0)` gets optimized out in GCC
9+ and clang 4+. Added constants to types.h so that people messing
around with the layout of `Move` don't have to know about this part of
the code.

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

No functional change
2026-03-18 20:49:20 +01:00
FauziAkramandDisservin add173263d VVLTC Tune
Passed VVLTC with stc bounds:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 69810 W: 18119 L: 17814 D: 33877
Ptnml(0-2): 6, 6222, 22144, 6527, 6
https://tests.stockfishchess.org/tests/view/69b43f666c456d3a77a50a5d

Passed VVLTC with ltc bounds:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 52458 W: 13574 L: 13258 D: 25626
Ptnml(0-2): 5, 4632, 16636, 4954, 2
https://tests.stockfishchess.org/tests/view/69b16dfbd0c9228834e88e99

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

Bench: 3164843
2026-03-18 20:49:06 +01:00
Robert Nurnberg @ elitebookandDisservin 67a2c247d4 Improve multi-threaded go-mate searches
Ever since #5094 master only lets the main thread terminate `go mate`
searches, reverting the earlier improvement #1215.

This PR restores the old logic. So any thread that found a "mate in x"
can now stop the search.

To make this work robustly, we need to guard against inexact mate scores
in the best thread selection. In addition, in contrast to time limits,
the main thread may now not complete a d1 search for a mated-in
position.
In master an aborted d1 search may have a PV beginning with
`Move::none()`, in which case no thread selection is performed. See
#623. We fix this bug here by checking if `lastBestPV` is empty or not.
For interrupted d1 searches we now label mated-in scores as inexact.

While at it, we also simplify the logic for detecting if we can
terminate a go mate x search, using the fact that threads.stop can only
be false if we have a completed iteration with a valid score.

The PR has no effect on game play, but should slightly improve general
mate finding and speed up multi-threaded `go mate` searches.

We also add a corresponding matecheck run to the CI. This only involves
61 mates up to mate-in-2. Test runs with the first 50 or 100 mates from
`mates2000.epd` did at times not finish within 30 minutes on my fork or
in local tests, possibly due to search explosions for some mate-in-3
positions.

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

No functional change
2026-03-18 20:49:06 +01:00
Pieter te BrakeandDisservin e093339c2f Use existing function for removing and placing a piece.
Passed non-regression STC:
```
LLR: 3.33 (-2.94,2.94) <-1.75,0.25>
Total: 359712 W: 93077 L: 93175 D: 173460
Ptnml(0-2): 1088, 39816, 98144, 39722, 1086
```
https://tests.stockfishchess.org/tests/view/69af5e9a6b61ccc788710e31

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

No functional change
2026-03-18 20:49:06 +01:00
Tomasz SobczykandDisservin e38f5b2f53 Strict FEN parsing. Exit on setting invalid position via UCI.
fixes #6663, #6664, and a million others issues raised over the years.

This is similar to
https://github.com/official-stockfish/Stockfish/pull/4563/changes but
more conservative and errors are split between "Unsupported position"
and "Invalid FEN".

The FEN parser needs to be strict as a foundation for safety. It does
not specify much of the semantics, so this step is fairly simple. Parts
after the ep square are optional, however, since it's common, for
example in EPD notation.

Errors arising from positional semantics that were previously bucketed
under invalid FENs are now reported as "Unsupported position". Only
positions that are potentially problematic are designated as
unsupported. It is NOT guided by illegality of the position, but instead
by the ability of the engine to handle them correctly. This means that
some checks from the previous PR were removed.

std::exit is used instead of std::terminate so atexit handles will be
called.

Probably wise to run copilot on this or smth because I scribbled it
without much thought.

With these small changes and reduced, less controversial, scope I hope
this PR will finally make it and we will be done with these weekly
issues. I'll wait with putting it on fishtest until there's approval.

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

No functional change
2026-03-18 20:49:06 +01:00
Disservin 415f2ef11c Don't recompile misc.cpp on every run
alternative to https://github.com/official-stockfish/Stockfish/pull/6660

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

No functional change
2026-03-18 20:49:06 +01:00
MARLIN-ToolsandDisservin 3c04b5c429 Fix Depth 1 bug at very low time controls, some fishtesting workers, and delayed move senders like Arena.
Non-Regression STC:

LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 98208 W: 25423 L: 25276 D: 47509
Ptnml(0-2): 271, 10713, 26994, 10850, 276
https://tests.stockfishchess.org/tests/view/69ad43c21d849c824c6afe82

-

Hell VVSTC (0.2+0.02)
LLR: 2.70 (-2.94,2.94) <0.00,2.00>
Total: 688 W: 660 L: 11 D: 17
Ptnml(0-2): 1, 0, 10, 15, 318
https://tests.stockfishchess.org/tests/view/69ae4bea1d849c824c6b00b0

-

Sudden Death (1+0)

LLR: 2.19 (-2.94,2.94) <-1.75,0.25>
Total: 538 W: 536 L: 0 D: 2
Ptnml(0-2): 0, 0, 0, 2, 267
https://tests.stockfishchess.org/tests/live_elo/69ae6c031d849c824c6b00dc

-

Sudden Death (5+0)

LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 22248 W: 6058 L: 5802 D: 10388
Ptnml(0-2): 214, 2420, 5583, 2710, 197
https://tests.stockfishchess.org/tests/view/69ae6dd01d849c824c6b00ee

-

Fixes #6639

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

No functional change
2026-03-18 20:49:06 +01:00
Ryan HirschandDisservin 8b49968386 Speed up update_accumulator_refresh_cache with AVX512ICL
Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 212960 W: 55550 L: 54991 D: 102419
Ptnml(0-2): 583, 23688, 57393, 24219, 597
https://tests.stockfishchess.org/tests/view/69ab916ccb31ee884aed62ea

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

No functional change
2026-03-18 20:49:06 +01:00
ZlomenyMesicandDisservin e20ef7ed12 Disable IIR and quiet shallow pruning in PV lines
Disable IIR and quiet shallow pruning in nodes that are part of the PV
line from the previous search iteration. This is done by storing the PV
in Worker and adding a followPV flag to Stack. The new flag may also be
used in other pruning techniques, allowing further improvement.

Passed STC:
```
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 63776 W: 16679 L: 16323 D: 30774
Ptnml(0-2): 169, 7441, 16377, 7667, 234
```
https://tests.stockfishchess.org/tests/view/69aad1a7d0f65de95886e289

Passed LTC:
```
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 87342 W: 22421 L: 22000 D: 42921
Ptnml(0-2): 40, 9443, 24299, 9834, 55
```
https://tests.stockfishchess.org/tests/view/69ab5993cb31ee884aed629d

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

Bench: 2434614
2026-03-18 20:49:06 +01:00
anematodeandJoost VandeVondele b3a810a1c4 Fix avx512icl update_piece_threats bug
Thanks to MinetaS for discovering this and finding the culprit commit,
specific to this architecture. 9f42980 was subtly incorrect, leading to
spurious wrong benches on avx512icl. Because this piece of code has twice been
the source of wrong benches, I also added a brief comment explaining why it
needs to be this way, and added a sample position to bench.

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

Bench: 2288704
2026-03-07 22:28:06 +01:00
Shawn XuandJoost VandeVondele 2907ee1a90 Requantize smallnet to nn-47fc8b7fff06.nnue
Passed Non-regression STC:
LLR: 3.01 (-2.94,2.94) <-1.75,0.25>
Total: 340384 W: 88165 L: 88274 D: 163945
Ptnml(0-2): 1145, 40248, 87571, 40027, 1201
https://tests.stockfishchess.org/tests/view/69a4c49ab4a714eaaa196bc0

Passed Non-regression LTC:
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 125922 W: 32222 L: 32106 D: 61594
Ptnml(0-2): 100, 13815, 35002, 13957, 87
https://tests.stockfishchess.org/tests/view/69a9d5f489704e42c5e3a35d

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

Bench: 2171643
2026-03-07 22:20:46 +01:00
8b6d8def30 Counter-Move History Continuity (CMHC)
Currently, the engine updates each level of the continuation history stack (ply -1, -2, -3, etc.) with fixed weights that are independent of one another. The idea behind CMHC is to scale the magnitude of these updates based on the consistency of the move's performance across the stack.
By tracking how often a move has historically performed well (positive history) within the current continuation context, we can adjust the update magnitude dynamically. Moves that demonstrate "continuity" (appearing as strong candidates across multiple historical contexts) receive more significant updates, while unproven or inconsistent moves are dampened.

Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 103264 W: 26954 L: 26541 D: 49769
Ptnml(0-2): 338, 11910, 26728, 12313, 343
https://tests.stockfishchess.org/tests/view/69a81702fac54339cf435a87

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 47406 W: 12259 L: 11920 D: 23227
Ptnml(0-2): 22, 5052, 13237, 5349, 43
https://tests.stockfishchess.org/tests/view/69aab480bd35724e4b290498

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

Bench: 2356418

Co-Authored-By: Daniel Samek <samekdaniel@email.cz>
2026-03-07 22:16:22 +01:00
Shawn XuandJoost VandeVondele 868b63d421 Update main network to nn-9a0cc2a62c52.nnue
network with new hash encoding.

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

no functional change
2026-03-07 22:12:51 +01:00
Robert Nurnberg @ elitebookandJoost VandeVondele 82320c0e38 [CI] add multithreaded matetrack runs that simulate gameplay
closes https://github.com/official-stockfish/Stockfish/pull/6641

No functional change
2026-03-07 22:10:14 +01:00
maximmasiutinandJoost VandeVondele 702d4b8c9d Simplify attackers_to_exist function
test based on #6586 by maximmasiutin

https://tests.stockfishchess.org/tests/view/69977d58e2562aa5bc1e09c4
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 225056 W: 58208 L: 58195 D: 108653
Ptnml(0-2): 677, 25001, 61196, 24940, 714

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

No functional change
2026-02-28 12:10:50 +01:00
anematodeandJoost VandeVondele 4c0878cb0b skip setting threatByLesser[KING]
It doesn't make sense for a king to move to a square threatened by a lesser
piece, since that move would be illegal.

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

No functional change
2026-02-28 12:07:38 +01:00
mstemberaandJoost VandeVondele bc28ff15bd Simplify threat by lesser
STC https://tests.stockfishchess.org/tests/view/699da988eaae015cd278ede4
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 141184 W: 36647 L: 36541 D: 67996
Ptnml(0-2): 511, 16620, 36237, 16700, 524

LTC https://tests.stockfishchess.org/tests/view/699f4bee2be03365d5073c71
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 99852 W: 25463 L: 25322 D: 49067
Ptnml(0-2): 47, 10997, 27721, 11090, 71

Removes a constant and a branch(for the price of a subtract) and treats the
from and to squares symmetrically.

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

bench: 2460547
2026-02-28 12:06:39 +01:00
ByteBufandJoost VandeVondele b6769f101c CI: Fix typo in error message
closes https://github.com/official-stockfish/Stockfish/pull/6624

No functional change
2026-02-28 12:00:08 +01:00
Ryan HirschandJoost VandeVondele 0571e4e390 More NMP when improving
Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 89472 W: 23291 L: 22895 D: 43286
Ptnml(0-2): 317, 10389, 22942, 10757, 331
https://tests.stockfishchess.org/tests/view/699f070c3ece4c464328a26f

Passed LTC:
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 95880 W: 24537 L: 24098 D: 47245
Ptnml(0-2): 55, 10259, 26880, 10684, 62
https://tests.stockfishchess.org/tests/view/699fb9be44b9136df1165ded

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

bench: 2534375
2026-02-28 11:58:49 +01:00
Robert NurnbergandJoost VandeVondele 46ac9a7e6a prevent unproven mated-in scores in game play
This PR removes the variable threads.abortedSearch introduced in #4990 and
relies on threads.stop and completedDepth instead.

The logic in master is only guaranteed to work in single threaded search. For
multiple threads, as soon as threads.stop is set, some of the threads may abort
their search, and so their mated-in scores are not reliable.

Compared to master, this patch prevents unproven mated-in scores in these
multi-threaded scenarios:

    in game play (when time management is used)
    when the uci commands quit or stop are received
    when maximum depth is reached
    for go mate commands

The patch will change the bestmove in those very rare situations where the bug
occurs in master. This is because bestmove is taken from rootMoves[0].pv[0],
which will now no longer contain unproven mated-in PVs. In that sense the patch
is "functional". But of course, it does not change bench.

While at it, we also fix a bug in master that suppressed PV output for inexact
mated-in scores on receiving threads.stop. In cases where uciScore < score with
score not being a proven loss, and where the new bestmove was different from
the last completed iteration, this led to a bestmove output that did not match
the final PV (which was for an exact score).

Fixes #6293.

Fixes #6626.

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

No functional change
2026-02-28 11:55:03 +01:00
sscg13andJoost VandeVondele a6d055d7e2 Update NNUE architecture to SFNNv13 and net nn-5227780996d3.nnue
Since the introduction of Threat Inputs in SFNNv10 and its refinements, the
accumulator/L1 size has significantly decreased. This has made it more
computationally favorable to double the L2 size from 16 to 32.

Failed STC:
LLR: -2.98 (-2.94,2.94) <0.00,2.00>
Total: 189184 W: 49649 L: 49635 D: 89900
Ptnml(0-2): 881, 22479, 47812, 22585, 835
https://tests.stockfishchess.org/tests/view/69928ef7bfe62dc95a624d5c

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 37902 W: 9833 L: 9509 D: 18560
Ptnml(0-2): 35, 4074, 10408, 4400, 34
https://tests.stockfishchess.org/tests/view/69937936ff782f8eeef611e3

Passed VLTC SMP:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 20576 W: 5455 L: 5191 D: 9930
Ptnml(0-2): 6, 1837, 6338, 2101, 6
https://tests.stockfishchess.org/tests/view/6994df0586e4a32314116399

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

bench: 2396996
2026-02-18 21:46:57 +01:00
mstemberaandJoost VandeVondele ba852999ff Minor cleanups in bitboard.h
closes https://github.com/official-stockfish/Stockfish/pull/6618

No functional change
2026-02-18 21:44:20 +01:00
mstemberaandJoost VandeVondele 84bdf5e2a6 Don't process kings after #6609
https://github.com/official-stockfish/Stockfish/pull/6617

No functional change
2026-02-18 21:40:01 +01:00
rn5f107s2andJoost VandeVondele 5b5986b095 Add en passant santization tests to the CI and pos is ok
closes https://github.com/official-stockfish/Stockfish/pull/6615

No functional change
2026-02-18 21:39:06 +01:00
cf559b2c17 speed up update_piece_threats after SFNNv12
with the removal of all king-related threats in SFNNv12 we can avoid some work in update_piece_threats

STC for anematode's swan:
https://tests.stockfishchess.org/tests/view/6986b920b0f3ca5200aaf80a
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 262880 W: 68379 L: 67747 D: 126754
Ptnml(0-2): 808, 29001, 71223, 29567, 841

STC of further speedups on top of swan:
https://tests.stockfishchess.org/tests/view/698d7f8362a8f472da3a8a35
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 65920 W: 17126 L: 16781 D: 32013
Ptnml(0-2): 186, 7084, 18105, 7369, 216

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

No functional change

Co-Authored-By: Timothy Herchen <timothy.herchen@gmail.com>
2026-02-18 05:58:44 +01:00
FauziAkramandJoost VandeVondele e6d04b4ec5 VVLTC tune
Passed VVLTC with stc bounds:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 21424 W: 5638 L: 5387 D: 10399
Ptnml(0-2): 2, 1925, 6607, 2176, 2
https://tests.stockfishchess.org/tests/view/69938fbcff782f8eeef612a9

Passed VVLTC with ltc bounds:
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 33410 W: 8784 L: 8499 D: 16127
Ptnml(0-2): 5, 2968, 10474, 3253, 5
https://tests.stockfishchess.org/tests/view/69923ea872254723ef22c6fa

Verify Elo loss at STC:
LLR: -2.93 (-2.94,2.94) <-1.75,0.25>
Total: 17504 W: 4420 L: 4704 D: 8380
Ptnml(0-2): 56, 2259, 4420, 1947, 70
https://tests.stockfishchess.org/tests/view/69946e4186e4a3231411625b

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

bench: 3074962
2026-02-18 05:54:55 +01:00
Daniel MonroeandJoost VandeVondele 77d46ff61c Simplify probCutDepth term
Passed STC
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 139392 W: 36003 L: 35897 D: 67492
Ptnml(0-2): 451, 16383, 35911, 16511, 440
https://tests.stockfishchess.org/tests/view/697ebb4d5f56030af97b5aa5

Passed LTC
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 266934 W: 67822 L: 67851 D: 131261
Ptnml(0-2): 175, 29579, 73955, 29616, 142
https://tests.stockfishchess.org/tests/view/6980e5a26362aee5c8a55398

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

Bench: 2515956
2026-02-13 07:22:36 +01:00
Daniel MonroeandJoost VandeVondele 91c6ea82aa Simplify malus formula
Passed non-regression STC
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 51936 W: 13490 L: 13283 D: 25163
Ptnml(0-2): 161, 6128, 13184, 6333, 162
https://tests.stockfishchess.org/tests/view/698120e06362aee5c8a55412

Passed non-regression LTC
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 233772 W: 59502 L: 59499 D: 114771
Ptnml(0-2): 144, 25753, 65086, 25762, 141
https://tests.stockfishchess.org/tests/view/69827426889c3a4c31c8db52

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

bench 2739355
2026-02-13 07:15:35 +01:00
Daniel MonroeandJoost VandeVondele 89b4f457e0 Simplify malus decay formula
Passed non-regression STC
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 93600 W: 24165 L: 24007 D: 45428
Ptnml(0-2): 325, 11021, 23958, 11163, 333
https://tests.stockfishchess.org/tests/view/698121d46362aee5c8a55414

Passed non-regression LTC
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 83232 W: 21236 L: 21077 D: 40919
Ptnml(0-2): 46, 9147, 23083, 9282, 58
https://tests.stockfishchess.org/tests/view/698336dc473df9d1d24a90e8

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

Bench: 2666284
2026-02-13 07:12:04 +01:00
anematodeandJoost VandeVondele b808fd3d55 avoid modify_and_replicate for first load
We call modify_and_replicate in load_networks, but this is quite inefficient.

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

No functional change
2026-02-13 07:06:33 +01:00
lemteayandJoost VandeVondele b248d689a8 Add constexpr specifier back to conthist_bonuses
Passed STC
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 60288 W: 15668 L: 15331 D: 29289
Ptnml(0-2): 159, 6490, 16532, 6781, 182
https://tests.stockfishchess.org/tests/view/698c835762a8f472da3a88e1

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

No functional change
2026-02-13 07:03:17 +01:00
Maxim MasiutinandJoost VandeVondele 238ef05bb0 Prefetch threat weight rows during append_changed_indices
Passed STC (first run):
https://tests.stockfishchess.org/tests/view/698030ee6362aee5c8a552c7
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 120800 W: 31336 L: 30912 D: 58552
Ptnml(0-2): 330, 13084, 33172, 13460, 354

Passed LTC:
https://tests.stockfishchess.org/tests/view/6983946d473df9d1d24a916d
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 86850 W: 22352 L: 21951 D: 42547
Ptnml(0-2): 45, 8506, 25934, 8883, 57

Passed STC SMP (after changes made after opening the PR):
https://tests.stockfishchess.org/tests/view/6987b4c1b0f3ca5200aaf9da
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 84480 W: 21994 L: 21627 D: 40859
Ptnml(0-2): 98, 9378, 22932, 9723, 109

Passed STC (second run, as a sanity check made after changes made after opening the PR -- these changed, however, didn't change assembly code produced by the compiler):
https://tests.stockfishchess.org/tests/view/6987ad21b0f3ca5200aaf9c9
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 132192 W: 34526 L: 34083 D: 63583
Ptnml(0-2): 421, 14511, 35759, 15014, 391

GCC maps __builtin_prefetch locality=1 to PREFETCHT2 instruction, targeting L2
cache. To make things clear, added template-based approach as suggested by
Disservin.

PREFETCHT2 should be the appropriate choice for the 78 MB threat weight table:
avoids L1d pollution, parks data in L2 where it is promoted to L1d on actual
load.

With 200-500 cycle lead time from make_index, data has time to arrive in L2.

suggestions by Disservin and anematode included

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

No functional change
2026-02-13 07:01:15 +01:00
Joost VandeVondele 99221e5ee6 Introduce timeout for wget/curl in net download
ensures the download terminates after 5min, even if the server stalled.

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

No functional change
2026-02-13 06:57:08 +01:00
sscg13andJoost VandeVondele 83e42045a6 Update NNUE architecture to SFNNv12 and net nn-7e1657811c6d.nnue
This net is trained with https://github.com/sscg13/nettest/blob/no-king-attacker/threats.yaml.

Passed non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 92640 W: 24371 L: 24209 D: 44060
Ptnml(0-2): 389, 11047, 23322, 11137, 425
https://tests.stockfishchess.org/tests/view/6986345fa259e26d2c32e9c5

Passed non-regression LTC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 198636 W: 50960 L: 50919 D: 96757
Ptnml(0-2): 176, 22218, 54511, 22215, 198
https://tests.stockfishchess.org/tests/view/6987ee29b0f3ca5200aafa51

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

bench: 2465828
2026-02-13 06:56:10 +01:00
Daniel MonroeandDisservin 21b0974f8d Simplify away main history default
Passed non-regression STC
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 130752 W: 33725 L: 33605 D: 63422
Ptnml(0-2): 421, 15472, 33460, 15612, 411
https://tests.stockfishchess.org/tests/view/697eb9e35f56030af97b5a9e

Passed non-regression LTC
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 53352 W: 13697 L: 13509 D: 26146
Ptnml(0-2): 36, 5804, 14811, 5986, 39
https://tests.stockfishchess.org/tests/view/6980e5846362aee5c8a55396

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

Bench: 2375860
2026-02-08 15:22:29 +01:00
Dieter DobbelaereandDisservin 6b6334ce8e Replace FNV-1a hash by faster and better MurmurHash64A.
Replace FNV-1a hash algorithm by public domain MurmurHash64A, by Austin
Appleby, which is faster and has better hash properties. This is also
the default hash algorithm of GNU C++ Standard Library.

Startup time on a given system (with x86-64-avx2 binaries) reduces from
378ms to 332ms (46ms faster). Hashing of the largest data input (46.1MB)
goes from 44.2ms to 6.2ms, so about 7x faster.

No functional change

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

Bench: 2570943
2026-02-08 15:22:21 +01:00
lemteayandDisservin 005f0f9b2a Raise inline threshold for clang/llvm
Passed STC:
https://tests.stockfishchess.org/tests/view/696884a56d118e46e1731473
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 29952 W: 7843 L: 7549 D: 14560
Ptnml(0-2): 72, 3215, 8118, 3489, 82

.text area size:
```
master(eb5a65a): 455490
pr:              453250
```

Bench (clang 21.1.8):
```
Result of 100 runs
==================
base (...kfish-master) =    1719708  +/- 3473
test (./stockfish    ) =    1770555  +/- 3284
diff                   =     +50846  +/- 3949

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

CPU: 16 x AMD Ryzen 9 7945HX with Radeon Graphics
Hyperthreading: on
```

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

No functional change
2026-02-08 15:22:06 +01:00
FauziAkramandDisservin f0d0c3ddd2 Simplify Triple Margin Formula
Passed STC:
LLR: 3.01 (-2.94,2.94) <-1.75,0.25>
Total: 517472 W: 133271 L: 133575 D: 250626
Ptnml(0-2): 1628, 61366, 133032, 61102, 1608
https://tests.stockfishchess.org/tests/view/69590175d844c1ce7cc7e9a2

Passed LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 95430 W: 24242 L: 24098 D: 47090
Ptnml(0-2): 42, 10289, 26926, 10399, 59
https://tests.stockfishchess.org/tests/view/695f7f03ca95f52e4b85253c

Passed VVLTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 58828 W: 15299 L: 15135 D: 28394
Ptnml(0-2): 4, 5277, 18687, 5443, 3
https://tests.stockfishchess.org/tests/view/6961686c8709a8d27c0383f6

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

Bench: 2570943
2026-02-08 15:22:06 +01:00
Jakub CiolekandDisservin 73475b198d Remove prefetching in Position::do_null_move
Passed non-regression STC, Hash=16:

LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 60704 W: 15709 L: 15522 D: 29473
Ptnml(0-2): 169, 6589, 16649, 6776, 169
https://tests.stockfishchess.org/tests/view/6963d381f6d2e8deff76918f

Passed non-regression STC SMP, Hash=512:

LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 313512 W: 80151 L: 80231 D: 153130
Ptnml(0-2): 376, 35492, 85111, 35390, 387
https://tests.stockfishchess.org/tests/view/696e1684e5a70879bd3fe38f

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

No functional change
2026-02-08 15:22:06 +01:00
ppigazziniandDisservin e3a5c40f05 feat(build): use lld for clang if available
Also simplify the CI.

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

No functional change
2026-02-08 15:22:06 +01:00
mstemberaandDisservin 3cde1560f6 Minor fixes for MSVC
closes https://github.com/official-stockfish/Stockfish/pull/6596

No functional change
2026-02-08 15:22:06 +01:00
DisservinandTimothy Herchen bfeb36eb3d Fix Strict Aliasing Violation
Even though this failed with non regression bounds on fishtest, merging
it as is to improve the current situation.

Failed Non Regression:
https://tests.stockfishchess.org/tests/view/6988814db0f3ca5200aafb50
LLR: -2.94 (-2.94,2.94) <-1.75,0.25>
Total: 185792 W: 48109 L: 48565 D: 89118
Ptnml(0-2): 553, 21228, 49811, 20730, 574

Previously we had code similar to this
```
alignas(64) std::uint8_t foo[1024];
const auto* int_ptr = reinterpret_cast<const std::int32_t*>(foo);
```

Which is a strict aliasing violation once we dereference int_ptr, which
invokes UB and causes newer gcc version to emit incorrect code.

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

This violation was introduced in PR #3287 and merged in commit 23c385e.
Due to aggressive compiler optimizations, users may need to include
CXXFLAGS=-fno-strict-aliasing as a build argument to ensure a correctly
functioning binary.

Also thanks to @anematode for writing parts of this and realizing this
strict aliasing violation.

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

Bench: 2668754

Co-Authored-By: Timothy Herchen <timothy.herchen@gmail.com>
2026-02-08 15:20:42 +01:00
sscg13andJoost VandeVondele fac506bdf3 Update NNUE architecture to SFNNv11 and net nn-3dd094f3dfcf.nnue
Removes threat features of the form piece -> king, thus saving 13MB of net
space and approximately 0.8 threat feature updates per incremental accumulator
update.

Passed non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 33664 W: 8864 L: 8636 D: 16164
Ptnml(0-2): 136, 3926, 8501, 4112, 157
https://tests.stockfishchess.org/tests/view/6981dcda4776a4e6e7fef2ac

Passed non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 46896 W: 12077 L: 11881 D: 22938
Ptnml(0-2): 41, 5118, 12924, 5334, 31
https://tests.stockfishchess.org/tests/view/69827c6beb87369ff4d0c7d5

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

bench: 2668754
2026-02-04 18:26:28 +01:00
Pieter te BrakeandJoost VandeVondele 24af6a6bc4 Update castling rights unconditionally.
passed STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 163680 W: 42214 L: 42137 D: 79329
Ptnml(0-2): 454, 18054, 44734, 18157, 441
https://tests.stockfishchess.org/tests/view/697e6f4e5f56030af97b5a3c

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

No functional change
2026-02-04 18:22:07 +01:00