+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
Timothy Herchen and Joost VandeVondele
6764561916
Improve index generation
...
The speedup seems to vary by machine. The indexing function can be changed w/o needing to understand intrinsics.
Result of 100 runs
==================
base (...ish_baseline) = 1719637 +/- 3233
test (./stockfish ) = 1734245 +/- 3534
diff = +14608 +/- 4868
speedup = +0.0085
P(speedup > 0) = 1.0000
closes https://github.com/official-stockfish/Stockfish/pull/6366
No functional change
2025-11-01 10:42:42 +01:00
Shawn Xu and Joost VandeVondele
f434cc2918
Allow AccumulatorStack::size to point to one past the end
...
this is guaranteed to be correct since we access the last element with `size - 1`
closes https://github.com/official-stockfish/Stockfish/pull/6368
fixes https://github.com/official-stockfish/Stockfish/issues/6367
no functional change
2025-11-01 10:34:44 +01:00
Shawn Xu and Joost VandeVondele
472cc764be
Move SIMD code to a separate header
...
Passed Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 115328 W: 29903 L: 29777 D: 55648
Ptnml(0-2): 265, 12293, 32444, 12375, 287
https://tests.stockfishchess.org/tests/view/68300e086ec7634154f9b1d1
closes https://github.com/official-stockfish/Stockfish/pull/6086
no functional change
2025-05-25 20:52:57 +02:00
Disservin and Joost VandeVondele
c13c1d2c30
Silence "may be used uninitialized" GCC 15 warning
...
closes https://github.com/official-stockfish/Stockfish/pull/6083
No functional change
2025-05-23 08:53:00 +02:00
Carlos Esparza and Disservin
63c6f22627
Simplify DirtyPiece
...
Simplifies the DirtyPiece struct.
passed STC: https://tests.stockfishchess.org/tests/view/68054c9798cd372e3aea05d7
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 36608 W: 9641 L: 9437 D: 17530
Ptnml(0-2): 89, 3630, 10668, 3822, 95
passed LTC: https://tests.stockfishchess.org/tests/view/6805514598cd372e3aea0783
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 127620 W: 31993 L: 31894 D: 63733
Ptnml(0-2): 42, 10983, 41665, 11074, 46
closes https://github.com/official-stockfish/Stockfish/pull/6016
No functional change
2025-05-13 20:30:22 +02:00
Carlos Esparza and Disservin
fda269a299
Introduce double incremental accumulator updates
...
when we need to update an accumulator by two moves and the second move
captures the piece moved in the first move, we can skip computing the
middle accumulator and cancel a feature add with a feature remove to
save work.
Passed STC
https://tests.stockfishchess.org/tests/view/67f70b1c31d7cf8afdc45f51
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 72800 W: 18878 L: 18529 D: 35393
Ptnml(0-2): 160, 7711, 20374, 7930, 225
closes https://github.com/official-stockfish/Stockfish/pull/5988
No functional change
2025-04-27 19:27:18 +02:00
Shawn Xu and Joost VandeVondele
f273eea71f
Remove non-functional accumulator reset
...
Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 219360 W: 56600 L: 56583 D: 106177
Ptnml(0-2): 582, 23419, 61620, 23518, 541
https://tests.stockfishchess.org/tests/view/67fad20dcd501869c669780f
closes https://github.com/official-stockfish/Stockfish/pull/5986
no functional change
2025-04-26 21:30:01 +02:00
FauziAkram and Disservin
5f8e67a544
Remove combineLast3 optimization
...
Passed non-reg STC 1st:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 67328 W: 17296 L: 17118 D: 32914
Ptnml(0-2): 158, 7095, 19011, 7211, 189
https://tests.stockfishchess.org/tests/view/67e6c2796682f97da2178ebe
Passed non-reg STC 2nd:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 92288 W: 23885 L: 23734 D: 44669
Ptnml(0-2): 213, 10039, 25518, 10132, 242
https://tests.stockfishchess.org/tests/view/67ed6a2d31d7cf8afdc45190
closes https://github.com/official-stockfish/Stockfish/pull/5975
Bench: 1875196
2025-04-18 14:32:26 +02:00
mstembera and Disservin
1577fa0470
Simplify Forward and Backward
...
Forward and Backward are not independent so simplify to a bool.
Cleanup some MSVC warnings like "warning C4267: 'argument': conversion
from 'size_t' to 'int', possible loss of data" Other minor formatting
stuff.
This is a rebase of https://github.com/official-stockfish/Stockfish/pull/5912
closes https://github.com/official-stockfish/Stockfish/pull/5967
No functional change
2025-04-18 14:32:19 +02:00
Disservin
7beff18ef0
Retire Acc Pointer
...
Since @xu-shawn's refactor the acc pointer has become a bit unnecessary,
we can achieve the same behavior by using the dimension size to get the
right accumulator from the `AccumulatorState`. I think the acc pointer
has become a bit of a burden required to be passed through multiple
different functions together with the necessary templating required.
Passed Non-Regression STC:
https://tests.stockfishchess.org/tests/view/67ed600f31d7cf8afdc45183
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 279744 W: 72037 L: 72082 D: 135625
Ptnml(0-2): 673, 29918, 78767, 29809, 705
closes https://github.com/official-stockfish/Stockfish/pull/5942
No functional change
2025-04-18 13:54:09 +02:00
Shawn Xu and Disservin
c2ff7a95c3
Cleanup fused updates
...
Passed Non-regression STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 70656 W: 18257 L: 18077 D: 34322
Ptnml(0-2): 217, 7912, 18879, 8114, 206
https://tests.stockfishchess.org/tests/view/67e23ae78888403457d876d4
closes https://github.com/official-stockfish/Stockfish/pull/5941
No functional change
2025-04-02 17:34:31 +02:00
Disservin
aafc732bcb
Silence "may be used uninitialized" GCC warning
...
Helps gcc silence the warning about
```
warning: 'added' may be used uninitialized [-Wmaybe-uninitialized]
const IndexType offsetA0 = TransformedFeatureDimensions * added[0];
```
closes https://github.com/official-stockfish/Stockfish/pull/5950
No functional change
2025-03-29 11:55:55 +01:00
Shawn Xu and Disservin
fc0e0a44d4
Refactor accumulator storage/updates
...
Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 115840 W: 29983 L: 29854 D: 56003
Ptnml(0-2): 338, 12990, 31149, 13091, 352
https://tests.stockfishchess.org/tests/view/67d0a044166a3e8781d84223
closes https://github.com/official-stockfish/Stockfish/pull/5927
No functional change
2025-03-21 11:12:47 +01:00