170 Commits
Author SHA1 Message Date
ConKirbyandJoost VandeVondele ca11d43709 Remove dead code left over from earlier refactors
The following have zero references repo-wide:

    Move::to_sq_unchecked() (types.h): added in 542c30c2 for a
    branchless correction-history update; its only caller was removed
    in 5ae13d2b ("Remove Redundant Branchless Execution"), leaving the
    method unused.

    PipeDeleter (misc.h): the custom deleter for the std::unique_ptr<FILE,
    PipeDeleter> that wrapped popen("lscpu"). That pipe was removed in
    c8375c2f ("On linux use sysfs instead of lscpu"), so the struct has
    been unused since.

Dropping PipeDeleter also removes the last user of <cstdio> in misc.h, so that include is dropped as well.

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

No functional change
2026-07-16 08:16:29 +02:00
Joost VandeVondele 9a8dd81dd7 Revert "Scale Null Move Pruning reduction"
This reverts commit 9d4090e826.

causes very poor mate finding performance, ultimately causing a CI hang on a mate in 2

Testcase:

position fen k1B5/2p5/NbN5/P7/3p4/P2p4/P1prp3/2RbK3 b - - 0 1 setoption name Hash value 16
setoption name Threads value 4
go mate 2
ucinewgame

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

Bench: 2466447
2026-07-11 20:35:40 +02:00
ayushthepiro11andJoost VandeVondele 9d4090e826 Scale Null Move Pruning reduction dynamically based on evaluation margin
This patch introduces a dynamic scaling factor for Null Move Pruning (NMP) reductions. By scaling the reduction depth relative to the static evaluation margin against beta, the engine can afford more aggressive reductions in positions that are overwhelmingly favorable, optimizing CPU cycle utilization without compromising search integrity.

Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 85504 W: 22383 L: 22000 D: 41121
Ptnml(0-2): 225, 9855, 22218, 10220, 234
https://tests.stockfishchess.org/tests/view/6a4793daf97ff95f78795812

Passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 205800 W: 53879 L: 53224 D: 98697
Ptnml(0-2): 98, 21747, 58561, 22390, 104
https://tests.stockfishchess.org/tests/view/6a4b864ff97ff95f78795e52

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

Bench: 2513153
2026-07-10 20:19:02 +02:00
Miloslav MacůrekandJoost VandeVondele 9700f6f206 Fix crash with UCI_LimitStrength and tablebases at the root
`Skill::pick_best()` assumes the root moves are sorted by score in descending order:

```cpp
Value topScore = rootMoves[0].score;
int   delta    = std::min(topScore - rootMoves[multiPV - 1].score, int(PawnValue));
```

That does not have to be so with Syzygy tablebases at the root, where the moves are ordered by `tbRank` instead. `rootMoves[0]` is then not the highest score and `delta` can go negative. Since `delta * (rng.rand<unsigned>() % int(weakness))` is evaluated as unsigned, a negative `delta` wraps to a large value and the `int(...)` cast overflows, so the `score + push >= maxScore` check never passes and `best` stays `Move::none()`. The caller

```cpp
std::swap(rootMoves[0],
          *std::find(rootMoves.begin(), rootMoves.end(),
                     skill.best ? skill.best : skill.pick_best(rootMoves, multiPV)));
```

then dereferences `end()`. The result is a crash, or sometimes `bestmove (none)` / an illegal move, in tablebase endgames when `UCI_LimitStrength` is set (or `Skill Level` is below 20).

The fix computes the score range over the candidate moves directly, so `delta` stays non-negative and a valid move is always returned.

**To reproduce**:
```
setoption name UCI_LimitStrength value true
setoption name UCI_Elo value 2900
setoption name SyzygyPath value <syzygy tablebases path>
position fen 8/8/8/4k3/8/8/3BKN2/8 b - - 0 1
go wtime 250 btime 250 winc 100 binc 100
```

You need to call the go command a couple of times before crash, after which is ends with

```
bestmove a1e5 ponder (none)
```

and on the next `go wtime 250 btime 250 winc 100 binc 100` it crashes printing:

```
info string Available processors: 0-31
info string Using 1 thread
info string NNUE evaluation using nn-af1339a6dea3.nnue (106MiB, (83248, 1024, 31, 32, 1))
info string Network replica 1: Shared memory.
```

Bench is unchanged, since this code only runs under `UCI_LimitStrength` / `Skill Level`.

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

