Carlos Esparza
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
Shawn Xu
c2611efe5c
Move history code to a separate header
...
Since no correction histories are ever used inside Movepick, and many
existing histories are closely integrated into search, it might be more
logical to separate them into their own header. PR based on #5650
closes https://github.com/official-stockfish/Stockfish/pull/5652
No functional change
2024-11-13 20:07:15 +01:00
MinetaS
24c57793e1
Remove moveCountPruning in search.cpp
...
The definition of moveCountPruning may cause confusion by implying that
the variable is unconstrained. However, once it is set to true, it
should not be reset to false, otherwise it would break the internal
logic of MovePicker.
Several patches have overlooked this constraint. For example:
https://tests.stockfishchess.org/tests/view/671e7c0486d5ee47d953d226
https://tests.stockfishchess.org/tests/view/66a1de7b4ff211be9d4eccea
The implementation approach was suggested by Disservin.
Passed non-regression STC:
LLR: 3.02 (-2.94,2.94) <-1.75,0.25>
Total: 180672 W: 47072 L: 47006 D: 86594
Ptnml(0-2): 536, 19482, 50247, 19522, 549
https://tests.stockfishchess.org/tests/view/6720df6f86d5ee47d953d542
closes https://github.com/official-stockfish/Stockfish/pull/5661
No functional change
2024-10-31 10:08:34 +01:00
Shawn Xu
4a9c980f3b
Template Corrhist
...
Avoids duplication of `using ... = Stats<int16_t,
CORRECTION_HISTORY_LIMIT, COLOR_NB, CORRECTION_HISTORY_SIZE>;`
closes https://github.com/official-stockfish/Stockfish/pull/5650
No functional change
Co-authored-by: Disservin <disservin.social@gmail.com >
2024-10-31 09:27:12 +01:00
FauziAkram
7f386d109e
Remove material corrHist
...
Passed STC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 80832 W: 21150 L: 20975 D: 38707
Ptnml(0-2): 283, 9531, 20598, 9736, 268
https://tests.stockfishchess.org/tests/view/670302fe86d5ee47d953bd68
Passed LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 46008 W: 11621 L: 11423 D: 22964
Ptnml(0-2): 30, 5072, 12606, 5262, 34
https://tests.stockfishchess.org/tests/view/6704074686d5ee47d953be53
Passed LTC Rebased:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 95814 W: 24340 L: 24195 D: 47279
Ptnml(0-2): 71, 10497, 26602, 10690, 47
https://tests.stockfishchess.org/tests/view/670ae1ac86d5ee47d953c262
closes https://github.com/official-stockfish/Stockfish/pull/5636
Bench: 1119774
2024-10-31 09:25:56 +01:00
Michael Chaly
9766db8139
Make low ply history size fixed
...
Size of low ply history should always be the same, so ensure it.
closes https://github.com/official-stockfish/Stockfish/pull/5630
No functional change
2024-10-12 16:40:55 +02:00
Ömer Faruk Tutkun
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
Michael Chaly
7ac745a736
Refactor root history into low ply history
...
This patch changes root history to low ply history - butterfly history for plies < 4.
Doubles weight of this history for root, latter plies have lesser effect.
Passed STC:
https://tests.stockfishchess.org/tests/view/66f77d2386d5ee47d953b65d
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 180992 W: 47362 L: 46830 D: 86800
Ptnml(0-2): 554, 21499, 45928, 21891, 624
Passed LTC:
https://tests.stockfishchess.org/tests/view/66fb557986d5ee47d953b8e5
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 42462 W: 11013 L: 10682 D: 20767
Ptnml(0-2): 33, 4518, 11795, 4855, 30
closes https://github.com/official-stockfish/Stockfish/pull/5614
Bench 1264335
2024-10-04 08:32:21 +02:00
Shawn Xu
d6043970bd
Make Correction History Size Uniform
...
Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 207232 W: 53834 L: 53802 D: 99596
Ptnml(0-2): 695, 24486, 53200, 24562, 673
https://tests.stockfishchess.org/tests/view/66e9f5a886d5ee47d953ada1
Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 99120 W: 25264 L: 25123 D: 48733
Ptnml(0-2): 66, 10803, 27675, 10956, 60
https://tests.stockfishchess.org/tests/view/66ed7ebc86d5ee47d953b056
Passed Non-regression LTC vs #5606 :
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 208950 W: 53049 L: 53019 D: 102882
Ptnml(0-2): 111, 23232, 57760, 23260, 112
https://tests.stockfishchess.org/tests/view/66f1843886d5ee47d953b2f2
closes https://github.com/official-stockfish/Stockfish/pull/5609
bench 1575189
2024-09-28 18:01:31 +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:
https://github.com/mcthouacbb/Sirius/commit/97b85bbaac88ff5a0f63e28776027dd3de77164e
https://github.com/mcthouacbb/Sirius/commit/3099cdef2f13e29805654b5f8153e6ecd5853195
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:
https://github.com/zzzzz151/Starzix/commit/34911772f178c27b3a239dda0acb79c397c3a2f0
https://github.com/zzzzz151/Starzix/commit/33e0df8dd2db1d4775974ab12e3390154697f47a
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
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
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
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
Shawn Xu
024eb6f453
Unify Movepick Initializer
...
Passed Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 168704 W: 43524 L: 43455 D: 81725
Ptnml(0-2): 414, 17173, 49076, 17308, 381
https://tests.stockfishchess.org/tests/view/66904b7b5034141ae599a197
Passed Non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 120294 W: 30473 L: 30364 D: 59457
Ptnml(0-2): 40, 10974, 38032, 11039, 62
https://tests.stockfishchess.org/tests/view/66905b235034141ae599a223
closes https://github.com/official-stockfish/Stockfish/pull/5477
bench 1459677
2024-07-15 13:18:37 +02:00
Shawn Xu
3df09c04d7
Simplify Away Refutation Stage
...
Simplify away killer stage to a constant bonus given to the killer move during
quiet move scoring.
Passed Non-regression STC (Against then-pending PR #5472 ):
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 106176 W: 27685 L: 27539 D: 50952
Ptnml(0-2): 410, 12765, 26637, 12821, 455
https://tests.stockfishchess.org/tests/view/668dd0835034141ae5999e8f
Passed Non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 92472 W: 23426 L: 23276 D: 45770
Ptnml(0-2): 55, 10376, 25215, 10544, 46
https://tests.stockfishchess.org/tests/view/669019e45034141ae5999fd2
closes https://github.com/official-stockfish/Stockfish/pull/5476
Bench 1459677
2024-07-15 13:15:35 +02:00
yl25946
8d1e41458e
removed second killer move
...
STC with movepicker rewrite:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 46656 W: 12208 L: 11995 D: 22453
Ptnml(0-2): 203, 5461, 11777, 5694, 193
https://tests.stockfishchess.org/tests/view/668d98a15034141ae5999e68
Earlier version passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 468896 W: 120999 L: 120054 D: 227843
Ptnml(0-2): 1207, 55209, 120639, 56218, 1175
https://tests.stockfishchess.org/tests/view/668b17d2cf91c430fca58630
Earlier version passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 550524 W: 139553 L: 139877 D: 271094
Ptnml(0-2): 333, 61646, 151616, 61346, 321
https://tests.stockfishchess.org/tests/view/668b2e04cf91c430fca586b1
closes https://github.com/official-stockfish/Stockfish/pull/5472
bench 1234309
Co-authored-by: rn5f107s2 <clemens.lerchl@gmail.com >
2024-07-11 07:29:49 +02:00
MinetaS
cdb0b96e07
Clean up refutations array in MovePicker
...
This is a follow-up cleanup to a45c2bc34a .
closes https://github.com/official-stockfish/Stockfish/pull/5458
No functional change
2024-07-09 18:34:00 +02:00
Shawn Xu
a45c2bc34a
Simplify Away Countermove Heuristic
...
Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 977824 W: 252072 L: 252888 D: 472864
Ptnml(0-2): 2518, 117120, 250560, 116088, 2626
https://tests.stockfishchess.org/tests/view/6683452d95b0d1e881e81541
Passed Non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 81048 W: 20630 L: 20470 D: 39948
Ptnml(0-2): 36, 8915, 22464, 9071, 38
https://tests.stockfishchess.org/tests/view/66886b7b0c9d7c1ab33ed281
closes https://github.com/official-stockfish/Stockfish/pull/5441
bench 1276784
2024-07-06 17:48:11 +02:00
Disservin
7e427639ce
Add cmath header to movepick.h
...
No functional change
2024-03-20 16:36:18 +01:00
Michael Chaly
ed60460004
Clamp history bonus to stats range
...
Before, one always had to keep track of the bonus one assigns to a history to stop
the stats from overflowing. This is a quality of life improvement. Since this would often go unnoticed during benching.
Passed non-regression bounds:
https://tests.stockfishchess.org/tests/view/65ef2af40ec64f0526c44cbc
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 179232 W: 46513 L: 46450 D: 86269
Ptnml(0-2): 716, 20323, 47452, 20432, 693
closes https://github.com/official-stockfish/Stockfish/pull/5116
No functional change
2024-03-20 16:14:00 +01:00
mstembera
a5a76a6370
Introduce BAD_QUIET movepicker stage
...
Split quiets into good and bad as we do with captures. When we find
the first quiet move below a certain threshold that has been sorted we
consider all subsequent quiets bad. Inspired by @locutus2 idea to skip
bad captures.
Passed STC:
https://tests.stockfishchess.org/tests/view/6597759f79aa8af82b95fa17
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 138688 W: 35566 L: 35096 D: 68026
Ptnml(0-2): 476, 16367, 35183, 16847, 471
Passed LTC:
https://tests.stockfishchess.org/tests/view/6598583c79aa8af82b960ad0
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 84108 W: 21468 L: 21048 D: 41592
Ptnml(0-2): 38, 9355, 22858, 9755, 48
closes https://github.com/official-stockfish/Stockfish/pull/4970
Bench: 1336907
2024-01-07 13:41:50 +01:00
Disservin
b987d4f033
Use type aliases instead of enums for Value types
...
The primary rationale behind this lies in the fact that enums were not
originally designed to be employed in the manner we currently utilize them.
The Value enum was used like a type alias throughout the code and was often
misused. Furthermore, changing the underlying size of the enum to int16_t broke
everything, mostly because of the operator overloads for the Value enum, were
causing data to be truncated. Since Value is now a type alias, the operator
overloads are no longer required.
Passed Non-Regression STC:
https://tests.stockfishchess.org/tests/view/6593b8bb79aa8af82b95b401
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 235296 W: 59919 L: 59917 D: 115460
Ptnml(0-2): 743, 27085, 62054, 26959, 807
closes https://github.com/official-stockfish/Stockfish/pull/4960
No functional change
2024-01-04 15:54:23 +01:00
Disservin
cafbe8e8e8
Change the Move enum to a class
...
This changes the Move enum to a class, this way
all move related functions can be moved into the class
and be more self contained.
closes https://github.com/official-stockfish/Stockfish/pull/4958
No functional change
2024-01-04 15:51:04 +01:00
Disservin
444f03ee95
Update copyright year
...
closes https://github.com/official-stockfish/Stockfish/pull/4954
No functional change
2024-01-04 15:47:10 +01:00
Michael Chaly
b4d995d0d9
Introduce static evaluation correction history
...
Idea from Caissa (https://github.com/Witek902/Caissa ) chess engine.
With given pawn structure collect data with how often search result and by how
much it was better / worse than static evalution of position and use it to
adjust static evaluation of positions with given pawn structure. Details:
1. excludes positions with fail highs and moves producing it being a capture;
2. update value is function of not only difference between best value and static
evaluation but also is multiplied by linear function of depth;
3. maximum update value is maximum value of correction history divided by 2;
4. correction history itself is divided by 32 when applied so maximum value of
static evaluation adjustment is 32 internal units.
Passed STC:
https://tests.stockfishchess.org/tests/view/658fc7b679aa8af82b955cac
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 128672 W: 32757 L: 32299 D: 63616
Ptnml(0-2): 441, 15241, 32543, 15641, 470
Passed LTC:
https://tests.stockfishchess.org/tests/view/65903f6979aa8af82b9566f1
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 97422 W: 24626 L: 24178 D: 48618
Ptnml(0-2): 41, 10837, 26527, 11245, 61
closes https://github.com/official-stockfish/Stockfish/pull/4950
Bench: 1157852
2023-12-31 20:00:06 +01:00
FauziAkram
a069a1bbbf
Use std::abs over abs
...
closes https://github.com/official-stockfish/Stockfish/pull/4926
closes https://github.com/official-stockfish/Stockfish/pull/4909
No functional change
Co-Authored-By: fffelix-huang <72808219+fffelix-huang@users.noreply.github.com >
2023-12-19 18:22:10 +01:00
cj5716
15d47a2b38
Remove recaptures stage in qsearch
...
Simplify an old commit
https://github.com/official-stockfish/Stockfish/commit/72760c05c64d1fb2bb71c2ac54acfbeecf513b87 .
Search is not stuck on the test position given
r1n1n1b1/1P1P1P1P/1N1N1N2/2RnQrRq/2pKp3/3BNQbQ/k7/4Bq2 w - - 0 1
Passed STC:
https://tests.stockfishchess.org/tests/view/6567050d136acbc573550919
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 236160 W: 59475 L: 59475 D: 117210
Ptnml(0-2): 841, 28266, 59816, 28366, 791
Passed LTC:
https://tests.stockfishchess.org/tests/view/6567d133136acbc573551c78
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 201690 W: 49630 L: 49593 D: 102467
Ptnml(0-2): 128, 23214, 54122, 23255, 126
closes https://github.com/official-stockfish/Stockfish/pull/4896
Bench: 1604361
2023-12-02 11:45:38 +01:00
Stefan Geschwentner
13426a93c1
Simplify history update.
...
Removal of the slowdown factor from the history update formula with
corresponding adjustment of the stat bonus used in the search.
Passed STC:
https://tests.stockfishchess.org/tests/view/655e1079136acbc573544744
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 128096 W: 32355 L: 32235 D: 63506
Ptnml(0-2): 466, 15187, 32573, 15405, 417
Passed LTC:
https://tests.stockfishchess.org/tests/view/655f4e60136acbc573546266
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 50652 W: 12653 L: 12459 D: 25540
Ptnml(0-2): 28, 5666, 13751, 5846, 35
closes https://github.com/official-stockfish/Stockfish/pull/4883
Bench: 1303857
2023-12-02 11:23:15 +01:00
FauziAkram
b4e9ee72e3
Reformat some comments
...
Tests used to derive some Elo worth comments:
https://tests.stockfishchess.org/tests/view/653cf6b7cc309ae83956263a
https://tests.stockfishchess.org/tests/view/655250b7136acbc573534711
https://tests.stockfishchess.org/tests/view/65525767136acbc5735347b9
https://tests.stockfishchess.org/tests/view/65525aa1136acbc573534801
closes https://github.com/official-stockfish/Stockfish/pull/4879
No functional change
2023-11-20 19:10:38 +01:00
Taras Vuk
d0e87104aa
Remove pawn history from ProbCut constructor
...
use same style as other history tables
Passed STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 184672 W: 46953 L: 46896 D: 90823
Ptnml(0-2): 604, 21095, 48887, 21140, 610
https://tests.stockfishchess.org/tests/view/654766b4136acbc573526602
closes https://github.com/official-stockfish/Stockfish/pull/4865
No functional change
2023-11-07 08:23:11 +01:00
Shahin M. Shahin
791419aab5
Enhance some comments
...
This documents some code and makes some hard code easier to understand for new developers.
closes https://github.com/official-stockfish/Stockfish/pull/4862
No functional change
2023-11-05 19:51:02 +01:00
cj5716
38aa70adcf
Small cleanups
...
Corrects some incorrect or outdated comments.
Credit is shared with yaneurao (see 38e830a#commitcomment-131131500) and locutus2
closes #4852
No functional change.
2023-10-30 07:49:15 +01:00
Michael Chaly
b0658f09b9
Introduce pawn structure based history
...
Original idea by Seer chess engine https://github.com/connormcmonigle/seer-nnue ,
coding done by @Disservin, code refactoring done by @locutus2 to match the style
of other histories.
This patch introduces pawn structure based history, which assings moves values
based on last digits of pawn structure hash and piece type of moved piece and
landing square of the move. Idea is that good places for pieces are quite often
determined by pawn structure of position. Used in 3 different places
- sorting of quiet moves, sorting of quiet check evasions and in history based
pruning in search.
Passed STC:
https://tests.stockfishchess.org/tests/view/65391d08cc309ae83955dbaf
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 155488 W: 39408 L: 38913 D: 77167
Ptnml(0-2): 500, 18427, 39408, 18896, 513
Passed LTC:
https://tests.stockfishchess.org/tests/view/653a36a2cc309ae83955f181
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 70110 W: 17548 L: 17155 D: 35407
Ptnml(0-2): 33, 7859, 18889, 8230, 44
closes https://github.com/official-stockfish/Stockfish/pull/4849
Bench: 1257882
Co-Authored-By: Disservin <disservin.social@gmail.com >
Co-Authored-By: Stefan Geschwentner <locutus2@users.noreply.github.com >
2023-10-27 17:24:25 +02:00
Disservin
2d0237db3f
add clang-format
...
This introduces clang-format to enforce a consistent code style for Stockfish.
Having a documented and consistent style across the code will make contributing easier
for new developers, and will make larger changes to the codebase easier to make.
To facilitate formatting, this PR includes a Makefile target (`make format`) to format the code,
this requires clang-format (version 17 currently) to be installed locally.
Installing clang-format is straightforward on most OS and distros
(e.g. with https://apt.llvm.org/ , brew install clang-format, etc), as this is part of quite commonly
used suite of tools and compilers (llvm / clang).
Additionally, a CI action is present that will verify if the code requires formatting,
and comment on the PR as needed. Initially, correct formatting is not required, it will be
done by maintainers as part of the merge or in later commits, but obviously this is encouraged.
fixes https://github.com/official-stockfish/Stockfish/issues/3608
closes https://github.com/official-stockfish/Stockfish/pull/4790
Co-Authored-By: Joost VandeVondele <Joost.VandeVondele@gmail.com >
2023-10-22 16:06:27 +02:00
mstembera
8366ec48ae
Scale down stat bonus
...
STC https://tests.stockfishchess.org/tests/view/652eff58de6d262d08d33353
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 88224 W: 22618 L: 22228 D: 43378
Ptnml(0-2): 282, 10177, 22783, 10609, 261
LTC https://tests.stockfishchess.org/tests/view/652fd13bde6d262d08d3481a
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 143508 W: 36674 L: 36142 D: 70692
Ptnml(0-2): 92, 15240, 40534, 15820, 68
Reduces the stat bonus by 20%. Maybe future patches can tune the actual bonus calculations for different histories.
closes https://github.com/official-stockfish/Stockfish/pull/4836
bench: 1185932
2023-10-21 10:37:27 +02:00
FauziAkram
edb4ab924f
Standardize Comments
...
use double slashes (//) only for comments.
closes #4820
No functional change.
2023-10-21 10:25:03 +02:00
Sebastian Buchwald
4f0fecad8a
Use C++17 variable templates for type traits
...
The C++17 variable templates are slightly more readable and allow us to
remove the typename keyword in a few cases.
closes https://github.com/official-stockfish/Stockfish/pull/4806
No functional change
2023-09-29 22:22:40 +02:00
Disservin
3c0e86a91e
Cleanup includes
...
Reorder a few includes, include "position.h" where it was previously missing
and apply include-what-you-use suggestions. Also make the order of the includes
consistent, in the following way:
1. Related header (for .cpp files)
2. A blank line
3. C/C++ headers
4. A blank line
5. All other header files
closes https://github.com/official-stockfish/Stockfish/pull/4763
fixes https://github.com/official-stockfish/Stockfish/issues/4707
No functional change
2023-09-03 08:24:51 +02:00
Miguel Lahoz
1fee996999
Remove unneeded bitboard from MP
...
Recent simplification has removed the need for an extra bitboard in MP struct.
Use a local variable instead.
STC: Passed Non-regression test
https://tests.stockfishchess.org/tests/view/64294ae677ff3301150cba16
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 64872 W: 17383 L: 17203 D: 30286
Ptnml(0-2): 179, 6675, 18546, 6859, 177
closes https://github.com/official-stockfish/Stockfish/pull/4490
No functional change.
2023-04-05 08:10:34 +02:00
Miguel Lahoz
a9c26357de
Clean up repetitive declarations for see_ge
...
The occupied bitboard is only used in one place and is otherwise thrown away.
To simplify use, see_ge function can instead be overloaded.
Repetitive declarations for occupied bitboard can be removed.
Passed non-regression test
https://tests.stockfishchess.org/tests/view/6421c286db43ab2ba6f908eb
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 48912 W: 13196 L: 13001 D: 22715
Ptnml(0-2): 146, 5003, 13967, 5190, 150
closes https://github.com/official-stockfish/Stockfish/pull/4469
No functional change.
2023-03-29 21:43:07 +02:00
pb00067
24b37e4586
Verified SEE pruning for capturing and checking moves.
...
Patch analyzes field after SEE exchanges concluded with a recapture by
the opponent:
if opponent Queen/Rook/King results under attack after the exchanges, we
consider the move sharp and don't prune it.
Important note:
By accident I forgot to adjust 'occupied' when the king takes part in
the exchanges.
As result of this a move is considered sharp too, when opponent king
apparently can evade check by recapturing.
Surprisingly this seems contribute to patch's strength.
STC:
https://tests.stockfishchess.org/tests/view/640b16132644b62c33947397
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 116400 W: 31239 L: 30817 D: 54344
Ptnml(0-2): 350, 12742, 31618, 13116, 374
LTC:
https://tests.stockfishchess.org/tests/view/640c88092644b62c3394c1c5
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 177600 W: 47988 L: 47421 D: 82191
Ptnml(0-2): 62, 16905, 54317, 17436, 80
closes https://github.com/official-stockfish/Stockfish/pull/4453
bench: 5012145
2023-03-25 09:17:44 +01:00
Sebastian Buchwald
564456a6a8
Unify type alias declarations
...
The commit unifies the declaration of type aliases by replacing all
typedefs with corresponding using statements.
closing https://github.com/official-stockfish/Stockfish/pull/4412
No functional change
2023-02-27 08:29:47 +01:00
Sebastian Buchwald
b60f9cc451
Update copyright years
...
Happy New Year!
closes https://github.com/official-stockfish/Stockfish/pull/4315
No functional change
2023-01-02 19:07:38 +01:00
VoyagerOne
c7118fb46d
Simply do full sort on captures.
...
STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 42712 W: 11413 L: 11203 D: 20096
Ptnml(0-2): 145, 4661, 11544, 4851, 155
https://tests.stockfishchess.org/tests/view/6384df57d2b9c924c4c53900
LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 239072 W: 64065 L: 64067 D: 110940
Ptnml(0-2): 106, 23735, 71859, 23727, 109
https://tests.stockfishchess.org/tests/view/63851120d2b9c924c4c541ee
closes https://github.com/official-stockfish/Stockfish/pull/4249
Bench: 3467381
2022-12-02 20:05:50 +01:00
disservin
f436bf77ad
Use less reduction for escaping moves
...
This patch reuses the threatenedPieces variable (which is calculated in movepicker)
to reduce less in the search tree the moves which escape a capture.
passed STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 314352 W: 84042 L: 83328 D: 146982
Ptnml(0-2): 1105, 35084, 84207, 35552, 1228
https://tests.stockfishchess.org/tests/view/63355f37a004bed9a2e4a17f
passed LTC:
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 90752 W: 24556 L: 24147 D: 42049
Ptnml(0-2): 59, 8855, 27123, 9296, 43
https://tests.stockfishchess.org/tests/view/63383a7735f43d649ff5fa8b
closes https://github.com/official-stockfish/Stockfish/pull/4181
bench: 4114228
2022-10-03 11:50:31 +02:00
Stefan Geschwentner
675f6a038b
Tweak history updates
...
In general the history update bonus is slightly decreased by 11% which gives a slower saturation speed.
In addition only for main history the divisor is halfed (used history values are doubled to maintain same maximum)
which have an effect in the opposite direction on saturation speed.
STC:
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 157088 W: 42673 L: 42168 D: 72247
Ptnml(0-2): 857, 17346, 41642, 17833, 866
https://tests.stockfishchess.org/tests/view/62e5517ab383a712b13867c5
LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 325592 W: 88705 L: 87753 D: 149134
Ptnml(0-2): 594, 32288, 96076, 33248, 590
https://tests.stockfishchess.org/tests/view/62e5e4f4b383a712b1387d53
closes https://github.com/official-stockfish/Stockfish/pull/4119
Bench: 5518728
2022-08-06 13:50:01 +02:00
Michael Chaly
8fadbcf1b2
Add info about elo gained from some heuristics
...
Add info about qsearch and impact of main and continuation histories.
Based on these tests:
https://tests.stockfishchess.org/tests/view/62946ffcb0d5a7d1b780fc7e
https://tests.stockfishchess.org/tests/view/628facb71e7cd5f299669534
https://tests.stockfishchess.org/tests/view/628eade11e7cd5f299666f2e
closes https://github.com/official-stockfish/Stockfish/pull/4041
No functional change.
2022-06-02 07:43:14 +02:00
Giacomo Lorenzetti
4ac7d726ec
Sort captures
...
This patch (partially) sort captures in analogy to quiet moves. All
three movepickers are affected, hence `depth` is added as an argument in
probcut's.
Passed STC:
https://tests.stockfishchess.org/tests/view/621a4576da649bba32ef6fd4
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 103848 W: 27884 L: 27473 D: 48491
Ptnml(0-2): 587, 11691, 26974, 12068, 604
Passed LTC:
https://tests.stockfishchess.org/tests/view/621aaa5bda649bba32ef7c2d
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 212032 W: 56420 L: 55739 D: 99873
Ptnml(0-2): 198, 21310, 62348, 21933, 227
closes https://github.com/official-stockfish/Stockfish/pull/3952
Bench: 6833580
2022-03-01 17:51:37 +01:00
Brad Knox
ad926d34c0
Update copyright years
...
Happy New Year!
closes https://github.com/official-stockfish/Stockfish/pull/3881
No functional change
2022-01-06 15:45:45 +01:00