Marco Costalba [Sat, 4 Jun 2016 05:53:29 +0000 (07:53 +0200)]
Filter root moves filter before copy to threads
Currently root moves are copied to all teh threads
but are DTZ filtered only in main thread at the
beginning of teh search.
This patch moves the TB filtering before the
copy of root moves fixing issue #679
https://github.com/official-stockfish/Stockfish/issues/679
No bench change.
VoyagerOne [Wed, 8 Jun 2016 15:21:43 +0000 (11:21 -0400)]
Stat Formula Tweak
bonus = d * d + 2 * d - 2
STC:
LLR: 2.94 (-2.94,2.94) [0.00,4.00]
Total: 99444 W: 18274 L: 17778 D: 63392
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 89757 W: 12285 L: 11896 D: 65576
bench:
8276130
VoyagerOne [Mon, 6 Jun 2016 13:39:26 +0000 (09:39 -0400)]
Tweak check extension condition
There are two concepts with this patch:
Limit check extensions by using move count.
The idea is to limit search explosion.
Always extend check if the first move gives check.
The idea is to save expensive SEE calls, since the vast
majority of first move will have SEE value >= 0, also
first move may still be strong even if the SEE is negative.
STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 16503 W: 3068 L: 2873 D: 10562
LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 37202 W: 5261 L: 5014 D: 26927
bench:
8543366
Alain SAVARD [Sat, 4 Jun 2016 13:57:17 +0000 (09:57 -0400)]
Small Queen simplification
Moving a few lines from evaluate_threats to evaluate_pieces allows to
a) Remove a condition pos.count<QUEEN>(Them) == 1
b) use precalculated s instead of pos.square(Them)
c) do not check the condition at all in queenless endings
Passed STC
http://tests.stockfishchess.org/tests/view/
5752e0410ebc59029919b1f4
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 67175 W: 12194 L: 12152 D: 42829
and LTC
http://tests.stockfishchess.org/tests/view/
57587b140ebc59029919b2f4
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 20276 W: 2774 L: 2653 D: 14849
bench:
7907962
mstembera [Wed, 8 Jun 2016 00:09:57 +0000 (17:09 -0700)]
Avoid some redundant scaling function calls
Posted by Mohammed Li here:
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/N-PHfN0O79o
No functional change.
ElbertoOne [Sat, 4 Jun 2016 05:10:43 +0000 (07:10 +0200)]
LMR reduction parameter tweak
More reduction for cut nodes, less for moves that escape a capture:
STC (http://tests.stockfishchess.org/tests/view/
57548c1e0ebc59029919b247):
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 60165 W: 11519 L: 11149 D: 37497
LTC (http://tests.stockfishchess.org/tests/view/
57555b570ebc59029919b260):
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 10353 W: 1493 L: 1317 D: 7543
Bench:
8902859
Marco Costalba [Sun, 29 May 2016 08:10:39 +0000 (10:10 +0200)]
Fix syzygy DTZ bug
In this position: 3K4/8/3k4/8/4p3/4B3/5P2/8 w - - 0 5
Current DTZ probe returns 1 instead of 15
What happens is that the double push f4 is erroneously detected as a win move.
After the push we have:
[D]3K4/8/3k4/8/4pP2/4B3/8/8 b - f3 0 5
And here the code misses the possible ep capture exf3.
The bug is in probe_dtz_no_ep() where is used probe_ab() that is
blind to ep captures so it returns v == 2 (win) for position
3K4/8/3k4/8/4pP2/4B3/8/8 b - f3 0 5
Note that at the caller site the original position did not have any
possible ep capture, so probe_dtz() returns immediately after calling
probe_dtz_no_ep().
The fix is to call the ep-aware probe_wdl() instead of probe_ab()
I have verified that DTZ is correct now and also there are no more
mistmatches compared to the new 'syzygy' branch. Tested on a set of
more than 600 endgame positions, included some tricky ones.
For people interested to redo the test or doing additional tests
please pull branch tb_dbg from https://github.com/mcostalba/Stockfish repo.
bench:
8450534 (bench unaffected because syzygy is not exercized during bench)
VoyagerOne [Fri, 3 Jun 2016 14:21:12 +0000 (10:21 -0400)]
Simplify Futility Pruning
Don't update bestValue when futility pruning.
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 21933 W: 4031 L: 3912 D: 13990
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 46225 W: 6115 L: 6028 D: 34082
Bench:
8450534
ElbertoOne [Fri, 3 Jun 2016 08:01:02 +0000 (10:01 +0200)]
LMR Simplification
LMR simplification that also gives a slight ELO gain, especially at LTC:
STC (http://tests.stockfishchess.org/tests/view/
574ec8e20ebc59029919b147):
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 32402 W: 5967 L: 5866 D: 20569
LTC (http://tests.stockfishchess.org/tests/view/
574fbebf0ebc59029919b16d):
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 15103 W: 2103 L: 1975 D: 11025
Bench:
8248133
joergoster [Mon, 30 May 2016 20:42:47 +0000 (22:42 +0200)]
Tuned values for piece check and attack unit factors
A middle ground patch of two successful tuning patches,
one at STC, the other at LTC, which now passed both.
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 67893 W: 12777 L: 12384 D: 42732
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 30165 W: 4189 L: 3960 D: 22016
bench:
9209507
Stéphane Nicolet [Sat, 21 May 2016 08:05:19 +0000 (10:05 +0200)]
Pins or discovered attacks on the opponent's queen
Bonus for pins or discovered attacks on the opponent's queen
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 32020 W: 5914 L: 5652 D: 20454
LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 10946 W: 1530 L: 1375 D: 8041
Bench:
7031649
Stéphane Nicolet [Sat, 21 May 2016 08:05:19 +0000 (10:05 +0200)]
Teach check_blockers to check also non-king pieces
This is a prerequisite for next patch
No functional change.
Stéphane Nicolet [Tue, 24 May 2016 06:09:13 +0000 (08:09 +0200)]
Simplify doubled pawn
Only use doubled pawn malus when the doubled pawns are on consecutive squares.
Passed STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 7678 W: 1469 L: 1325 D: 4884
And LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 26739 W: 3562 L: 3449 D: 19728
Bench:
8211685
Leonid Pechenik [Mon, 16 May 2016 20:30:57 +0000 (16:30 -0400)]
More detailed dependence of time allocation on the magnitude of score change
10+0.1:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 5657 W: 1130 L: 979 D: 3548
60+0.6:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 36884 W: 5002 L: 4762 D: 27120
bench:
8428997
loco-loco [Wed, 18 May 2016 06:46:05 +0000 (23:46 -0700)]
Assorted pruning tweaks
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 38257 W: 5206 L: 4961 D: 28090
STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 16550 W: 3110 L: 2914 D: 10526
Bench:
8428997
mstembera [Thu, 28 Apr 2016 19:13:32 +0000 (12:13 -0700)]
Fix a multiPV bug in lazy SMP
Where the helper threads were not doing multiPV at all.
Regression tested sprt @ 5+0.05 th 7
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 73918 W: 11891 L: 11853 D: 50174
bench:
8716243
Stéphane Nicolet [Wed, 11 May 2016 04:48:51 +0000 (06:48 +0200)]
Double pawn simplification
Try doubled pawn simplification, with psq
table compensation.
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 36094 W: 6558 L: 6463 D: 23073
LTC:
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 102352 W: 13417 L: 13404 D: 75531
Bench:
8716243
loco-loco [Fri, 6 May 2016 03:56:47 +0000 (20:56 -0700)]
Merge good and bad quiets
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 58613 W: 10779 L: 10723 D: 37111
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 33608 W: 4539 L: 4436 D: 24633
Bench:
9441294
Alain SAVARD [Fri, 6 May 2016 13:40:56 +0000 (09:40 -0400)]
Unsafe checks
Introducing a new multi-purpose penalty related to King safety, which
includes all kind of potential checks (from unsafe or unavailable
squares currently occupied by some other piece)
This will indirectly detect and reward some pins, discovered checks, and
motifs such as square vacation, or rook behind its pawn and aligned with
King (example Black Rg8, g7 against Kg1),
and penalize some pawn blockers (if they move, it allows a discovered
check by the pawn).
And since it looks also at protected squares, it detects some potential
defense overloading.
Finally, the rook contact checks had been removed some time ago. This
test will give a small bonus for them, as well as for bishop contact
checks.
Passed STC
http://tests.stockfishchess.org/tests/view/
5729ec740ebc59301a354b36
LLR: 2.94 (-2.94,2.94) [0.00,5.00]
Total: 13306 W: 2477 L: 2296 D: 8533
and LTC
http://tests.stockfishchess.org/tests/view/
572a5be00ebc59301a354b65
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 20369 W: 2750 L: 2565 D: 15054
bench:
9298175
Marco Costalba [Sun, 1 May 2016 16:18:10 +0000 (18:18 +0200)]
Retire __popcnt64 intrinsic
Just use _mm_popcnt_u64() that is available
both for MSVC abd Intel compiler.
Verified on MSVC that the produced assembly
has the hardware 'popcnt' instruction.
No functional change.
VoyagerOne [Sun, 1 May 2016 03:23:15 +0000 (23:23 -0400)]
Simplify History LMR Formula
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 41713 W: 7589 L: 7504 D: 26620
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 41353 W: 5484 L: 5391 D: 30478
Bench:
8946983
Marco Costalba [Sun, 1 May 2016 13:10:33 +0000 (15:10 +0200)]
Fix a warning with MSVC
Introduced by
2dd24dc4e618dc7b ("Use popcount intrinsic with Intel")
No functional change.
joergoster [Sat, 30 Apr 2016 08:56:00 +0000 (10:56 +0200)]
Fix LazySMP when searching to a fixed depth.
Currently, helper threads will only search up to the
specified depth limit. Now let them search until the
main thread has finished the specified depth.
On the other hand, we don't want to pick a thread with
a higher search depth.
This may be considered cheating. ;-)
No functional change.
erbsenzaehler [Sun, 1 May 2016 08:57:50 +0000 (10:57 +0200)]
Use popcount intrinsic with Interl compiler
It seems that icc used our fallback version of popcount.
Now use intrinsics.
icc version 16.0.2 (gcc version 5.3.0 compatibility)
bmi2 compile
uname -r 4.5.1-1-ARCH
20xbench gives a nice speedup
./stockfish-icc-master
2161515 +- 34462
./stockfish-icc-sse42
2260857 +- 50349
Krgp [Sat, 30 Apr 2016 10:38:14 +0000 (16:08 +0530)]
Remove useless -mbmi flag in Makefile
I could not find anything documented that is necessary that prepending -mbmi to -mbmi2 gives some benefit.
Instead at
https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html#x86-Built-in-Functions
The following built-in functions are available when -mbmi is used. All of them generate the machine instruction that is part of the name.
unsigned int __builtin_ia32_bextr_u32(unsigned int, unsigned int);
unsigned long long __builtin_ia32_bextr_u64 (unsigned long long, unsigned long long);
The following built-in functions are available when -mbmi2 is used. All of them generate the machine instruction that is part of the name.
unsigned int _bzhi_u32 (unsigned int, unsigned int)
unsigned int _pdep_u32 (unsigned int, unsigned int)
unsigned int _pext_u32 (unsigned int, unsigned int)
unsigned long long _bzhi_u64 (unsigned long long, unsigned long long)
unsigned long long _pdep_u64 (unsigned long long, unsigned long long)
unsigned long long _pext_u64 (unsigned long long, unsigned long long)
and at
https://gcc.gnu.org/ml/gcc/2014-02/msg00204.html
( "... The real optimization comes from being able to use pext
(parallel bit extract), which can implement several bextr expressions in
parallel.")
Apart from that we don't use all -msse -msse2 -msse3 -msse4.2 etc. but just -msse3 (or -msse4.2) only.
As regards to the speedup within noise level - this pull request is actually reversal of mcostalba#198 wherein prepending -mbmi to -mbmi2 was claimed to be 0.3% faster and here (removing -mbmi) gives 0.4% speed gain.
Stéphane Nicolet [Thu, 28 Apr 2016 16:57:54 +0000 (18:57 +0200)]
Isolated pawn simplification
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 117822 W: 21697 L: 21744 D: 74381
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 92307 W: 12330 L: 12305 D: 67672
Bench:
8813983
Resolves #659
VoyagerOne [Mon, 18 Apr 2016 00:04:34 +0000 (20:04 -0400)]
Use FMHs to assist with LMR formula.
STC:
LLR: 2.99 (-2.94,2.94) [0.00,5.00]
Total: 52232 W: 9654 L: 9304 D: 33274
LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 115988 W: 15550 L: 15049 D: 85389
Bench:
7890808
Resolves #651
erbsenzaehler [Sat, 23 Apr 2016 23:55:56 +0000 (00:55 +0100)]
Use -O3 for all compilers (including ICC)
There seems to be no benefit from using -fast over -O3 with icc.
So use -O3 everywhere.
No functional change
Resolves #652
DU-jdto [Thu, 21 Apr 2016 04:23:40 +0000 (14:23 +1000)]
Remove some pointless micro-optimizations
Seems to give around 1% speed-up for CPUs with popcnt support.
Seems to give a very minor speed-up for CPUs without popcnt.
No functional change
Resolves #646
Marco Costalba [Sun, 17 Apr 2016 19:31:19 +0000 (21:31 +0200)]
Fix incorrect draw detection
In this position we should have draw for repetition:
position fen rnbqkbnr/2pppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 moves g1f3 g8f6 f3g1
go infinite
But latest patch broke it.
Actually we had two(!) very subtle bugs, the first is that Position::set()
clears the passed state and in particular 'previous' member, so
that on passing setupStates, 'previous' pointer was reset.
Second bug is even more subtle: SetupStates was based on std::vector
as container, but when vector grows, std::vector copies all its contents
to a new location invalidating all references to its entries. Because
all StateInfo records are linked by 'previous' pointer, this made pointers
go stale upon adding more element to setupStates. So revert to use a
std::deque that ensures references are preserved when pushing back new
elements.
No functional change.
loco-loco [Sun, 17 Apr 2016 14:14:07 +0000 (15:14 +0100)]
Add a second level of follow-up moves
STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 6438 W: 1229 L: 1077 D: 4132
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 4000 W: 605 L: 473 D: 2922
bench:
7378965
Resolves #636
Marco Costalba [Mon, 11 Apr 2016 14:45:36 +0000 (16:45 +0200)]
StateInfo is usually allocated on the stack by search()
And passed in do_move(), this ensures maximum efficiency and
speed and at the same time unlimited move numbers.
The draw back is that to handle Position init we need to
reserve a StateInfo inside Position itself and use at
init time and when copying from another Position.
After lazy SMP we don't need anymore this gimmick and we can
get rid of this special case and always pass an external
StateInfo to Position object.
Also rewritten and simplified Position constructors.
Verified it does not regress with a 3 threads SMP test:
ELO: -0.00 +-12.7 (95%) LOS: 50.0%
Total: 1000 W: 173 L: 173 D: 654
No functional change.
Niklas Fiekas [Fri, 8 Apr 2016 15:20:47 +0000 (17:20 +0200)]
Fix last search info carried over to mate position
When starting search in a mate or stalemate position, Stockfish does not
even care to reinitialize and start worker threads. However after search
all threads are checked for the best move.
This can lead to bestmove and info beeing carried over from the last
search.
Example session:
setoption name threads value 7
go movetime 4000
position startpos moves f2f3 e7e5 g2g4 d8h4
go movetime 4000
Actual output is like (almost always):
[...]
bestmove e2e4
info depth 0 score mate 0
info depth 20 seldepth 29 multipv 1 score cp 28 [...] pv e2e4
bestmove e2e4
Expected output / output after fix:
[...]
bestmove e2e4 ponder e7e6
info depth 0 score mate 0
bestmove (none)
Resolves #623
Marco Costalba [Thu, 7 Apr 2016 06:55:38 +0000 (08:55 +0200)]
Hide global visibility when not needed
Also move PieceValue definition in psqt.cpp,
where it is initialized.
Fix a warning in popcount16() with Intel compiler
No functional change.
Marco Costalba [Sat, 9 Apr 2016 06:58:14 +0000 (08:58 +0200)]
Fix Travis Cl
Broken after "32-bit/64-bit Makefile fix" commit.
Ubuntu "Precise" 12.04.5 supports multilib only until
g++ 4.6 that is not enough to compile Stockfish.
So move to Ubuntu 14.04.4 LTS (Trusty Tahr)
No functional change.
DU-jdto [Wed, 6 Apr 2016 00:46:54 +0000 (10:46 +1000)]
Small passed pawn simplification
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 21993 W: 4197 L: 4078 D: 13718
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 67213 W: 9135 L: 9077 D: 49001
Bench:
7482426
Resolves #622
Alain SAVARD [Fri, 8 Apr 2016 18:19:59 +0000 (19:19 +0100)]
Undefended King Ring
There was already a penalty for squares only defended by King (undefended)
This test records a penalty for completely undefended squares in the so called extended king-ring
(so if we exclude squares defended by a Kg8 for example, we only look at h6 g6 and f6)
We also exclude squares occupied by opponent pieces in this computation,
based on the following results
Was yellow at STC
LLR: -2.97 (-2.94,2.94) [0.00,5.00]
Total: 112499 W: 20649 L: 20293 D: 71557
and passed LTC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 36805 W: 5100 L: 4857 D: 26848
Bench:
8430233
Resolves: #619
Alain SAVARD [Fri, 8 Apr 2016 18:05:36 +0000 (19:05 +0100)]
Backward simplication
On top of the usual conditions
a) some opponent in front (but no lever)
b) some neighbours (in front) (but no neighbour behind or same rank)
c) < rank_5
to find out if a pawn is backward we look at the squares in front of this pawn to reach the same rank as the next neighbour.
In current master, a pawn is backward if any of those squares is controlled by an enemy pawn on an adjacent file
In this version, a pawn is ALSO backward if any of those squares is occupied by an enemy pawn.
STC:
http://tests.stockfishchess.org/tests/view/
56fe7efd0ebc59301a3541f1
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 19051 W: 3557 L: 3433 D: 12061
LTC:
http://tests.stockfishchess.org/tests/view/
56febc2d0ebc59301a354209
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 40810 W: 5619 L: 5526 D: 29665
Bench:
7525245
Resolves #614
mstembera [Fri, 8 Apr 2016 17:52:15 +0000 (18:52 +0100)]
Simplify popcnt
Also a speedup(about 1%) on 64-bit w/o hardware popcnt
Retire Max15 and Full template parameters
(Contributed by Marco Costalba)
Now that we have just SW and HW versions, use
template default parameter to get rid of explicit
template parameters.
Retire bitcount.h and move the only defined
function to bitboard.h
No functional change
Resolves #620
lucasart [Fri, 8 Apr 2016 17:47:31 +0000 (18:47 +0100)]
32-bit/64-bit Makefile fix
Counter intuitively, make build ARCH=x86-32 does NOT produce a 32-bit compile
when running a 64-bit OS. Nor would ARCH=x86-64 produce a 64-bit compile when
running a 32-bit OS (assuming it compiled w/o errors).
No functional change
Resolves #621
NicklasPersson [Wed, 30 Mar 2016 06:48:47 +0000 (08:48 +0200)]
A combo patch of two tuning patches
STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 14223 W: 2700 L: 2494 D: 9029
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 66294 W: 9065 L: 8739 D: 48490
Bench:
7607385
Resolves #612
lucasart [Tue, 29 Mar 2016 12:37:42 +0000 (20:37 +0800)]
Guard against UB in lsb/msb
lsb(b) and msb(b) are undefined when b == 0. This can lead to subtle bugs, where
the resulting code behaves differently on different configurations:
- It can be the home grown software LSB/MSB
- It can be the compiler generated software LSB/MSB (when using compiler
intrinsics without the right compiler flags to allow compiler to use hardware
LSB/MSB). Which of course depends on the compiler.
- It can be hardware LSB/MSB generated by the compiler.
- Not to mention that hardware LSB/MSB can return different value on different
hardware when b == 0.
No functional change
Resolves #610
Marco Costalba [Mon, 28 Mar 2016 08:08:06 +0000 (10:08 +0200)]
Rewrite bsfq management
Use compiler intrinsics when possible to
avoid writing platform specific asm code.
Tested on Windows 7 with MSVC 2013 and mingw 4.8.3 (32 and 64 bit)
and on Linux Mint with g++ 4.8.4 and clang 3.4 (32 and 64 bit).
No functional change
Resolves #609
snicolet [Sun, 27 Mar 2016 19:54:39 +0000 (20:54 +0100)]
Bonus for loose enemies
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 30504 W: 5743 L: 5485 D: 19276
LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 11936 W: 1651 L: 1493 D: 8792
Bench:
8880041
Resolves #606
mbootsector [Sun, 27 Mar 2016 19:21:13 +0000 (20:21 +0100)]
Raise endgame passed pawn and material values
STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 136149 W: 25213 L: 24588 D: 86348
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 54637 W: 7533 L: 7238 D: 39866
Bench:
8546808
Resolves #608
fanon [Sun, 20 Mar 2016 16:50:32 +0000 (10:50 -0600)]
Simplify pawns King Safety calculation
STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 130209 W: 23516 L: 23581 D: 83112
LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 33541 W: 4563 L: 4460 D: 24518
Bench:
8644370
Resolves #604
VoyagerOne [Sun, 6 Mar 2016 19:34:24 +0000 (14:34 -0500)]
A small simplification in movepick.h
No functional change
Resolves #597
mstembera [Tue, 15 Mar 2016 03:49:25 +0000 (20:49 -0700)]
Simplify Safe Checks
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 11796 W: 2211 L: 2074 D: 7511
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 14324 W: 1935 L: 1806 D: 10583
Bench:
8075202
Resolves #600
Marco Costalba [Sun, 13 Mar 2016 08:35:03 +0000 (09:35 +0100)]
Assorted cleanup of latest commits
No functional change.
Resolves #601
Stefan Geschwentner [Thu, 10 Mar 2016 09:28:25 +0000 (10:28 +0100)]
Add followup moves history for move ordering
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 7955 W: 1538 L: 1378 D: 5039
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 5323 W: 778 L: 642 D: 3903
Bench:
8261839
Resolves #599
mbootsector [Thu, 25 Feb 2016 22:59:16 +0000 (23:59 +0100)]
Passed pawn bonus simplification
STC: (yellow)
LLR: -2.96 (-2.94,2.94) [0.00,4.00]
Total: 86114 W: 16063 L: 15921 D: 54130
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 14347 W: 2025 L: 1896 D: 10426
Bench:
8576437
Resolves #595
snicolet [Wed, 2 Mar 2016 00:00:41 +0000 (00:00 +0000)]
Tweak initiative formula
Give more weight to the pawns number and
the vertical king distance in evaluate_initiative()
Passed STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 26729 W: 5067 L: 4825 D: 16837
and LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 60480 W: 8338 L: 8016 D: 44126
Bench:
8295162
Resolves #594
ElbertoOne [Sun, 28 Feb 2016 13:40:47 +0000 (13:40 +0000)]
Clean up depth reduction calculation
Might also be a slight speed up
No functional change
Resolves #593
joergoster [Thu, 25 Feb 2016 18:38:35 +0000 (19:38 +0100)]
Pass endgame value to evaluate_scale_factor()
No functional change
Resolves #592
VoyagerOne [Sun, 28 Feb 2016 13:28:22 +0000 (13:28 +0000)]
Simplify Reduction Formula
Formula now only contains one coefficient. Making it much easier to tune.
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 187443 W: 34858 L: 35028 D: 117557
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 88329 W: 11982 L: 11953 D: 64394
Bench:
7521394
Resolves #591
Leonid Pechenik [Mon, 22 Feb 2016 17:03:33 +0000 (12:03 -0500)]
Revert "Remove slowMover"
This reverts commit
77fa960f8923ca83ba0391835d50f4230ac6a345.
Resolves #590
IIvec [Sun, 21 Feb 2016 20:16:28 +0000 (20:16 +0000)]
Remove slowMover
Removes a slowMover and one paramater from move_importance function.
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 77023 W: 14456 L: 14433 D: 48134
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 37175 W: 5190 L: 5092 D: 26893
Resolves #589
VoyagerOne [Sun, 14 Feb 2016 19:35:07 +0000 (14:35 -0500)]
History Stat Formula Simplification
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 67476 W: 12561 L: 12521 D: 42394
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 111923 W: 15147 L: 15149 D: 81627
Bench:
8430465
Resolves #588
VoyagerOne [Sun, 14 Feb 2016 19:45:10 +0000 (19:45 +0000)]
Fix futility pruning bug
PredictedDepth can be negative, causing the futility_margin to be negative.
It will be very difficult to tweak moveCount pruning and reduction formula, as they are tuned to prevent this behavior.
No functional change
Resolves #587
hxim [Sun, 7 Feb 2016 20:58:20 +0000 (20:58 +0000)]
Remove Weights
Removed remaining redundant weights for pawn structure,
passed pawns, space and king safety by redistributing them
into individual evaluation terms.
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 15173 W: 2790 L: 2659 D: 9724
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 43433 W: 5936 L: 5846 D: 31651
Bench:
7156237
Resolves #586
Marco Costalba [Sat, 30 Jan 2016 09:33:59 +0000 (10:33 +0100)]
Document HalfDensityMap
No functional change.
Resolves #584
Leonid Pechenik [Mon, 18 Jan 2016 16:56:35 +0000 (11:56 -0500)]
Time management simplification
10+0.1:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 41963 W: 7967 L: 7883 D: 26113
60+0.6:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 132314 W: 17939 L: 17969 D: 96406
Resolves #580
Guenther Demetz [Mon, 18 Jan 2016 09:41:24 +0000 (10:41 +0100)]
rotating symmetric patterns with increasing skipsize
STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00] sprt @ 5+0.1 th 21
Total: 7068 W: 1121 L: 975 D: 4972
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00] sprt @ 12+0.12 th 21
Total: 26691 W: 3594 L: 3481 D: 19616
No functional change with a single thread
Resolves #574
Joona Kiiski [Wed, 20 Jan 2016 15:24:21 +0000 (15:24 +0000)]
Do not probe syzygy bases when castling is possible
Almost no functional change. Bench is unchanged.
Resolves #230
Resolves #573
lucasart [Mon, 18 Jan 2016 22:20:16 +0000 (22:20 +0000)]
Retire RootNode template
There is no reason to compile 3 different copies of search(). PV nodes are on
the cold path, and PvNode is a template parameter, so there is no cost in
computing:
const bool RootNode = PvNode && (ss-1)->ply == 0;
And this simplifies code a tiny bit as well.
Speed impact is negligible on my machine (i7-3770k, linux 4.2, gcc 5.2):
nps +/-
test
2378605 3118
master
2383128 2793
diff -4523 2746
Bench:
7751425
No functional change.
Resolves #568
Guenther Demetz [Wed, 13 Jan 2016 13:24:52 +0000 (14:24 +0100)]
Depth margin parameter-tweak in TT-save
Verified that is improvement with multiple threads:
LLR: 2.95 (-2.94,2.94) [0.00,4.00] sprt @ 30+0.3 th 3
Total: 14817 W: 2103 L: 1915 D: 10799
LLR: 2.96 (-2.94,2.94) [0.00,4.00] sprt @ 15+0.15 th 7
Total: 10264 W: 1498 L: 1321 D: 7445
Verified that is not a significant regression with a single thread:
LLR: 2.96 (-2.94,2.94) [-4.00,0.00] sprt @ 60+0.6 th 1
Total: 23975 W: 3294 L: 3210 D: 17471
Resolves #575
Joona Kiiski [Sun, 17 Jan 2016 15:43:33 +0000 (15:43 +0000)]
Remove redundant -std=c++0x flag
This flag is functionally identical to '-std=c++11' flag which
is part of standard flags.
No functional change
Resolves #571
Joona Kiiski [Sun, 17 Jan 2016 15:24:18 +0000 (15:24 +0000)]
Makefile: Allow specifying compiler executable
No functional change
Resolves #570
Marco Costalba [Sat, 16 Jan 2016 08:03:56 +0000 (09:03 +0100)]
Rewrite time formula
Time management is really too complex, our aim is
to simplify it, but for time being at least rewrite
in an understandable way.
No functional change.
Lyudmil Antonov [Sat, 16 Jan 2016 21:34:29 +0000 (21:34 +0000)]
Assorted English grammar changes
No functional change
Resolves #567
Stefano80 [Wed, 13 Jan 2016 16:05:31 +0000 (16:05 +0000)]
Adjust reductions based on history and cmh tables
STC:
LLR: 4.06 (-2.94,2.94) [0.00,5.00]
Total: 149395 W: 28029 L: 27208 D: 94158
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 9628 W: 1368 L: 1217 D: 7043
bench:
8076724
Resolves #565
Stefano80 [Wed, 13 Jan 2016 16:02:48 +0000 (16:02 +0000)]
Update comments in LMR step
No functional change
Resolves #564
Leonid Pechenik [Mon, 4 Jan 2016 03:31:51 +0000 (22:31 -0500)]
Tune time management for LTC
60+0.6:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 102533 W: 14270 L: 13842 D: 74421
Resolves #558
lucasart [Sat, 2 Jan 2016 01:10:12 +0000 (09:10 +0800)]
Retire CenterBind
And compensate in the PSQT.
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 27714 W: 5161 L: 5052 D: 17501
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 36354 W: 5008 L: 4909 D: 26437
Bench:
8603285
Resolves #556
Alain SAVARD [Sun, 3 Jan 2016 14:15:29 +0000 (14:15 +0000)]
Fine tuning of unsupported pawn penalty
Adjust the unsupported pawn penalty when the pawn is supporting 2 pawns
(for example g7 in f6-g7-h6)
Passed STC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 23833 W: 4384 L: 4158 D: 15291
Passed LTC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 42711 W: 5918 L: 5655 D: 31138
Bench:
8390233
Resolves #549
Leonid Pechenik [Sun, 3 Jan 2016 14:00:56 +0000 (14:00 +0000)]
Adjust time used for move based on previous score
Use less time if evaluation is not worse than for previous move and even less time if in addition no fail low encountered for current iteration.
STC: 10+0.1
ELO: 5.37 +-2.9 (95%) LOS: 100.0%
Total: 20000 W: 3832 L: 3523 D: 12645
STC: 10+0.1
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 17527 W: 3334 L: 3132 D: 11061
LTC: 60+0.6
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 28233 W: 3939 L: 3725 D: 20569
LTC: 60+0.6
ELO: 2.43 +-1.4 (95%) LOS: 100.0%
Total: 60000 W: 8266 L: 7847 D: 43887
LTC: 60+0.06
LLR: 2.95 (-2.94,2.94) [-1.00,3.00]
Total: 38932 W: 5408 L: 5207 D: 28317
Resolves #547
Joona Kiiski [Sun, 3 Jan 2016 13:52:01 +0000 (13:52 +0000)]
Restore development version
Joona Kiiski [Sat, 2 Jan 2016 20:26:02 +0000 (20:26 +0000)]
Stockfish 7
Bench:
8355485
No functional change
ppigazzini [Sat, 2 Jan 2016 09:43:25 +0000 (09:43 +0000)]
Update AUTHORS and copyright notice
No functional change
Resolves #555
Marco Costalba [Fri, 1 Jan 2016 09:47:20 +0000 (10:47 +0100)]
Update Copyright year
No functional change.
Resolves #554
Joona Kiiski [Wed, 30 Dec 2015 11:32:45 +0000 (11:32 +0000)]
Stockfish 7 Beta 2
Bench:
8355485
No functional change
Alain SAVARD [Wed, 30 Dec 2015 11:29:25 +0000 (11:29 +0000)]
Correct Pawn Trace Score + Code Clean up
No functional change
Resolves #542
Marco Costalba [Mon, 28 Dec 2015 12:14:49 +0000 (13:14 +0100)]
Fix assert with very high score position
In case of a very high material score, we can
overflow VALUE_INFINITE.
This patch fixes an assert with:
position fen 7k/QQQQR3/2B5/4KN1Q/3QQ3/8/8/4R3 b - - 0 1
go depth 1
No functional change.
Resolves #546
Joona Kiiski [Sun, 27 Dec 2015 19:35:48 +0000 (19:35 +0000)]
Stockfish 7 Beta 1
Bench:
8355485
No functional change
Marco Costalba [Wed, 23 Dec 2015 09:07:54 +0000 (10:07 +0100)]
Move some globals into main thread scope
Make it explicit that those variables are not globals, but
are used only by main thread. I think it is a sensible
clarification because easy move is already tricky enough
and current patch makes the involved actors explicit.
No functional change.
Resolves #537
Marco Costalba [Wed, 23 Dec 2015 08:37:59 +0000 (09:37 +0100)]
Revert "Fix compiling of 32 bit binary on 64-bit Windows"
This reverts commit
1e8836d921b3
Broken compile on mingw under Windows:
Config:
debug: 'yes'
optimize: 'yes'
arch: 'i386'
bits: '32'
prefetch: 'yes'
bsfq: 'no'
popcnt: 'no'
sse: 'yes'
pext: 'no'
Flags:
CXX: i686-w64-mingw32-c++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -g -O3 -msse
LDFLAGS: -static
Testing config sanity. If this fails, try 'make help' ...
mingw32-make[1]: Leaving directory 'C:/stockfish/src'
c:/MinGw/bin/mingw32-make ARCH=x86-32 COMP=mingw all
mingw32-make[1]: Entering directory 'C:/stockfish/src'
sh: C:\Program: No such file or directory
i686-w64-mingw32-c++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -g -O3 -msse -c -o benchmark.o benchmark.cpp
<builtin>: recipe for target 'benchmark.o' failed
process_begin: CreateProcess(NULL, i686-w64-mingw32-c++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -g -O3 -msse -c -o benchmark.o benchmark.cpp, ...) failed.
make (e=2): Impossibile trovare il file specificato.
mingw32-make[1]: *** [benchmark.o] Error 2
mingw32-make[1]: Leaving directory 'C:/stockfish/src'
makefile:401: recipe for target 'build' failed
mingw32-make: *** [build] Error 2
No functional change.
braich [Sat, 19 Dec 2015 20:39:41 +0000 (23:39 +0300)]
Fix compiling of 32 bit binary on 64-bit Windows
Two versions of mingw-w64 (targeting Win64 and Win32)
can be installed on Windows too.
No functional change
Resolves #532
DU-jdto [Sun, 20 Dec 2015 21:45:21 +0000 (08:45 +1100)]
Remove another unnecessary Search::Stack field
No functional change
Resolves #535
Alain SAVARD [Tue, 22 Dec 2015 10:00:04 +0000 (10:00 +0000)]
New mobility bonus
Tuned the global mobility factor for each piece, as well as some +- delta,
The master mobility factor was {266,334} and tuning gave
{267, 362} +S(-2,-2) for the Knight
{249, 328} +S( 0,-2) for the Bishop
{298, 353} +S(1,1) for the Rook
{265, 358} +S(2,-1) for the Queen
Passed STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 49402 W: 9367 L: 9037 D: 30998
and LTC
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 26831 W: 3871 L: 3658 D: 19302
Bench:
8355485
Resolves #536
VoyagerOne [Sat, 19 Dec 2015 20:58:45 +0000 (15:58 -0500)]
Remove killer move conditions from LMR
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 8459 W: 1619 L: 1477 D: 5363
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 32239 W: 4404 L: 4299 D: 23536
Bench:
7597031
Resolves #534
loco-loco [Sun, 20 Dec 2015 20:37:18 +0000 (20:37 +0000)]
Remove unused field SearchStack::ttMove
No functional change
Resolves #533
Guenther Demetz [Fri, 18 Dec 2015 21:55:07 +0000 (21:55 +0000)]
Distinct iteration paths for Lazy SMP threads
STC 5+0.1, threads 7
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 6026 W: 1047 L: 901 D: 4078
LTC: 20+0.2, threads 7
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 19739 W: 2910 L: 2721 D: 14108
STC 5+0.1, threads 20
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 2493 W: 462 L: 331 D: 1700
LTC 30+0.3, threads 20
ELO: 8.86 +-3.7 (95%) LOS: 100.0%
Total: 8000 W: 1076 L: 872 D: 6052
Bench:
8012530
Resolves #525
mstembera [Mon, 14 Dec 2015 18:34:43 +0000 (18:34 +0000)]
Fix easy move bug in SMP mode
Fix a bug where we could stop the search after only 10% of time used due to a matching easy move but later switch to a different move that was never pre-screened as easy due to SMP thread select.
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 27227 W: 4910 L: 4800 D: 17517
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 40368 W: 5826 L: 5733 D: 28809
Resolves #521
Alain SAVARD [Mon, 14 Dec 2015 18:04:20 +0000 (18:04 +0000)]
Threats retuned
STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 45239 W: 8913 L: 8591 D: 27735
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 21046 W: 3200 L: 2989 D: 14857
Bench:
8012530
Resolves #526
Leonid Pechenik [Wed, 9 Dec 2015 07:07:34 +0000 (02:07 -0500)]
Simplify time management and fix 'ponder on' bug
Simplify time management code by removing hard stops for unchanging first root moves.
Search is now stopped earlier at the end iteration if it did not have fail-lows at root.
This simplification also fixes pondering bug. Ponder flag was true by default
and cutechess-cli doesn't change it to false even though no pondering is possible.
Fix the issue by setting the default value of 'Ponder' flag to false.
10+0.1:
ELO: 3.51 +-3.0 (95%) LOS: 99.0%
Total: 20000 W: 3898 L: 3696 D: 12406
40+0.4:
ELO: 1.39 +-2.7 (95%) LOS: 84.7%
Total: 20000 W: 3104 L: 3024 D: 13872
60+0.06:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 37231 W: 5333 L: 5236 D: 26662
Stopped run at 100+1:
LLR: 1.09 (-2.94,2.94) [-3.00,1.00]
Total: 37253 W: 4862 L: 4856 D: 27535
Resolves #523
Fixes #510
mstembera [Mon, 7 Dec 2015 21:51:43 +0000 (13:51 -0800)]
Fix MultiPv and Skill in SMP.
7 threads, 5+0.1:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 55460 W: 9665 L: 9601 D: 36194
No functional change in normal playing mode
absimaldata [Tue, 1 Dec 2015 19:57:05 +0000 (01:27 +0530)]
New Tuned Weights
More accurate evaluation weights
Performed better at STC
LLR: 1.32 (-2.94,2.94) [0.00,4.00]
Total: 190043 W: 37433 L: 36675 D: 115935
Passed LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 30157 W: 4540 L: 4303 D: 21314
Bench:
9264977
Resolves #515
Marco Costalba [Sat, 28 Nov 2015 09:57:45 +0000 (10:57 +0100)]
Simplify outpost code
Also inline defintions of SpaceMask and CenterBindMask.
Verified from assembly that compiler computes the values
at compile time, so it is also theoretical faster.
While there factor out scale factor evaluation.
No functional change.
mstembera [Thu, 3 Dec 2015 13:59:27 +0000 (13:59 +0000)]
Proper Makefile for cross compiling 64 or 32 bit PGO + LTO + static Windows binaries under Linux.
No functional change
Resolves #511
Stéphane Nicolet [Thu, 26 Nov 2015 09:15:51 +0000 (10:15 +0100)]
Introduce new Threats weights = {350, 256}
Raise the midgame threats weight by 37%.
Passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 8165 W: 1675 L: 1487 D: 5003
and LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 28181 W: 4141 L: 3912 D: 20128
Bench:
7824961
Resolves #512