No functional change
2026-07-10 20:17:23 +02:00
Robert NurnbergandJoost VandeVondele 48a9118251 Minor cleanups June 2026
In the spirit of previous such PRs, this PR proposes a collection of nonfunctional changes.

I am happy to incorporate changes from other devs, and revert some of the proposed changes if the maintainers ask me to.

Apart from trivial changes, the proposed changes so far include:

* A requested edit to `AUTHORS` and a resorting of all entries, following DIN 5007 for the treatment of any special characters.
* Exclude the two recent integer type renaming commits from git blame.
* Tightening of some static asserts in `history.h` to avoid overflows. (Note that rounding errors for floating point types could lead to the assert in `operator<<` triggering at run-time.)
* Re-instate the 0.5s maximal thinking time in case of a single legal move and reword the comment to make it clear that it should not be tuned.
* ~~A small refactoring of the network loading code thanks to @dubslow.~~
* A refactoring of the "dtz is dtm" code, also thanks to @dubslow.

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

No functional change
2026-07-10 20:12:38 +02:00
MFWandJoost VandeVondele 46428b9346 Allow cross-compilation of Android version on Mac
When compiling for Android (COMP=ndk) on macOS, the build fails because the
NDK's LLVM toolchain does not recognize the macOS-specific flags
-mdynamic-no-pic and -mmacosx-version-min.

This PR wraps these flags with ifneq ($(COMP),ndk) condition to skip them
during Android cross-compilation.

Please squash and merge this PR.

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

No functional change
2026-07-03 20:26:34 +02:00
Dalton HanawayandJoost VandeVondele 6f97594eda prefetch the TT entry as soon as the move is known
Worker::do_move computes the successor hash key via the new
Position::key_after(m) and prefetches the TT entry one full do_move
earlier than the existing prefetch in Position::do_move. key_after does
not model castling, en passant or promotion keys exactly; for rare
moves the prefetch lands on an unused line.

