1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00
Commit graph

6381 commits

Author SHA1 Message Date
Tomasz Sobczyk
3ac75cd27d Add a standardized benchmark command speedtest.
`speedtest [threads] [hash_MiB] [time_s]`. `threads` default to system concurrency. `hash_MiB` defaults to `threads*128`. `time_s` defaults to 150.

Intended to be used with default parameters, as a stable hardware benchmark.

Example:
```
C:\dev\stockfish-master\src>stockfish.exe speedtest
Stockfish dev-20240928-nogit by the Stockfish developers (see AUTHORS file)
info string Using 16 threads
Warmup position 3/3
Position 258/258
===========================
Version                    : Stockfish dev-20240928-nogit
Compiled by                : g++ (GNUC) 13.2.0 on MinGW64
Compilation architecture   : x86-64-vnni256
Compilation settings       : 64bit VNNI BMI2 AVX2 SSE41 SSSE3 SSE2 POPCNT
Compiler __VERSION__ macro : 13.2.0
Large pages                : yes
User invocation            : speedtest
Filled invocation          : speedtest 16 2048 150
Available processors       : 0-15
Thread count               : 16
Thread binding             : none
TT size [MiB]              : 2048
Hash max, avg [per mille]  :
    single search          : 40, 21
    single game            : 631, 428
Total nodes searched       : 2099917842
Total search time [s]      : 153.937
Nodes/second               : 13641410
```

-------------------------------

Small unrelated tweaks:
 - Network verification output is now handled as a callback.
 - TT hashfull queries allow specifying maximum entry age.

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

No functional change
2024-09-28 18:01:26 +02:00
Nonlinear2
aff1f67997 simplify see pruning in qsearch
passed non-regression STC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 34880 W: 9193 L: 8968 D: 16719
Ptnml(0-2): 103, 4047, 8935, 4232, 123
https://tests.stockfishchess.org/tests/view/66ee83bd86d5ee47d953b15b

passed non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 69126 W: 17529 L: 17357 D: 34240
Ptnml(0-2): 41, 7507, 19285, 7699, 31
https://tests.stockfishchess.org/tests/view/66ef3e0386d5ee47d953b1d3

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

Bench: 1339840
2024-09-28 17:22:33 +02:00
Joost VandeVondele
ae420e735f Tweak Correction histories
tune parameters some more, adjust scores updated for each history

passed STC:
https://tests.stockfishchess.org/tests/view/66ea569186d5ee47d953ae48
LLR: 2.92 (-2.94,2.94) <0.00,2.00>
Total: 36288 W: 9660 L: 9344 D: 17284
Ptnml(0-2): 110, 4207, 9220, 4471, 136

passed LTC:
https://tests.stockfishchess.org/tests/view/66ea9b4e86d5ee47d953ae6f
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 241446 W: 61748 L: 61010 D: 118688
Ptnml(0-2): 173, 26211, 67202, 26979, 158

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

Bench: 1677953
2024-09-28 17:17:44 +02:00
FauziAkram
5d0bb5976e Removed ROOK threatenedByPawn
Passed STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 56608 W: 14788 L: 14588 D: 27232
Ptnml(0-2): 162, 6763, 14313, 6845, 221
https://tests.stockfishchess.org/tests/view/66e83f9c86d5ee47d953ab1d

Passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 175758 W: 44501 L: 44438 D: 86819
Ptnml(0-2): 125, 19489, 48601, 19526, 138
https://tests.stockfishchess.org/tests/view/66e882d486d5ee47d953ab8a

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

bench: 1241271
2024-09-28 17:17:14 +02:00
Wencey Wang
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
Shawn Xu
60351b9df9 Introduce Various Correction histories
This patch introduces three additional correction histories, namely,
Major Piece Correction History, Minor Piece Correction History, and
Non-Pawn Correction History.

