1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00
Commit graph

3957 commits

Author SHA1 Message Date
Alain SAVARD
43f6b33e50 Small eval cleanup and renaming
Non-functional changes

a) splitting the threat array to avoid using an enum
b) reorder the scores according to functions where they are used.
c) declarations in evaluate_pieces after the const(s) like elsewhere
d) more compact definitions of KingFlank,
now that we need it also for the PanwLessFlank penalty.
e) reuse CenterFiles in evaluate_space
f) move one line inside next popcount

No functional change.
2016-12-31 14:15:57 +01:00
lucasart
ab4f498bbc Remove SafeCheck (#946)
It was a bit of a hack, without intrinsic value, but rather compensating for the
fact that checks were mistuned.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 88308 W: 15553 L: 15545 D: 57210

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 53115 W: 6741 L: 6662 D: 39712

bench 5468995
2016-12-31 13:52:42 +01:00
Jörg Oster
8765f9ce16 Further simplify unstoppable (#938)
By finally moving it into passed pawns eval.

Tested for no regression:
STC
LLR: 3.25 (-2.94,2.94) [-3.00,1.00]
Total: 57109 W: 10023 L: 9947 D: 37139

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 21511 W: 2800 L: 2680 D: 16031

Bench: 5255881
2016-12-25 10:44:56 +01:00
hxim
3728e833aa Fix psqt format and use smaller numbers in king psqt (#940)
Fix minus sign in pawn psqt and use smaller numbers in king psqt.

No functional change.
2016-12-25 10:40:17 +01:00
Joost VandeVondele
af7412e58a Explicitly use alpha+1 for beta in NonPV search (#939)
Fixes the only exception, in razoring.

The code already does assert(PvNode || (alpha == beta - 1)), and it can be verified by studying the program flow that this is indeed the case, also for the modified line.

No functional change.
2016-12-25 10:34:48 +01:00
Joost VandeVondele
1ceaea701b Simplify threshold handling for probcut. (#936)
Just use greater equal as this is what see_ge does now.

passed STC
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 226506 W: 39755 L: 39978 D: 146773

passed LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 138483 W: 17450 L: 17479 D: 103554

Bench: 5212921
2016-12-22 16:02:32 +01:00
Stefano Cardanobile
f72b7dc99a piecesCount (#932)
All counts in search.cpp are of the form xxxCount. Conform piecesCnt to this unwritten rule.

No functional change.
2016-12-20 11:18:19 +01:00
Joost VandeVondele
ee22b61f5e Use DEPTH_ZERO initializer for depth in qsearch (#931)
Simplifies the main search function.

No functional change.
2016-12-20 11:17:38 +01:00
VoyagerOne
8c61bbda54 Another simplification for SEE pruning
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 29310 W: 5225 L: 5118 D: 18967

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 128454 W: 16424 L: 16442 D: 95588

Bench: 4556848
2016-12-17 08:37:58 +01:00
Stefan Geschwentner
847bc0e80f Simplify pruning
STC: http://tests.stockfishchess.org/tests/view/5842be140ebc5903140c5619
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 16014 W: 2839 L: 2710 D: 10465

LTC: http://tests.stockfishchess.org/tests/view/584316a50ebc5903140c5638
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 182360 W: 22830 L: 22914 D: 136616

Retested at LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 45502 W: 5821 L: 5732 D: 33949

Bench: 4684146
2016-12-12 12:01:16 +01:00
Joost VandeVondele
1b62d413c1 Clean-up skipEarlyPruning (#921)
make skipEarlyPruning a search argument instead of managing this by hand.

Verified for no regression at STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 96754 W: 17089 L: 17095 D: 62570

No functional change.
2016-12-11 20:05:25 +01:00
Jonathan Calovski
589049a0e5 Simplify unstoppable condition
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 86389 W: 15165 L: 15153 D: 56071

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 98143 W: 12311 L: 12288 D: 73544

Bench: 5437987
2016-12-11 19:57:02 +01:00
Joost VandeVondele
a47bbca0ea Refactor bonus and penalty calculation (#917)
* Refactor bonus and penalty calculation

Compute common terms in a helper function.

No functional change.

* Further refactoring

Remove some parenthesis that are now useless.
Define prevSq once, use repeatedly.

No functional change.

bench: 5884767 (bench of previous patch is wrong)
2016-12-05 18:58:12 +01:00
Stéphane Nicolet
0d33466bcd Pawn flank attacks
This patch tweaks some pawn values to favor flank attacks.

The first part of the patch increases the midgame psqt values of external pawns to launch more attacks (credits to user GuardianRM for this idea), while the second part increases the endgame connection values for pawns on upper ranks.

Passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 34997 W: 6328 L: 6055 D: 22614

and LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 13844 W: 1832 L: 1650 D: 10362

Bench: 5884767
2016-12-05 18:49:07 +01:00
ElbertoOne
46d066b041 Remove piece condition in decrease lmr reduction check
STC: http://tests.stockfishchess.org/tests/view/584154780ebc5903140c55cf
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 40866 W: 7251 L: 7164 D: 26451

LTC: http://tests.stockfishchess.org/tests/view/5841e6e50ebc5903140c5605
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 62413 W: 7948 L: 7881 D: 46584

Bench: 5807913
2016-12-04 09:28:55 +01:00
Andrey Neporada
bf8b45fe63 Help GCC to optimize msb() to single instruction
GCC compiles builtin_clzll to “63 ^ BSR”. BSR is processor instruction "Bit Scan Reverse".
So old msb() function is basically 63 - 63 ^ BSR.
Unfortunately, GCC fails to simplify this expression.

Old function compiles to

    bsrq    %rdi, %rdi
    movl    $63, %eax
    xorq    $63, %rdi
    subl    %edi, %eax
    ret

New function compiles to

    bsrq    %rdi, %rax
    ret

BTW, Clang compiles both function to the same (optimal) code.

No functional change.
2016-12-03 09:37:07 +01:00
goodkov
e70da0d2eb Simplify pruning rule
STC: http://tests.stockfishchess.org/tests/view/583df86d0ebc5903140c5481
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 43283 W: 7761 L: 7678 D: 27844

LTC: http://tests.stockfishchess.org/tests/view/583f42670ebc5903140c5525
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 56587 W: 7232 L: 7157 D: 42198

bench: 5084980
2016-12-02 09:04:45 +01:00
Joost VandeVondele
1e76ba7cec WeakQueen Parameter tweak
New tuned values.

passed STC
http://tests.stockfishchess.org/tests/view/5834573c0ebc5903140c507b
LLR: 3.16 (-2.94,2.94) [0.00,4.00]
Total: 157415 W: 27917 L: 27227 D: 102271

passed LTC
http://tests.stockfishchess.org/tests/view/58388d2b0ebc5903140c523b
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 95405 W: 12350 L: 11959 D: 71096

Bench: 4912054
2016-12-01 14:55:00 +01:00
ElbertoOne
535435b7fc TrappedRook simplification
Just remove rank checks for rook and king for TrappedRook evaluation.

STC: http://tests.stockfishchess.org/tests/view/5833fdfc0ebc5903140c5050
LLR: 3.03 (-2.94,2.94) [-3.00,1.00]
Total: 34474 W: 6088 L: 5986 D: 22400

LTC: http://tests.stockfishchess.org/tests/view/58392f3f0ebc5903140c5276
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 48358 W: 6221 L: 6136 D: 36001

bench: 5536128
2016-11-27 17:42:20 +01:00
theo77186
7a3844e6ef Fix PGO build with GCC (#904) 2016-11-27 14:43:52 +01:00
Michael Byrne
fbb2ffacfd Fix PGO Build for clang
This fixes https://github.com/official-stockfish/Stockfish/issues/167.

Additional improvments by Joost VandeVondele.
2016-11-27 10:03:52 +01:00
joergoster
8f30d233f8 Fix trace in case of space evaluation
We only compute space eval during the opening/early midgame.
Apply the same logic for DoTrace.

No functional change.
2016-11-27 09:28:32 +01:00
Marco Costalba
ec83e8a72c Fix regression: print const position
Fix a regression introduced with new TB code.

No functional change.
2016-11-27 09:11:56 +01:00
mbootsector
e7289465b9 Rank based threats
STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 19404 W: 3581 L: 3374 D: 12449

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 16204 W: 2194 L: 2023 D: 11987

Bench: 5757843
2016-11-27 09:05:57 +01:00
Joost VandeVondele
8ceb1ff53b Fix undefined behavior
This fixes #892. Undefined behavior as seen with
clang -fsanitize=undefined.

No functional change.
2016-11-26 16:49:59 +01:00
Marco Costalba
2ec626ddae Fix compile under Windows XP
The needed Windows API for processor groups could be missed from old Windows
versions, so instead of calling them directly (forcing the linker to resolve
the calls at compile time), try to load them at runtime. To do this we need
first to define the corresponding function pointers.

Also don't interfere with running fishtest on numa hardware with Windows.
Avoid all stockfish one-threaded processes will run on the same node

No functional change.
2016-11-26 07:04:17 +01:00
Aram Tumanian
9eccba7761 Fix the pawn hash failure when the pawn key is 0
This patch fixed bugs #859 and #882.
At initialization we generate a new random key (Zobrist::noPawns).
It's added to the pawn key of all positions, so that the pawn key
of a pawnless position is no longer 0.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 21307 W: 3738 L: 3618 D: 13951

LTC:
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 45270 W: 5737 L: 5648 D: 33885

No functional change.
2016-11-25 08:48:35 +01:00
erbsenzaehler
ca464fc89e Cleanup Makfile for MacOs
1) Explicitly setting the default lib to the system-default is not
   needed on a Mac. See:
   http://libcxx.llvm.org/docs/UsingLibcxx.html

2) We do no longer need to exclude bmi2-builds from LTO. See:
   https://llvm.org/bugs/show_bug.cgi?id=19416

Changes tested and discussed on FishCooking:
   https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/acUQtKtEzMM

No functional change.
2016-11-25 08:46:20 +01:00
Marco Costalba
0d9a9f5e98 Handle Windows Processors Groups
Under Windows it is not possible for a process to run on more than one
logical processor group. This usually means to be limited to use max 64
cores. To overcome this, some special platform specific API should be
called to set group affinity for each thread. Original code from Texel by
Peter sterlund.

Tested by Jean-Paul Vael on a Xeon E7-8890 v4 with 88 threads and confimed
speed up between 44 and 88 threads is about 30%, as expected.

No functional change.
2016-11-22 07:56:04 +01:00
Joost VandeVondele
6036303bb6 Avoid touching source files in profile-build
This refines the profile-build target to avoid 'touch'ing the sources,
keeping meaningful modification dates and avoiding editor warnings like vi's:

WARNING: The file has been changed since reading it!!!
Do you really want to write to it (y/n)?

Instead of touching sources, the (instrumented) object files are removed,
which has the same effect of rebuilding them in the next step.

As a side effect, this simplifies the Makefile a bit.

No functional change.
2016-11-20 10:51:42 +01:00
Fabian Beuke
b5d10d17c2 Reduce variable scope in swap_byte
Added a specialization to remove the 'if' condition

No functional change.
2016-11-19 21:31:24 +01:00
Aram Tumanian
797602938d Start searching for a repetition from the 4th ply behind
A position can never repeat the one on the previous move.
Thus we can start searching for a repetition from the 4th
ply behind. In the case:

 std::min(st->rule50, st->pliesFromNull) < 4

We don't need to do any more calculations. This case happens
very often - in more than a half of all calls of the function.

No functional change.
2016-11-19 10:20:28 +01:00
Alain SAVARD
76d113f5f0 Pawn shelter and pawn storm tuned
Based on SPSA tuned values

Passed STC
http://tests.stockfishchess.org/tests/view/582363b30ebc5910626b9ca8
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 40628 W: 7380 L: 7087 D: 26161

and passed LTC
http://tests.stockfishchess.org/tests/view/5823b73b0ebc5910626b9cb5
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 273312 W: 35991 L: 35131 D: 202190

bench: 5773672
2016-11-19 09:42:11 +01:00
Marco Costalba
18df1698f4 Fix compile error from previous patch
Due to different types on some platforms.

No functional change.
2016-11-19 09:35:57 +01:00
Stéphane Nicolet
7f4de0196b Do not use GCC extension for anonymous unions
Anonymous struct inside anonymous unions are a GCC extension.
This patch uses named structs to stick to the C+11 standard.

Avoids a string of warnings on the Clang compiler.

Non functional change (same bench and same MD5 signature,
so compiled code is exactly the same as in current master)
2016-11-19 09:22:49 +01:00
Joost VandeVondele
cddc8d4546 More accurate 'go nodes' searches at low count
Makes the actual number of nodes searched match closely
the number of nodes requested, by increasing the frequency
of checking the number of nodes searched at low node count.
All other searches retain the default checking frequency of
once per 4096 nodes, and are thus unaffected.

Passed STC as non-regression
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 26643 W: 4766 L: 4655 D: 17222

No functional change.
2016-11-19 08:47:41 +01:00
Stefan Geschwentner
a90fc4c877 Non-quiet pruning tweak
Count in the difference of static evaluation
and alpha for pruning threshold.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 16885 W: 3061 L: 2866 D: 10958

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 33566 W: 4428 L: 4202 D: 24936

Bench: 5513149
2016-11-19 08:37:52 +01:00
Aram Tumanian
e6c2899020 Make a version of Position::do_move() without the givesCheck parameter
In 10 of 12 calls total to Position::do_move()the givesCheck argument is
simply gives_check(m). So it's reasonable to make an overload without
this parameter, which wraps the existing version.

No functional change.
2016-11-12 09:55:12 +01:00
joergoster
de269ee18e FEN parsing: add a second check for correctly setting e.p. square
Currently, we only check if there is a pawn in place
to make the en-passant capture. Now also check that
there is a pawn that could just have advanced two
squares. Also update the corresponding comment.

This makes the parsing of FENs a bit more robust, and
now correctly handles positions like the one reported by Dann Corbit.

position fen rnbqkb1r/ppp3pp/3p1n2/3P4/8/2P5/PP3PPP/RNBQKB1R w KQkq e6
d

 +---+---+---+---+---+---+---+---+
 | r | n | b | q | k | b |   | r |
 +---+---+---+---+---+---+---+---+
 | p | p | p |   |   |   | p | p |
 +---+---+---+---+---+---+---+---+
 |   |   |   | p |   | n |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   | P |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   | P |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 | P | P |   |   |   | P | P | P |
 +---+---+---+---+---+---+---+---+
 | R | N | B | Q | K | B |   | R |
 +---+---+---+---+---+---+---+---+

Fen: rnbqkb1r/ppp3pp/3p1n2/3P4/8/2P5/PP3PPP/RNBQKB1R w KQkq - 0 1

No functional change.
2016-11-10 11:45:51 +01:00
Mira
dc4655e1f9 Stack offset changed from -5 to -4
Non functional change, tests under sanitizers OK.

Rationales for change

- Offset in code is in range -4 ... 2
- There was an error by (pathological) corner case MAX_PLY=0

No functional change.
2016-11-10 11:43:21 +01:00
atumanian
0fa80c9ba3 Update comments related after new see_ge()
Update comments according to changes from my patch: #822

No functional change.
2016-11-10 11:40:31 +01:00
Joost VandeVondele
61c727fdcb Allow benches with more than 2G nodes.
./stockfish bench 128 1 4000000000 default nodes

    crashes before, works after.

    No functional change.
2016-11-07 13:35:28 +01:00
Joost VandeVondele
876f07cbee Fix undefined behaviour with unaligned loads in syzygy code
Casting a pointer to a different type with stricter alignment
requirements yields to implementation dependent behaviour.
Practicaly everything is fine for common platforms because the
CPU/OS/compiler will generate correct code, but anyhow it is
better to be safe than sorry.

Testing with dbg_hit_on() shows that the unalignment accesses are
very rare (below 0.1%) so it makes sense to split the code in a
fast path for the common case and a slower path as a fallback.

No functional change (verified with TB enabled).
2016-11-06 11:48:07 +01:00
ppigazzini
f5d3f0ded6 Update AUTHORS for SF8
And format top contriutor (space instead of tabs, proper Unix
line endings).
2016-11-06 10:28:17 +01:00
Marco Costalba
e4659693de Fix a warning with debug=no
Warning in TB code due to unused variable.

Verified same bench with TB code enabled.

No functional change.
2016-11-06 09:45:25 +01:00
Joost VandeVondele
52cb348023 Reproducible searches after ucinewgame
Fixes issue #859.

thisThread->callsCnt in search<>() was different (by 1) for the first and second game played.

No functional change.
2016-11-05 22:25:55 +01:00
Marco Costalba
0d669be76c Restore development version
No functional change.
2016-11-05 09:32:39 +01:00
Marco Costalba
23f384cac3 Add explicit braces and fix a warning
Warning under both gcc and clang.

No functional change.
2016-11-05 09:29:22 +01:00
VoyagerOne
b915fdc889 Reduction Simplification
Simplify reduction formula by removing a parameter.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 35798 W: 6368 L: 6272 D: 23158

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 125375 W: 15827 L: 15839 D: 93709

Bench: 4735038
2016-11-05 08:17:42 +01:00
Joost VandeVondele
67d19447f4 Makefile fix for sanitize
Small fixes for compilation with sanitize=yes optimize=no,
by always adding -fsanitize=undefined to the LDFLAGS as required.
Updates config-sanity to check&report the status of the flag.

No functional change.
2016-11-05 08:15:56 +01:00