`key_after` has been around since 2014 (https://github.com/official-stockfish/Stockfish/commit/82d065b0) and was removed in (https://github.com/official-stockfish/Stockfish/pull/5770). Adding back `prefetch_key` helps in common, normal moves at the cost of extra compute.

Speedup (PGO vs PGO, interleaved paired bench, n=48 pairs, Apple M2
Pro / apple-silicon): +0.69% [0.47, 0.91]

Passed STC:
https://tests.stockfishchess.org/tests/view/6a291f8d7c758d82accea17f
LLR: 4.24 (-2.94,2.94) <0.00,2.00>
Total: 473504 W: 121250 L: 120228 D: 232026
Ptnml(0-2): 1112, 51137, 131251, 52121, 1131

No functional change

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

No functional change
2026-06-25 13:03:44 +02:00
zungurandJoost VandeVondele 5595cb20ea Fix FEN validation of pawns on first or eighth rank
The FEN validation check intended to reject pawns on the first or eighth rank uses the `Rank` enum values in a bitwise OR operation:

`if (pieces(PAWN) & (RANK_1 | RANK_8))`

`RANK_1 | RANK_8` evaluates to the integer `0 | 7 == 7` instead of a bitboard, so the expression only tests squares A1, B1 and C1. As a result, unsupported positions with pawns elsewhere on the first or eighth rank are silently accepted. For instance, `position fen 3P3k/8/8/8/8/8/8/3K4 w - - 0 1` is accepted even though the pawn on d8 makes the position unsupported.

Use the `Rank1BB | Rank8BB` bitboard constants so any pawn on the first or eighth rank are correctly rejected.

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

No functional change
2026-06-10 12:44:57 +02:00
Abdul KhanandJoost VandeVondele 415ff793a0 Fix test harness timeout enforcement
Fixes #6881.

`timeout_decorator()` used a `ThreadPoolExecutor` context manager around blocking output waits. When `future.result(timeout=...)` timed out, leaving the context manager still waited for the worker thread to finish, so a blocked stdout read could keep the instrumented tests hanging past the configured timeout.

This change removes that executor wrapper for interactive Stockfish output waits. The harness now drains process output on a daemon reader thread, queues received lines, and applies the deadline directly while waiting for the next queued line. `TimeoutException` also initializes the base exception message so failures show useful text.

Validation:
- `python3 -m py_compile tests/testing.py tests/instrumented.py`
- local timeout smoke test: a 0.2s no-output wait raises in ~0.204s
- Stockfish smoke test: startup/`uciok` read succeeds, deliberate no-output wait raises in ~0.205s, engine exits 0
- `make -C src -j4 build`
- `../tests/signature.sh` -> `2814421`

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

No functional change
2026-06-09 19:38:00 +02:00
AdrianandJoost VandeVondele 73826352d4 Simplify quiet history update expression
This patch simplifies the quiet history update expression in search.cpp.

The change is behaviour‑identical and removes unnecessary complexity from
the update_quiet_histories call.

Passed STC (non‑regression):
https://tests.stockfishchess.org/tests/view/6a14367b818cacc1db0ac7c3
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 52224 W: 13338 L: 13135 D: 25751
Ptnml(0-2): 118, 6065, 13557, 6240, 132

Passed LTC (non‑regression):
https://tests.stockfishchess.org/tests/view/6a155046818cacc1db0ac94d
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 136812 W: 34689 L: 34586 D: 67537
Ptnml(0-2): 51, 14770, 38668, 14859, 58

Both STC and LTC passed. Patch rebased to latest master.

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

Bench: 2549662
2026-06-06 10:12:36 +02:00
BerektassulyandJoost VandeVondele 8416ccafff fix Makefile universal build selection
and remove armv8 left-over

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

No functional change
2026-06-06 10:01:37 +02:00
tobi437aandJoost VandeVondele 133731f331 Simplify away unused CorrHistType variants
After the introduction of UnifiedCorrectionHistory, the Pawn, Minor and NonPawn entries in CorrHistType are dead - only PieceTo and Continuation are referenced via CorrectionHistory<T>. Drop them, along with the now unreachable default template and the NonPawn specialization. Reduce the primary CorrHistTypedef template to a forward declaration so that any future stray use of an unsupported tag fails to compile.

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

No functional change
2026-05-19 18:42:17 +02:00
Tony WangandJoost VandeVondele 5095cd16c9 Update main network to nn-fcf986aea78a.nnue
Passed STC:
https://tests.stockfishchess.org/tests/view/69ef80071e5788938e86a302
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 32000 W: 8549 L: 8231 D: 15220
Ptnml(0-2): 124, 3717, 8024, 3987, 148

Passed LTC:
https://tests.stockfishchess.org/tests/view/69f046ba1e5788938e86a42f
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 149646 W: 38739 L: 38186 D: 72721
Ptnml(0-2): 119, 16353, 41326, 16906, 119

New trainer:
official-stockfish/nnue-pytorch#430

Recipe:
TonyCongqianWang/nettest@104ed33

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

Bench: 2344696
2026-05-04 08:42:55 +02:00
Ryan LefkowitzandJoost VandeVondele bb5f0100b0 fix syzygy crash on Apple Silicon by unrolling tbprobe adjustment loop
A bit tricky to identify, but in `apple-silicon` builds, specifying a value for
`SyzygyPath` could still lead to crashes at certain depths from a
SIGBUS/SIGSEGV.

This PR replaces the `std::count_if()` adjustment in `tbprobe.cpp`'s
`do_probe_table()` with an annotated handwritten loop, avoiding the clang/LTO
miscompilation behind the crash.

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

No functional change.
2026-04-15 19:05:14 +02: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
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
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
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
Pieter te BrakeandJoost VandeVondele 2321cf2f77 Simplify en passant square update in Position::do_move().
Passed non-regression STC:

LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 119680 W: 31011 L: 30884 D: 57785
Ptnml(0-2): 354, 13231, 32575, 13294, 386
https://tests.stockfishchess.org/tests/view/6973b06c6cd60a8e97ca62e5

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

No functional change
2026-02-04 18:17:23 +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
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
+1 8e5392d79a Update NNUE architecture to SFNNv10 with Threat Inputs and net nn-49c1193b131c.nnue
This commit introduces Full Threat Input features, which are a subset of Piece(Square)-Piece(Square) pairs. In any given position, the active features consist of pairs where the second piece’s square lies in the attack set of the first piece. This is an extremely simplified explanation that leaves out many details. The already-used HalfKAv2_hm feature set completes the input features.
Minor quantization changes have also been made.

The net nn-49c1193b131c.nnue was trained by vondele using the following setup: https://github.com/vondele/nettest/blob/7de71238e9b295e3f88ed7c9c5936af632c9b981/threats.yaml

A graphical version of an earlier scheme (with less refinement) that illustrates the core concepts can be found attached.
[NewInputs.pdf](https://github.com/user-attachments/files/23478441/NewInputs.pdf)

Further information, as well as a brief description of the history of development, can be found attached.
[Stockfish threat inputs PR summary.pdf](https://github.com/user-attachments/files/23478634/Stockfish.threat.inputs.PR.summary.pdf)

This has been a huge effort spanning over half a year, with the original [discussion thread](https://discord.com/channels/435943710472011776/1336647760388034610) reaching over 11k messages. Thanks to everyone who has contributed.

Monty PRs:
https://github.com/official-monty/Monty/pull/87 (Initial threat input PR)
https://github.com/official-monty/Monty/pull/114 (Fixed threat indexing to take into account colour correctly)
https://github.com/official-monty/Monty/pull/116 (i8 quantisation of weights whilst keeping calculations in i16)

Yukari commit:
https://github.com/yukarichess/yukari/commit/2d482c64a79cec03cf4987d5289334b9cdc737bc (Threat inputs merged)

Plentychess PRs:
https://github.com/Yoshie2000/PlentyChess/pull/400 (Threat inputs merged)
https://github.com/Yoshie2000/PlentyChess/pull/411 (Threat input weights quantised to i8)

Passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 63424 W: 16956 L: 16591 D: 29877
Ptnml(0-2): 276, 7522, 15797, 7795, 322
https://tests.stockfishchess.org/tests/view/69105b3dec1d00d2c195c569

Passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 27876 W: 7417 L: 7110 D: 13349
Ptnml(0-2): 23, 3033, 7530, 3318, 34
https://tests.stockfishchess.org/tests/view/6910d817ec1d00d2c195c66e

Passed VVLTC (Hash accidentally set to 1/2 normal value for both sides):
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 12458 W: 3353 L: 3102 D: 6003
Ptnml(0-2): 0, 1106, 3767, 1355, 1
https://tests.stockfishchess.org/tests/view/69115a26ec1d00d2c195c7cd

This version has also passed non-regression LTC against the originally passed version:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 51144 W: 13086 L: 12903 D: 25155
Ptnml(0-2): 22, 5167, 15018, 5336, 29
https://tests.stockfishchess.org/tests/view/69138a317ca87818523314bf

LTC elo estimate on ARM:
1 patch     :    13.9    1.9  38296.5   73728    52
2 master    :     0.0   ----  35431.5   73728    48

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

bench: 2626086

Co-authored-by: Shawn Xu <xu107288696@gmail.com>
Co-authored-by: Timothy Herchen <timothy.herchen@gmail.com>
Co-authored-by: Viren6 <94880762+Viren6@users.noreply.github.com>
Co-authored-by: Yoshie2000 <patrick.leonhardt@gmx.net>
Co-authored-by: Joost Vandevondele <Joost.VandeVondele@gmail.com>
Co-authored-by: rn5f107s2 <clemens.lerchl@gmail.com>
Co-authored-by: cj5716 <125858804+cj5716@users.noreply.github.com>
Co-authored-by: AliceRoselia <63040919+AliceRoselia@users.noreply.github.com>
Co-authored-by: Linmiao Xu <linmiao.xu@gmail.com>
Co-authored-by: Disservin <disservin.social@gmail.com>
2025-11-12 10:49:39 +01:00
Kieren PearsonandJoost VandeVondele 75edbee01e Use huge pages for worker data
As the worker data is quite large (28MB after #6350) we can make use of huge pages as a speedup.

prior to #6350

STC passed elo gaining bounds:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 166272 W: 43479 L: 42993 D: 79800
Ptnml(0-2): 540, 17598, 46365, 18102, 531
https://tests.stockfishchess.org/tests/view/68e9f3c0d323fd15c04e3ba4

Tested the speedup on a large machine with speedtest:
==== master ====
Average (over 20):  288644510
==== largePageWorker ====
Average (over 20):  292082422

Test after #6350:
==== rustam-cpp-testPR ====
Average (over 20):  291035351
==== rustam-cpp-testPR-pages ====
Average (over 20):  291937367

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

No functional change
2025-10-14 17:46:13 +02:00
Daniel MonroeandJoost VandeVondele e7a4708ad5 Remove condition in qsearch
Instead of skipping non-captures when pawn history is exceptionally high, skip all non-captures

Passed non-regression STC
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 38016 W: 10018 L: 9795 D: 18203
Ptnml(0-2): 155, 4346, 9755, 4625, 127
https://tests.stockfishchess.org/tests/view/68e43d4aa017f472e763db2e

Passed rebased non-regression LTC
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 96048 W: 24854 L: 24710 D: 46484
Ptnml(0-2): 47, 10504, 26780, 10644, 49
https://tests.stockfishchess.org/tests/view/68e59352a017f472e763dcf9

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

bench 2343840
2025-10-14 17:32:32 +02:00
rustam-cppandJoost VandeVondele 63d449d1d9 bigger PAWN_HISTORY_SIZE
STC (10+0.1 th1) was accepted:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 75712 W: 19701 L: 19326 D: 36685
Ptnml(0-2): 254, 8738, 19513, 9081, 270
https://tests.stockfishchess.org/tests/view/68e286d5fa806e2e8393d160

LTC (60+0.6 th1) was accepted:
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 108492 W: 28068 L: 27604 D: 52820
Ptnml(0-2): 60, 11639, 30390, 12091, 66
https://tests.stockfishchess.org/tests/view/68e3e564a017f472e763dac0

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

bench 2128316
2025-10-14 17:27:42 +02:00
nicolasduhamelandJoost VandeVondele 5c93616a3f Adjust aspiration window
Narrow the aspiration window after fail high.

Passed STC:
LLR: 2.98 (-2.94,2.94) <0.00,2.00>
Total: 51296 W: 13550 L: 13207 D: 24539
Ptnml(0-2): 165, 5971, 13052, 6276, 184
https://tests.stockfishchess.org/tests/view/68d99afffa806e2e8393b7ae

Passed LTC;
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 87780 W: 22795 L: 22375 D: 42610
Ptnml(0-2): 52, 9340, 24694, 9744, 60
https://tests.stockfishchess.org/tests/view/68dae0a6fa806e2e8393baad

See the comments in #6293 discussing the mechanisms leading to issue #6296

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

Bench: 2336606
2025-10-05 09:23:02 +02:00
Timothy HerchenandJoost VandeVondele 9b164d9520 Shave some instructions off a hot loop in affine transform
On x86, GCC generates highly suboptimal code for this loop in its old form,
about 2x as many instructions as necessary. This decreases throughput
especially in an SMT setting. Clang does a better job but this change still has
some improvement. Note that the std::ptrdiff_t type is not optional; using an
unsigned type brings back the bad assembly. (Not sure why, but it seems
reliable on all the GCC versions I tested.)

passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 44672 W: 11841 L: 11527 D: 21304
Ptnml(0-2): 165, 4625, 12415, 4993, 138
https://tests.stockfishchess.org/tests/view/68d8111efa806e2e8393b10e

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

No functional change
2025-09-28 21:04:29 +02:00
Arseniy SurkovandJoost VandeVondele 731ad9bbc3 Simplify adjust_key50 template
Remove the AfterMove template from the adjust_key50 function, which is only ever called with false.

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

No functional change
2025-08-30 15:17:57 +02:00
Kevin LuandJoost VandeVondele 0db4a1bee9 Remove completedDepth condition for SE
Just removing the term

Passed STC:
LLR: 3.27 (-2.94,2.94) <-1.75,0.25>
Total: 179840 W: 47211 L: 47126 D: 85503
Ptnml(0-2): 567, 17929, 52879, 17942, 603
https://tests.stockfishchess.org/tests/view/688bdd88502b34dd5e7111ea

Passed LTC:
LLR: 3.26 (-2.94,2.94) <-1.75,0.25>
Total: 150708 W: 38738 L: 38637 D: 73333
Ptnml(0-2): 79, 12922, 49262, 13001, 90
https://tests.stockfishchess.org/tests/view/688ce857f17748b4d23c8026

Passed VLTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 288312 W: 74104 L: 74152 D: 140056
Ptnml(0-2): 44, 26732, 90657, 26674, 49
https://tests.stockfishchess.org/tests/view/688ec4f57d68fe4f7f130ee3

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

functional at higher depths

Bench: 3002300
2025-08-16 12:01:19 +02:00
Stockfisher69andJoost VandeVondele 303fe9a164 Simplification: Futility pruning for captures
tested in final form as simplication

passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 113682 W: 29199 L: 29074 D: 55409
Ptnml(0-2): 68, 12359, 31859, 12490, 65
https://tests.stockfishchess.org/tests/view/688e85a17d68fe4f7f130e24

earlier test, equivalent:
passed STC:
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 120224 W: 31621 L: 31176 D: 57427
Ptnml(0-2): 415, 14167, 30567, 14484, 479
https://tests.stockfishchess.org/tests/view/68888bdd7b562f5f7b732643

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

Bench: 2661621
2025-08-09 08:49:12 +02:00
Jost TrillerandJoost VandeVondele 377a3a5269 Depth dependent reduction threshold when full-depth re-search
STC: https://tests.stockfishchess.org/tests/view/68894d577b562f5f7b73273b
LLR: 2.98 (-2.94,2.94) <0.00,2.00>
Total: 155072 W: 40651 L: 40150 D: 74271
Ptnml(0-2): 609, 18271, 39292, 18738, 626

LTC: https://tests.stockfishchess.org/tests/view/688c2705502b34dd5e71127a
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 321012 W: 82891 L: 81995 D: 156126
Ptnml(0-2): 227, 34421, 90285, 35375, 198

This commit was generated using qwen3-235b-a22b-thinking-2507:

Prompt: https://rentry.co/iqtaoht7

Reasoning/thinking: https://rentry.co/wm6t9hye

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

Bench: 2983938
2025-08-04 15:12:55 +02:00
CSTENTORandJoost VandeVondele 57b32f3e60 Make Resetting the Aspiration Window after FailLow more aggressive
Sets beta=(3alpha+beta)/4 when failLow. Before it was beta=(alpha+beta)/2, even
though in theory we should be getting an upper bound from a failLow, we can’t
trust the score that caused the failLow. Therefore beta=alpha doesn’t work. I
made the buffer between the new beta to the bestValue that caused the failLow
smaller.

passed STC:
https://tests.stockfishchess.org/tests/view/688674947b562f5f7b7315b5
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 119616 W: 31253 L: 30818 D: 57545
Ptnml(0-2): 313, 14028, 30724, 14397, 346

passed LTC:
https://tests.stockfishchess.org/tests/view/6887e0ad7b562f5f7b731afc
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 96978 W: 24905 L: 24466 D: 47607
Ptnml(0-2): 59, 10376, 27183, 10809, 62

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

bench: 3085519
2025-08-02 16:12:12 +02:00
StyxandJoost VandeVondele ab83d320b8 Simplify NMP condition
As this is tried only for cutNode, and all children of cutNodes will be nonCutNodes, the guard condition is redundant.
Simplification just removes the unnecessary condition (always true).

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

No functional change
2025-07-28 20:11:40 +02:00
aronpetkovskiandJoost VandeVondele a516b517d3 Simplify eval >= beta condition from NMP
It seems that now only checking if static eval is above beta by some margin is all that's necessary.

Passed Non-Regression STC
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 227264 W: 58430 L: 58421 D: 110413
Ptnml(0-2): 532, 26559, 59454, 26542, 545
https://tests.stockfishchess.org/tests/view/68763a77432ca24f6388c766

Passed Non-Regression LTC
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 72048 W: 18622 L: 18455 D: 34971
Ptnml(0-2): 26, 7775, 20272, 7908, 43
https://tests.stockfishchess.org/tests/view/687c9f2b6e17e7fa3939b0c5

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

Bench: 2759840
2025-07-24 10:38:13 +02:00
87andJoost VandeVondele 8c2d21f91a Speedup movegen with VBMI2
Passed STC
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 166720 W: 43191 L: 42701 D: 80828
Ptnml(0-2): 348, 18567, 45069, 18999, 377
https://tests.stockfishchess.org/tests/view/686ae98dfe0f2fe354c0c867

Refactor movegen to emit to a vector with 16-bit elements, which enables a
speedup with AVX512-VBMI2 when writing moves to the move list.

Very crude timing measurements of perft via timing ./stockfish "go perft 7"
demonstrates approximately 17% perft speedup:

Summary
  ./Stockfish-dev/src/stockfish 'go perft 7' ran
    1.17 ± 0.04 times faster than ./Stockfish-base/src/stockfish 'go perft 7'

Estimated overall nps increase of 0.4% via speedtest: 33605229 -> 33749825
(many thanks JonathanHallstrom).

The corresponding arch is avx512icl as it is a good baseline for consumer
avx-512 feature set support; Intel Ice Lake was the first consumer AVX-512 CPU
and it is a decent subset of what AMD Zen 4 supports.

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

No functional change
2025-07-24 10:08:35 +02:00
Кирилл ЗариповandJoost VandeVondele bebffc5622 Adjust futility pruning thresholds using history
Passed STC:
https://tests.stockfishchess.org/tests/view/6833095a6ec7634154f9b5b3
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 56896 W: 14946 L: 14604 D: 27346
Ptnml(0-2): 117, 6674, 14561, 6942, 154

Passed LTC:
https://tests.stockfishchess.org/tests/view/6833179d6ec7634154f9b5da
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 200742 W: 51660 L: 51012 D: 98070
Ptnml(0-2): 96, 21520, 56473, 22204, 78

Passed Non-regression SMP STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 29080 W: 7591 L: 7373 D: 14116
Ptnml(0-2): 38, 3178, 7881, 3414, 29
https://tests.stockfishchess.org/tests/view/6833689d6ec7634154f9c2ba

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

Bench: 2305697
2025-05-25 21:24:09 +02:00
MapikaandJoost VandeVondele 1b6975ac41 Add quiet move streak tracking to search stack
Passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 109344 W: 28473 L: 28053 D: 52818
Ptnml(0-2): 320, 12756, 28085, 13206, 305
https://tests.stockfishchess.org/tests/view/6828c43e6ec7634154f99a10

Passed LTC:
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 76308 W: 19721 L: 19323 D: 37264
Ptnml(0-2): 39, 8145, 21386, 8547, 37
https://tests.stockfishchess.org/tests/view/6828f65a6ec7634154f99b72

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

Bench: 2161814
2025-05-19 07:27:26 +02:00
breatnandJoost VandeVondele f590767b91 Adaptive beta cut
passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 197088 W: 51084 L: 50533 D: 95471
Ptnml(0-2): 547, 23201, 50577, 23592, 627
https://tests.stockfishchess.org/tests/view/680604d798cd372e3aea58fe

passed LTC
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 127950 W: 32719 L: 32214 D: 63017
Ptnml(0-2): 69, 13825, 35673, 14348, 60
https://tests.stockfishchess.org/tests/view/6805eae498cd372e3aea588a

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

bench 1579003
2025-04-26 22:23:26 +02:00
AliceRoseliaandDisservin 2af64d581b Update AUTHORS
closes https://github.com/official-stockfish/Stockfish/pull/5972

No functional change
2025-04-18 14:32:19 +02:00
Daniel SamekandDisservin 15f34560f2 Update AUTHORS
closes https://github.com/official-stockfish/Stockfish/pull/5964

No functional change
2025-04-18 14:32:13 +02:00
Daniel SamekandDisservin d942e13398 Less fail high cnt in the condition
Passed STC:
https://tests.stockfishchess.org/tests/view/67e027538888403457d87535
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 164000 W: 42535 L: 42034 D: 79431
Ptnml(0-2): 478, 19228, 42113, 19677, 504

Passed LTC:
https://tests.stockfishchess.org/tests/view/67e3c21b8888403457d87808
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 139176 W: 35500 L: 34975 D: 68701
Ptnml(0-2): 54, 15038, 38898, 15525, 73

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

Bench: 1921404
2025-04-02 17:52:38 +02:00
Kenneth LeeandDisservin 9f0844c101 Simplify extensions depth increase condition
Passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 42784 W: 11198 L: 10979 D: 20607
Ptnml(0-2): 166, 5024, 10822, 5185, 195
https://tests.stockfishchess.org/tests/view/6795b6f8f6281b7d7b1869d6

Failed LTC:
LLR: -2.95 (-2.94,2.94) <-1.75,0.25>
Total: 283614 W: 72046 L: 72587 D: 138981
Ptnml(0-2): 241, 32097, 77647, 31606, 216
https://tests.stockfishchess.org/tests/view/6795cbb6f6281b7d7b186a07

Passed VLTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 59678 W: 15387 L: 15211 D: 29080
Ptnml(0-2): 23, 6169, 17273, 6357, 17
https://tests.stockfishchess.org/tests/view/6795c6dbf6281b7d7b1869f9

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

Bench: 3088494
2025-02-02 13:52:16 +01:00
pkrisz99andJoost VandeVondele 75b75bc16a Add improving to a condition of NMP
This patch makes one of the conditions for null-move pruning depend on whether we're improving. Keep in mind that it relies on the "classical" definiton, rather than the refined one.

Passed STC: https://tests.stockfishchess.org/tests/view/678d5267d63764e34db49720
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 38976 W: 10296 L: 9974 D: 18706
Ptnml(0-2): 135, 4504, 9902, 4798, 149

Passed LTC: https://tests.stockfishchess.org/tests/view/678d5891d63764e34db49731
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 275772 W: 70655 L: 69836 D: 135281
Ptnml(0-2): 217, 30615, 75394, 31452, 208

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

Bench: 2475787
2025-01-25 20:41:37 +01:00
sscg13andDisservin 7858f9dfdc Use same pawn value in both nets when doing material scaling of eval
Passed Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 221312 W: 57291 L: 57274 D: 106747
Ptnml(0-2): 760, 26152, 56841, 26117, 786
https://tests.stockfishchess.org/tests/view/676e2a101a2f267f20548453

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 176808 W: 45084 L: 45023 D: 86701
Ptnml(0-2): 112, 19418, 49286, 19473, 115
https://tests.stockfishchess.org/tests/view/676f424d1a2f267f2054857f

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

Bench: 1121800
2025-01-12 21:09:58 +01:00
Carlos EsparzaandDisservin 1f9404434d Simplify picking of evasion moves
Sort evasions before we start returning them in next_move() (just like
every other kind of move) instead of looking for the biggest element on
every call to next_move(). The bench number changes because the old
method is not equivalent to a stable sort.

Passed STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 132064 W: 34318 L: 34204 D: 63542
Ptnml(0-2): 392, 15522, 34106, 15604, 408
https://tests.stockfishchess.org/tests/view/6743fee086d5ee47d953f9ca

Passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 97542 W: 24899 L: 24757 D: 47886
Ptnml(0-2): 63, 10646, 27193, 10824, 45
https://tests.stockfishchess.org/tests/view/674509cd86d5ee47d953fb96

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

Bench: 1094825
2024-12-08 19:54:18 +01:00
Mathias ParnaudeauandDisservin d4358ddba7 Add autodetection of ppc64 architectures
That allows 'make -j profile-build' work on ppc64 architectures, setting the use of
the appropriate SIMD extension, Altivec or VSX.
For VSX, gcc allows to map SSE2 intrinsics and get benefit of the existing SIMD code.

On PowerMac G5, using altivec provides a performance improvement of 30%.
On Talos 2, using vsx provides a performance improvement of 120%.

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

No functional change
2024-10-12 16:30:44 +02:00
Ömer Faruk TutkunandDisservin 6592b13d56 Introduce Continuation Correction History
Continuation correction history uses last 2 move to correct static eval.

ContCorrHist first introduced by @martinnovaak in
Motor(https://github.com/martinnovaak/motor/pull/162). Earlier ideas
using last move to correct eval is introduced by @MinusKelvin in
Ice4(https://github.com/MinusKelvin/ice4/commit/45daf7d9ea64ea4efaf0d2b4e99f53e12e08c838)

Passed STC:

LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 310144 W: 81267 L: 80538 D: 148339
Ptnml(0-2): 1160, 36607, 78834, 37286, 1185
https://tests.stockfishchess.org/tests/view/66f96cbc86d5ee47d953b7f7

Passed LTC:

LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 97470 W: 24892 L: 24447 D: 48131
Ptnml(0-2): 63, 10631, 26915, 11050, 76
https://tests.stockfishchess.org/tests/view/66fd59bc86d5ee47d953b9ea

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

Bench: 1143382
2024-10-12 16:30:44 +02:00
Wencey WangandJoost VandeVondele 93869d5d0a Fix native arch builds on loongarch64
Adds support for LSX and LASX

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

No functional change
2024-09-28 17:12:12 +02:00
Nonlinear2andJoost VandeVondele 6cf7f300ac Simplify stand pat adjustement
Remove && !PvNode condition for stand pat adjustement in quiescence search.

Passed non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 108544 W: 28228 L: 28085 D: 52231
Ptnml(0-2): 389, 12902, 27554, 13031, 396
https://tests.stockfishchess.org/tests/view/66bb402e4ff211be9d4ee688

Passed non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 193014 W: 48796 L: 48751 D: 95467
Ptnml(0-2): 188, 21481, 53116, 21542, 180
https://tests.stockfishchess.org/tests/view/66bc78774ff211be9d4ee88f

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

Bench 1787360
2024-08-20 21:31:33 +02:00
Andyson007andJoost VandeVondele 42aae5fe8b Fixed non UCI compliance
print `<empty>` and accept `<empty>` for UCI string options,
accepting empty strings as well. Internally use empty strings (`""`).

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

No functional change
2024-07-15 13:14:57 +02:00