Introduced by @mcthouacbb in Sirius
(https://github.com/mcthouacbb/Sirius) chess engine. The Major Piece
Correction History is indexed by side-to-move and the Zobrist key
representing the position of the King, Rook, and Queen of both sides.
Likewise, the Minor Piece Correction History is indexed by side-to-move
and the Zobrist key representing the position of the King, Knight, and
Bishop of both sides.

Also See:
97b85bbaac
3099cdef2f

Introduced by @zzzzz151 in Starzix (https://github.com/zzzzz151/Starzix)
chess engine. Non-Pawn correction history consists of side-to-move, side
of Zobrist key, and a Zobrist key representing of the position of all
non-pawn pieces of **one side**. The non-pawn correction values for both
key sides are then summed.

Also See:
34911772f1
33e0df8dd2

The weights on the final correction value of the above correction
histories, as well as existing correction histories, are then tuned in
two separate SPSA sessions, totaling 75k games.

SPSA1:
https://tests.stockfishchess.org/tests/view/66e5243886d5ee47d953a86b
(Stopped early due to some weights reaching the maximum value)

SPSA2:
https://tests.stockfishchess.org/tests/view/66e6a26f86d5ee47d953a965

Also thanks to @martinnovaak, (Motor
https://github.com/martinnovaak/motor author) for insights and
suggestions.

Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 23328 W: 6197 L: 5901 D: 11230
Ptnml(0-2): 82, 2582, 6041, 2876, 83
https://tests.stockfishchess.org/tests/view/66e8787b86d5ee47d953ab6f

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 10626 W: 2826 L: 2560 D: 5240
Ptnml(0-2): 4, 1054, 2941, 1300, 14
https://tests.stockfishchess.org/tests/view/66e8ab2386d5ee47d953aba8

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

Bench: 1011161
2024-09-17 21:01:43 +02:00
Michael Chaly
240a5b1c72 Introduce separate butterfly history table for sorting root moves
Idea of this patch comes from the fact that current history heuristics
are mostly populated by low depth entries since our stat bonus reaches
maximum value at depth 5-6 and number of low depth nodes is much bigger
than number of high depth nodes. But it doesn't make a whole lost of
sense to use this low-depth centered histories to sort moves at root.
Current patch introduces special history table that is used exclusively
at root, it remembers which quiet moves were good and which quiet moves
were not good there and uses this information for move ordering.

Passed STC:
https://tests.stockfishchess.org/tests/view/66dda74adc53972b68218cc9
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 127680 W: 33579 L: 33126 D: 60975
Ptnml(0-2): 422, 15098, 32391, 15463, 466

Passed LTC:
https://tests.stockfishchess.org/tests/view/66dead2adc53972b68218d34
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 381978 W: 96958 L: 95923 D: 189097
Ptnml(0-2): 277, 42165, 105089, 43162, 296

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

Bench: 1611283
2024-09-17 20:54:02 +02:00
Shawn Xu
5ce7f866a5 Simplify Fail Low Bonus
Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 302528 W: 78190 L: 78264 D: 146074
Ptnml(0-2): 1029, 35797, 77551, 35993, 894
https://tests.stockfishchess.org/tests/view/66dcebdedc53972b68218c7e

Passed Non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 122754 W: 31025 L: 30907 D: 60822
Ptnml(0-2): 74, 13597, 33908, 13733, 65
https://tests.stockfishchess.org/tests/view/66e0c38686d5ee47d953a481

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

Bench: 1646373
2024-09-17 20:50:30 +02:00
Muzhen Gaming
224c147bd6 VVLTC Search Tune
Tuned with 115k games at VVLTC:
https://tests.stockfishchess.org/tests/view/66c80e09bf8c9d8780fda62a

Passed VVLTC 1st sprt:
https://tests.stockfishchess.org/tests/view/66d69ade9de3e7f9b33d14f9
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 54270 W: 13935 L: 13647 D: 26688
Ptnml(0-2): 2, 4907, 17032, 5189, 5

Passed VVLTC 2nd sprt:
https://tests.stockfishchess.org/tests/view/66dcf9c1dc53972b68218c84
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 136696 W: 34941 L: 34462 D: 67293
Ptnml(0-2): 8, 12659, 42535, 13138, 8

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

Bench: 1644273
2024-09-17 20:47:24 +02:00
Disservin
a06e7004c1 Port instrumented testing to python
Since an unknown amount of time the instrumented CI has been a bit
flawed, explained here
https://github.com/official-stockfish/Stockfish/issues/5185. It also
experiences random timeout issues where restarting the workflow fixes it
or very long run times (more than other workflows) and is not very
portable.

The intention of this commit is to port the instrumented.sh to python
which also works on other operating systems. It should also be
relatively easy for beginners to add new tests to assert stockfish's
output and to run it.
From the source directory the following command can be run.

`python3 ../tests/instrumented.py --none ./stockfish`

A test runner will go over the test suites and run the test cases.

All instrumented tests should have been ported over.
The required python version for this is should be 3.7 (untested) + the
requests package, testing.py includes some infrastructure code which
setups the testing.

fixes https://github.com/official-stockfish/Stockfish/issues/5185
closes https://github.com/official-stockfish/Stockfish/pull/5583

No functional change
2024-09-17 20:24:17 +02:00
MinetaS
f677aee28b Fix net downloading script
The recent commit introduced a bug in the net downloading script that
the file is not downloaded correctly and the content is redirected to
stdout.

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

No functional change
2024-09-10 23:00:41 +02:00
Nonlinear2
d8e49cdbdd Remove the moveCount increase in the LMR condition.
Passed non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 87104 W: 22630 L: 22464 D: 42010
Ptnml(0-2): 316, 10295, 22132, 10525, 284
https://tests.stockfishchess.org/tests/view/66dccd00dc53972b68218c60

Passed non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 94050 W: 23869 L: 23722 D: 46459
Ptnml(0-2): 49, 10400, 25985, 10537, 54
https://tests.stockfishchess.org/tests/view/66dd69c7dc53972b68218ca5

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

Bench: 1281840
2024-09-10 22:59:27 +02:00
MinetaS
6de2587236 Remove statScore condition in NMP
Eliminate the condition that is nearly 100% likelihood of being true.

Passed non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 208832 W: 54053 L: 54022 D: 100757
Ptnml(0-2): 753, 24987, 52901, 25026, 749
https://tests.stockfishchess.org/tests/view/66cddb50bf8c9d8780fdabaf

Passed non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 154344 W: 39132 L: 39047 D: 76165
Ptnml(0-2): 115, 17231, 42403, 17300, 123
https://tests.stockfishchess.org/tests/view/66cfafe39de3e7f9b33d1050

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

Bench: 1393697
2024-09-10 22:58:47 +02:00
MinetaS
2680c9c799 Small speedup in incremental accumulator updates
Instead of updating at most two accumulators, update all accumluators
during incremental updates. Tests have shown that this change yields a
small speedup of at least 0.5%, and up to 1% with shorter TC.

Passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 54368 W: 14179 L: 13842 D: 26347
Ptnml(0-2): 173, 6122, 14262, 6449, 178
https://tests.stockfishchess.org/tests/view/66db038a9de3e7f9b33d1ad9

Passed 5+0.05:
LLR: 2.98 (-2.94,2.94) <0.00,2.00>
Total: 55040 W: 14682 L: 14322 D: 26036
Ptnml(0-2): 303, 6364, 13856, 6664, 333
https://tests.stockfishchess.org/tests/view/66dbc325dc53972b68218ba7

Passed non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 57390 W: 14555 L: 14376 D: 28459
Ptnml(0-2): 37, 5876, 16683, 6069, 30
https://tests.stockfishchess.org/tests/view/66dbc30adc53972b68218ba5

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

No functional change
2024-09-09 18:02:32 +02:00
Disservin
effa246071 Use optional for the engine path
- A small quality of file change is to change the type of engine path
  from a string to an optional string, skips the binary directory
  lookup, which is commonly disabled by people who create wasm builds or
  include stockfish as a library.

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

No functional change
2024-09-09 18:02:32 +02:00
Michael Chaly
a8cb002038 Simplify ttmove reduction
Remove condition that clamps reductions for tt move.

Passed STC:
https://tests.stockfishchess.org/tests/view/66d5f1239de3e7f9b33d14b0
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 91136 W: 23805 L: 23646 D: 43685
Ptnml(0-2): 334, 10328, 24066, 10525, 315

Passed LTC:
https://tests.stockfishchess.org/tests/view/66d7c5889de3e7f9b33d1721
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 139242 W: 35130 L: 35030 D: 69082
Ptnml(0-2): 78, 15200, 38986, 15258, 99

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

Bench: 1268715
2024-09-09 18:02:32 +02:00
xu-shawn
d7e3a708d4 Remove ARCH=... from README.md
closes https://github.com/official-stockfish/Stockfish/pull/5570

No functional change
2024-09-09 18:02:32 +02:00
MinetaS
1b310cc87e Export and clean up net downloading script
Fixes https://github.com/official-stockfish/Stockfish/issues/5564

This patch extracts the net downloading script in Makefile into an
external script file. Also the script is moderately rewritten for
improved readability and speed.

* Use wget preferentially over curl, as curl is known to have slight
  overhead.
* Use command instead of hash to check if command exists. Reportedly,
  hash always returns zero in some POSIX shells even when the command
  fails.
* Command existence checks (wget/curl, sha256sum) are performed only
  once at the beginning.
* Each of common patterns is encapsulated in a function
  (get_nnue_filename, validate_network).
* Print out error/warning messages to stderr.

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

No functional change

Co-authored-by: Disservin <disservin.social@gmail.com>
2024-09-09 18:02:27 +02:00
xu-shawn
66a7965b0f Copy scripts directory in distributed packages
closes https://github.com/official-stockfish/Stockfish/pull/5571

No functional change
2024-09-09 17:54:27 +02:00
Daniel Monroe
e74452ae44 Reduce on ttcaptures if not capture
Tweak ttcapture reduction.
Reduce on ttcaptures only if the current move is a capture

Passed STC:
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 94912 W: 24896 L: 24492 D: 45524
Ptnml(0-2): 301, 11197, 24087, 11539, 332
https://tests.stockfishchess.org/tests/view/66cd2264bf8c9d8780fdab34

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 60738 W: 15465 L: 15096 D: 30177
Ptnml(0-2): 42, 6573, 16775, 6932, 47
https://tests.stockfishchess.org/tests/view/66cf356d9de3e7f9b33d0fde

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

Bench: 1268700
2024-09-09 17:48:26 +02:00
Shawn Xu
ddc9f48bc3 Introduce Material Correction History
Idea from Caissa (https://github.com/Witek902/Caissa) chess engine.

Add a secondary correction history indexed by the material key of a position.
The material key is the zobrist hash representing the number of pieces left in a
position.

Passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 189472 W: 49360 L: 48813 D: 91299
Ptnml(0-2): 666, 22453, 47953, 22996, 668
https://tests.stockfishchess.org/tests/view/66cbddafbf8c9d8780fda9f1

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 224190 W: 57022 L: 56312 D: 110856
Ptnml(0-2): 197, 24723, 61540, 25443, 192
https://tests.stockfishchess.org/tests/view/66cd529bbf8c9d8780fdab4c

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

Bench: 1462697
2024-09-09 17:43:05 +02:00
FauziAkram
4fb04eb3df Simplify history bonus
After we recently added the disallowance for negative bonuses, it is no
longer necessary to keep the max comparison in the previous step.

Passed STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 72000 W: 18820 L: 18637 D: 34543
Ptnml(0-2): 267, 8489, 18276, 8730, 238
https://tests.stockfishchess.org/tests/view/66ce132cbf8c9d8780fdabe7

Passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 67452 W: 17136 L: 16961 D: 33355
Ptnml(0-2): 35, 7489, 18519, 7632, 51
https://tests.stockfishchess.org/tests/view/66cf6ad49de3e7f9b33d1010

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

Bench: 1147012
2024-09-09 17:34:31 +02:00
Disservin
f4ba7ce67a Restore development
closes https://github.com/official-stockfish/Stockfish/pull/5580

No functional change
2024-09-09 17:21:14 +02:00
Joost VandeVondele
e0bfc4b69b Stockfish 17
Official release version of Stockfish 17

Bench: 1484730

---

Stockfish 17

Today we have the pleasure to announce a new major release of Stockfish. As
always, you can freely download it at https://stockfishchess.org/download and
use it in the GUI of your choice.

Don’t forget to join our Discord server[1] to get in touch with the community
of developers and users of the project!

*Quality of chess play*

In tests against Stockfish 16, this release brings an Elo gain of up to 46
points[2] and wins up to 4.5 times more game pairs[3] than it loses. In
practice, high-quality moves are now found in less time, with a user upgrading
from Stockfish 14 being able to analyze games at least 6 times[4] faster with
Stockfish 17 while maintaining roughly the same quality.

During this development period, Stockfish won its 9th consecutive first place
in the main league of the Top Chess Engine Championship (TCEC)[5], and the 24th
consecutive first place in the main events (bullet, blitz, and rapid) of the
Computer Chess Championship (CCC)[6].

*Update highlights*

*Improved engine lines*

This release introduces principal variations (PVs) that are more informative
for mate and decisive table base (TB) scores. In both cases, the PV will
contain all moves up to checkmate. For mate scores, the PV shown is the best
variation known to the engine at that point, while for table base wins, it
follows, based on the TB, a sequence of moves that preserves the game outcome
to checkmate.

*NUMA performance optimization*

For high-end computers with multiple CPUs (typically a dual-socket architecture
with 100+ cores), this release automatically improves performance with a
`NumaPolicy` setting that optimizes non-uniform memory access (NUMA).  Although
typical consumer hardware will not benefit, speedups of up to 2.8x[7] have been
measured.

*Shoutouts*

*ChessDB*

During the past 1.5 years, hundreds of cores have been continuously running
Stockfish to grow a database of analyzed positions. This chess cloud
database[8] now contains well over 45 billion positions, providing excellent
coverage of all openings and commonly played lines. This database is already
integrated into GUIs such as En Croissant[9] and Nibbler[10], which access it
through the public API.

*Leela Chess Zero*

Generally considered to be the strongest GPU engine, it continues to provide
open data which is essential for training our NNUE networks. They released
version 0.31.1[11] of their engine a few weeks ago, check it out!

*Website redesign*

Our website has undergone a redesign in recent months, most notably in our home
page[12], now featuring a darker color scheme and a more modern aesthetic,
while still maintaining its core identity. We hope you'll like it as much as we
do!

*Thank you*

The Stockfish project builds on a thriving community of enthusiasts (thanks
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 11k stars[13] that light up our
GitHub project! Thank you for your support and encouragement – your recognition
means a lot to us.

We invite our chess fans to join the Fishtest testing framework[14] to
contribute compute resources needed for development. Programmers can contribute
to the project either directly to Stockfish[15] (C++), to Fishtest[16] (HTML,
CSS, JavaScript, and Python), to our trainer nnue-pytorch[17] (C++ and Python),
or to our website[18] (HTML, CSS/SCSS, and JavaScript).

The Stockfish team

[1] https://discord.gg/GWDRS3kU6R
[2] https://tests.stockfishchess.org/tests/view/66d738ba9de3e7f9b33d159a
[3] https://tests.stockfishchess.org/tests/view/66d738f39de3e7f9b33d15a0
[4] https://github.com/official-stockfish/Stockfish/wiki/Useful-data#equivalent-time-odds-and-normalized-game-pair-elo
[5] https://en.wikipedia.org/wiki/Stockfish_(chess)#Top_Chess_Engine_Championship
[6] https://en.wikipedia.org/wiki/Stockfish_(chess)#Chess.com_Computer_Chess_Championship
[7] https://github.com/official-stockfish/Stockfish/pull/5285
[8] https://chessdb.cn/queryc_en/
[9] https://encroissant.org/
[10] https://github.com/rooklift/nibbler
[11] https://github.com/LeelaChessZero/lc0/releases/tag/v0.31.1
[12] https://stockfishchess.org/
[13] https://github.com/official-stockfish/Stockfish/stargazers
[14] https://github.com/official-stockfish/fishtest/wiki/Running-the-worker
[15] https://github.com/official-stockfish/Stockfish
[16] https://github.com/official-stockfish/fishtest
[17] https://github.com/official-stockfish/nnue-pytorch
[18] https://github.com/official-stockfish/stockfish-web
2024-09-06 16:53:45 +02:00
Joost VandeVondele
38e0cc7b90 Update Top CPU Contributors
to the status as of Aug 31st 2024.

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

No functional change
2024-09-03 17:53:23 +02:00
Robert Nurnberg @ elitebook
2054add23c Update the WDL model
updates the internal WDL model, using data from 2.6M games played by the revisions since 9fb5832.

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

No functional change
2024-09-03 17:53:23 +02:00
Joost VandeVondele
ab00c24c7e Fix some of the tests
due to https://github.com/official-stockfish/Stockfish/issues/5185 some CI tests are skipped.
This patch fixes a few tests that need updating.

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

No functional change
2024-09-03 17:48:58 +02:00
FauziAkram
451044202a Simpler formula for ss->cutoffCnt update
closes https://github.com/official-stockfish/Stockfish/pull/5548

No functional change
2024-08-28 09:35:21 +02:00
Taras Vuk
54def6f7eb rename !(PvNode || cutNode) to allNode
Passed STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 108992 W: 28178 L: 28039 D: 52775
Ptnml(0-2): 356, 12428, 28762, 12621, 329
https://tests.stockfishchess.org/tests/view/66c73a51bf8c9d8780fda532

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

No functional change
2024-08-28 09:34:09 +02:00
Tomasz Sobczyk
a0597b1281 Forcibly split NUMA nodes on Windows
split by processor groups due to Window's thread scheduler issues.

fixes #5551
closes https://github.com/official-stockfish/Stockfish/pull/5552

No functional change
2024-08-28 08:52:24 +02:00
Taras Vuk
9fb58328e3 Tweak late move extensions
Allow late move extensions only for PV and cut nodes.

Passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 44512 W: 11688 L: 11355 D: 21469
Ptnml(0-2): 167, 5180, 11229, 5513, 167
https://tests.stockfishchess.org/tests/view/66c0509d4ff211be9d4ef10e

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 152970 W: 39026 L: 38466 D: 75478
Ptnml(0-2): 102, 16792, 42164, 17298, 129
https://tests.stockfishchess.org/tests/view/66c0994d21503a509c13b2b6

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

bench: 1484730
2024-08-20 21:37:25 +02:00
Shawn Xu
d275bf9643 Introduce Fail Low History Bonus
When a node fails low, give TT move a small bonus 1/4 of normal value.

Passed STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 92384 W: 24094 L: 23691 D: 44599
Ptnml(0-2): 323, 10852, 23465, 11203, 349
https://tests.stockfishchess.org/tests/view/66be80794ff211be9d4eed68

Passed LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 114660 W: 29260 L: 28778 D: 56622
Ptnml(0-2): 97, 12506, 31653, 12966, 108
https://tests.stockfishchess.org/tests/view/66bf63ee4ff211be9d4eeef0

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

bench 1463003
2024-08-20 21:34:19 +02:00
Nonlinear2
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
Shawn Xu
87814d2fb8 Simplify doShallowerSearch
Passed Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 242336 W: 62657 L: 62663 D: 117016
Ptnml(0-2): 941, 28949, 61418, 28895, 965
https://tests.stockfishchess.org/tests/view/66bc13c34ff211be9d4ee794

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 128100 W: 32503 L: 32390 D: 63207
Ptnml(0-2): 106, 14319, 35113, 14380, 132
https://tests.stockfishchess.org/tests/view/66bdbb304ff211be9d4eec5d

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

bench 1586246
2024-08-20 21:27:58 +02:00
Shawn Xu
175021721c Simplify bestMove promotion
Passed Non-regression STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 216768 W: 56240 L: 56217 D: 104311
Ptnml(0-2): 794, 24900, 56956, 24957, 777
https://tests.stockfishchess.org/tests/view/66bc11324ff211be9d4ee78b

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 44970 W: 11391 L: 11199 D: 22380
Ptnml(0-2): 44, 4596, 13002, 4810, 33
https://tests.stockfishchess.org/tests/view/66bdbb1b4ff211be9d4eec5a

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

bench: 1613043
2024-08-20 21:24:04 +02:00
Linmiao Xu
5d81071953 Update default main net to nn-1111cefa1111.nnue
Created from 2 distinct spsa tunes of the latest main net (nn-31337bea577c.nnue)
and applying the params to the prior main net (nn-e8bac1c07a5a.nnue). This
effectively reverts the modifications to output weights and biases in
https://github.com/official-stockfish/Stockfish/pull/5509

SPSA:
A: 6000, alpha: 0.602, gamma: 0.101

1st - 437 feature transformer biases where values are < 25
54k / 120k games at 180+1.8
https://tests.stockfishchess.org/tests/view/66af98ac4ff211be9d4edad0
nn-808259761cca.nnue

2nd - 208 L2 weights where values are zero
112k / 120k games at 180+1.8
https://tests.stockfishchess.org/tests/view/66b0c3074ff211be9d4edbe5
nn-a56cb8c3d477.nnue

When creating the above 2 nets (nn-808259761cca.nnue, nn-a56cb8c3d477.nnue),
spsa params were unintentionally applied to nn-e8bac1c07a5a.nnue rather
than nn-31337bea577c.nnue due to an issue in a script that creates nets
by applying spsa results to base nets.

Since they both passed STC and were neutral or slightly positive at LTC,
they were combined to see if the elo from each set of params was additive.

The 2 nets can be merged on top of nn-e8bac1c07a5a.nnue with:
https://github.com/linrock/nnue-tools/blob/90942d3/spsa/combine_nnue.py
```
python3 combine_nnue.py \
  nn-e8bac1c07a5a.nnue \
  nn-808259761cca.nnue \
  nn-a56cb8c3d477.nnue
```

Merging yields nn-87caa003fc6a.nnue which was renamed to nn-1111cefa1111.nnue
with an updated nnue-namer around 10x faster than before by:
- using a prefix trie for efficient prefix matches
- modifying 4 non-functional bytes near the end of the file instead of 2
https://github.com/linrock/nnue-namer

Thanks to @MinetaS for pointing out in #nnue-dev what the non-functional bytes are:
  L3 is 32, 4 bytes for biases, 32 bytes for weights. (fc_2)
  So -38 and -37 are technically -2 and -1 of fc_1 (type AffineTransform<30, 32>)
  And since InputDimension is padded to 32 there are total 32 of 2 adjacent bytes padding.
  So yes, it's non-functional whatever values are there.
  It's possible to tweak bytes at -38 - 32 * N and -37 - 32 * N given N = 0 ... 31

The net renamed with the new method passed non-regression STC vs. the original net:
https://tests.stockfishchess.org/tests/view/66c0f0a821503a509c13b332

To print the spsa params with nnue-pytorch:
```
import features
from serialize import NNUEReader

feature_set = features.get_feature_set_from_name("HalfKAv2_hm")

with open("nn-31337bea577c.nnue", "rb") as f:
    model = NNUEReader(f, feature_set).model

c_end = 16
for i,ft_bias in enumerate(model.input.bias.data[:3072]):
    value = int(ft_bias * 254)
    if abs(value) < 25:
        print(f"ftB[{i}],{value},-1024,1024,{c_end},0.0020")

c_end = 6
for i in range(8):
    for j in range(32):
        for k in range(30):
            value = int(model.layer_stacks.l2.weight.data[32 * i + j, k] * 64)
            if value == 0:
                print(f"twoW[{i}][{j}][{k}],{value},-127,127,{c_end},0.0020")
```

New params found with the same method as:
https://github.com/official-stockfish/Stockfish/pull/5459

Passed STC:
https://tests.stockfishchess.org/tests/view/66b4d4464ff211be9d4edf6e
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 136416 W: 35753 L: 35283 D: 65380
Ptnml(0-2): 510, 16159, 34416, 16597, 526

Passed LTC:
https://tests.stockfishchess.org/tests/view/66b76e814ff211be9d4ee1cc
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 159336 W: 40753 L: 40178 D: 78405
Ptnml(0-2): 126, 17497, 43864, 18038, 143

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

bench 1613043
2024-08-20 20:59:36 +02:00
FauziAkram
4995792a6c Simplify cutnode reduction formula
Passed STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 137994 W: 34705 L: 34603 D: 68686
Ptnml(0-2): 124, 15371, 37903, 15477, 122
https://tests.stockfishchess.org/tests/view/66aeb74b4ff211be9d4eda10

Passed LTC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 131456 W: 34148 L: 34031 D: 63277
Ptnml(0-2): 506, 15571, 33465, 15672, 514
https://tests.stockfishchess.org/tests/view/66ae258b4ff211be9d4ed95d

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

Bench: 1261995
2024-08-20 20:57:07 +02:00
Shawn Xu
a75717ede1 Simplify Post-LMR Continuation History Updates
Passed Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 55520 W: 14625 L: 14420 D: 26475
Ptnml(0-2): 247, 6522, 14007, 6747, 237
https://tests.stockfishchess.org/tests/view/66ad40874ff211be9d4ed8f7

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 216168 W: 54561 L: 54540 D: 107067
Ptnml(0-2): 196, 24212, 59244, 24239, 193
https://tests.stockfishchess.org/tests/view/66aeac954ff211be9d4eda03

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

bench 1418263
2024-08-20 20:51:39 +02:00
Shawn Xu
bc80ece6c7 Improve Comments for Pairwise Multiplication Optimization
closes https://github.com/official-stockfish/Stockfish/pull/5524

no functional change
2024-08-20 20:47:46 +02:00
Disservin
d626af5c3a Fix failing CI for MacOS 13 GCC 11
closes https://github.com/official-stockfish/Stockfish/pull/5540

No functional change
2024-08-20 20:44:55 +02:00
Shawn Xu
ae9e55cf53 Simplify Cutnode Reduction
Passed Non-regression STC:
LR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 143968 W: 37439 L: 37333 D: 69196
Ptnml(0-2): 521, 17228, 36456, 17182, 597
https://tests.stockfishchess.org/tests/view/66a73f9f4ff211be9d4ed27f

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 198954 W: 50384 L: 50345 D: 98225
Ptnml(0-2): 201, 22360, 54347, 22337, 232
https://tests.stockfishchess.org/tests/view/66a906e94ff211be9d4ed423

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

bench 1277466
2024-08-03 09:42:54 +02:00
MinetaS
b976f0a101 Move DotProd code into optimized affine layer
This patch moves the DotProd code into the propagation function which
has sequential access optimization. To prove the speedup, the comparison
is done without the sparse layer. With the sparse layer the effect is
marginal (GCC 0.3%, LLVM/Clang 0.1%).

For both tests, binary is compiled with GCC 14.1. Each test had 50 runs.

Sparse layer included:
```
speedup        = +0.0030
P(speedup > 0) =  1.0000
```

Sparse layer excluded:
```
speedup        = +0.0561
P(speedup > 0) =  1.0000
```

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

No functional change
2024-08-03 09:42:03 +02:00
Tomasz Sobczyk
8e560c4fd3 Replicate network weights only to used NUMA nodes
On a system with multiple NUMA nodes, this patch avoids unneeded replicated
(e.g. 8x for a single threaded run), reducting memory use in that case.

Lazy initialization forced before search.

Passed STC:
https://tests.stockfishchess.org/tests/view/66a28c524ff211be9d4ecdd4
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 691776 W: 179429 L: 179927 D: 332420
Ptnml(0-2): 2573, 79370, 182547, 78778, 2620

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

No functional change
2024-08-03 09:41:37 +02:00
Shawn Xu
2343f71f3f Remove Killers
The removal of killers on line 1774 resulted in a substantial decrease
in pre-LMR history average, so a negative history fill is applied to
counter it.

Passed Non-regression STC (vs #5513):
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 21984 W: 5886 L: 5645 D: 10453
Ptnml(0-2): 80, 2492, 5628, 2691, 101
https://tests.stockfishchess.org/tests/view/66a095894ff211be9d4ecb9d

Passed Non-regression LTC (vs #5513):
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 95430 W: 24141 L: 23995 D: 47294
Ptnml(0-2): 97, 10537, 26298, 10689, 94
https://tests.stockfishchess.org/tests/view/66a11c8d4ff211be9d4ecbf8

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

Bench: 1660869
2024-07-28 22:22:50 +02:00
Stéphane Nicolet
af802da65b Clean up comments for movepicker
Remove references to checks in MovePicker comments. Follow-up for
https://github.com/official-stockfish/Stockfish/pull/5498

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

No functional change
2024-07-28 22:21:03 +02:00
Michael Chaly
607c3e404f Remove unneeded depth tracking in qsearch
Since simplification of quiet checks in qsearch this depth isn't used by
any function at all apart movepicker, which also doesn't use passed
qsearch depth in any way, so can be removed. No functional change.

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

No functional change
2024-07-28 22:18:33 +02:00
Shawn Xu
85893ac1cd Simplify Away Killer Condition in Cutnode LMR
Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 42944 W: 11240 L: 11024 D: 20680
Ptnml(0-2): 159, 5056, 10825, 5274, 158
https://tests.stockfishchess.org/tests/view/669c13384ff211be9d4ec69f

Passed Non-regression LTC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 163548 W: 41366 L: 41289 D: 80893
Ptnml(0-2): 109, 18246, 45007, 18283, 129
https://tests.stockfishchess.org/tests/view/669cb1254ff211be9d4ec73a

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

Bench: 1178570
2024-07-28 22:13:47 +02:00
Linmiao Xu
b55217fd02 Update default main net to nn-31337bea577c.nnue
Created by updating output weights (256) and biases (8)
of the previous main net with values found with spsa around
101k / 120k games at 140+1.4.

264 spsa params: output weights and biases in nn-e8bac1c07a5a.nnue
A: 6000, alpha: 0.602, gamma: 0.101
weights: [-127, 127], c_end = 6
biases: [-8192, 8192], c_end = 64

Among the 264 params, 189 weights and all 8 biases were changed.

Changes in the weights:
- mean: -0.111 +/- 3.57
- range: [-8, 8]

Found with the same method as:
https://github.com/official-stockfish/Stockfish/pull/5459

Due to the original name (nn-ea8c9128c325.nnue) being too similar
to the previous main net (nn-e8bac1c07a5a.nnue) and creating confusion,
it was renamed by making non-functional changes to the .nnue file
the same way as past nets with:
https://github.com/linrock/nnue-namer

To verify that bench is the same and view the modified non-functional bytes:
```
echo -e "setoption name EvalFile value nn-ea8c9128c325.nnue\nbench" | ./stockfish
echo -e "setoption name EvalFile value nn-31337bea577c.nnue\nbench" | ./stockfish

cmp -l nn-ea8c9128c325.nnue nn-31337bea577c.nnue

diff <(xxd nn-ea8c9128c325.nnue) <(xxd nn-31337bea577c.nnue)
```

Passed STC:
https://tests.stockfishchess.org/tests/view/669564154ff211be9d4ec080
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 57280 W: 15139 L: 14789 D: 27352
Ptnml(0-2): 209, 6685, 14522, 6995, 229

Passed LTC:
https://tests.stockfishchess.org/tests/view/669694204ff211be9d4ec1b4
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 63030 W: 16093 L: 15720 D: 31217
Ptnml(0-2): 47, 6766, 17516, 7139, 47

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

bench 1371485
2024-07-23 19:34:27 +02:00
Michael Chaly
836154acb5 Introduce pre-qsearch ttmove extensions at pv nodes
The idea is that we are about to dive into qsearch (next search depth is <= 0)
but since we have the move in transposition table we should extend that move
and evaluate it with more precise search - because branch seems important.

Passed STC:
https://tests.stockfishchess.org/tests/view/6699d2564ff211be9d4ec488
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 83104 W: 21789 L: 21401 D: 39914
Ptnml(0-2): 293, 9748, 21128, 10044, 339

Passed LTC:
https://tests.stockfishchess.org/tests/view/669b3f1a4ff211be9d4ec602
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 136098 W: 34636 L: 34111 D: 67351
Ptnml(0-2): 105, 14882, 37550, 15407, 105

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

bench 1526129
2024-07-23 19:24:00 +02:00
Shawn Xu
985b9fd7b0 Remove Killer Heuristic In Move Ordering
Passed Non-regression STC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 80480 W: 20979 L: 20802 D: 38699
Ptnml(0-2): 279, 9610, 20337, 9683, 331
https://tests.stockfishchess.org/tests/view/669c12c14ff211be9d4ec69b

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 77988 W: 19788 L: 19624 D: 38576
Ptnml(0-2): 66, 8605, 21481, 8783, 59
https://tests.stockfishchess.org/tests/view/669d628a4ff211be9d4ec7a8

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

bench 1367740
2024-07-23 19:24:00 +02:00