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
Joona Kiiski [Wed, 25 Nov 2015 01:24:45 +0000 (17:24 -0800)]
Revert "Allow cross compilation of Windows binaries on a Linux system"
This reverts commit
388630ae285b3f9f0c8ee4f30e754bde6688c57c.
Confuses fishtest build system
mstembera [Tue, 17 Nov 2015 08:37:51 +0000 (00:37 -0800)]
Allow cross compilation of Windows binaries on a Linux system
that are PGO, LTO, and statically linked.
Credit: pasquale....@gmail.com
No functional change
Resolves #505
mstembera [Mon, 16 Nov 2015 23:39:11 +0000 (15:39 -0800)]
Clean up RootMove less operator
This is used by std::stable_sort() to sort moves from highest score to lowest score.
1) The comment is incorrect since highest to lowest means descending.
2) It's more natural to implement a less operator using another less operator rather than a greater operator.
No functional change.
Resolves #504
lucasart [Sat, 21 Nov 2015 07:23:53 +0000 (23:23 -0800)]
Fix TT comment and static_assert()
Comment is based on a misunderstanding of what unaligned memory access is. Here
is an article that explains it very clearly:
https://www.kernel.org/doc/Documentation/unaligned-memory-access.txt
No matter how we define TTEntry or TTCluster, there will never be any unaligned
memory access. This is because the complier knows the alignment rules, and does
the necessary adjustments to make sure unaligned memory access does not occur.
The issue being adressed here has nothing to do with unaligned memory access. It
is about cache performance. In order to achieve best cache performance:
- we prefetch the cacheline as soon as possible.
- we ensure that TT clusters do not spread across two cachelines. If they did,
we would need to prefetch 2 cachelines, which could hurt cache performance.
Therefore the true conditions to achieve this are:
1/ start adress of TT is cache line aligned. void TranspositionTable::resize()
enforces this.
2/ TT cluster size should *divide* the cache line size. Currently, we pack 2
clusters per cache lines. It used to be 1 before "TT sardines". Does not matter
what the ratio is, all we want is to fit an integer number of clusters per cache
line.
No functional change.
Resolves #506
Marco Costalba [Sat, 21 Nov 2015 06:48:50 +0000 (07:48 +0100)]
Rewrite how threads are spawned
Instead of creating a running std::thread and
returning, wait in Thread c'tor that the native
thread of execution goes to sleep in idle_loop().
In this way we can simplify how search is started,
because when main thread is idle we are sure also
all other threads will be idle, in any case, even
at thread creation and startup.
After lazy smp went in, we can simpify and rewrite
a lot of logic that is now no more needed. This is
hopefully the final big cleanup.
Tested for no regression at 5+0.1 with 3 threads:
LLR: 2.95 (-2.94,2.94) [-5.00,0.00]
Total: 17411 W: 3248 L: 3198 D: 10965
No functional change.
VoyagerOne [Mon, 16 Nov 2015 04:38:01 +0000 (20:38 -0800)]
History Pruning: Don't prune the main killer move.
Also increased pruned depth to 4.
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 23380 W: 4581 L: 4350 D: 14449
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 28934 W: 4329 L: 4105 D: 20500
Bench:
8369743
Resolves #498
Ken T Takusagawa [Tue, 10 Nov 2015 10:30:38 +0000 (05:30 -0500)]
Do not conceal the invocation of the benchmark program
It is better to be able to see what arguments it is being called with.
No functional change
Resolves #497
Stefan Geschwentner [Sat, 14 Nov 2015 14:30:50 +0000 (06:30 -0800)]
Bonus for reachable outpost
Give a bonus for outpost squares which in reach of a bishop or knight.
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 22725 W: 4570 L: 4339 D: 13816
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 15019 W: 2333 L: 2157 D: 10529
Bench:
8503181
Resolves #495
Marco Costalba [Thu, 5 Nov 2015 07:40:23 +0000 (08:40 +0100)]
Retire ThreadBase
Now that we don't have anymore TimerThread, there is
no need of this long class hierarchy.
Also assorted reformatting while there.
To verify no regression, passed at STC with 7 threads:
LLR: 2.97 (-2.94,2.94) [-5.00,0.00]
Total: 30990 W: 4945 L: 4942 D: 21103
No functional change.
Marco Costalba [Mon, 9 Nov 2015 08:50:02 +0000 (09:50 +0100)]
Fix broken UCI 'wait for stop'
When we reach the maximum depth, we can finish the
search without a raise of Signals.stop. However, if
we are pondering or in an infinite search, the UCI
protocol states that we shouldn't print the best move
before the GUI sends a "stop" or "ponderhit" command.
It was broken by lazy smp. Fix it by moving the stopping
of the threads after waiting for GUI.
No functional change.
lucasart [Sun, 8 Nov 2015 06:26:39 +0000 (14:26 +0800)]
Avoid friend
operator<<(os, pos) does not need to access any private members of pos.
No functional change.
Resolves #492
lucasart [Sat, 7 Nov 2015 04:19:13 +0000 (12:19 +0800)]
Ensure that rootDepth < DEPTH_MAX
Indeed, if we use a depth >= DEPTH_MAX, we start having negative depth in the
TT (due to int8_t cast).
No functional change in single thread mode
Resolves #490
Marco Costalba [Tue, 3 Nov 2015 10:15:14 +0000 (11:15 +0100)]
Get rid of timer thread
Unfortunately std::condition_variable::wait_for()
is not accurate in general case and the timer thread
can wake up also after tens or even hundreds of
millisecs after time has elapsded. CPU load, process
priorities, number of concurrent threads, even from
other processes, will have effect upon it.
Even official documentation says: "This function may
block for longer than timeout_duration due to scheduling
or resource contention delays."
So retire timer and use a polling scheme based on a
local thread counter that counts search() calls and
a small trick to keep polling frequency constant,
independently from the number of threads.
Tested for no regression at very fast TC 2+0.05 th 7:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 32969 W: 6720 L: 6620 D: 19629
TC 2+0.05 th 1:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 7765 W: 1917 L: 1765 D: 4083
And at STC TC, both single thread
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 15587 W: 3036 L: 2905 D: 9646
And with 7 threads
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 8149 W: 1367 L: 1227 D: 5555
bench:
8639247
mbootsector [Mon, 2 Nov 2015 09:58:18 +0000 (09:58 +0000)]
Pick bestmove from the deepest thread.
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 26930 W: 4441 L: 4214 D: 18275
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 7783 W: 1017 L: 876 D: 5890
No functional change in single thread mode
Resolves #485
Marco Costalba [Sun, 25 Oct 2015 07:30:07 +0000 (08:30 +0100)]
Assorted trivia in search.cpp
The only interesting change is the moving of
stack[MAX_PLY+4] back to its original position
in id_loop (now renamed Thread::search).
No functional change.
VoyagerOne [Fri, 30 Oct 2015 20:39:21 +0000 (16:39 -0400)]
New History Bonus Formula
bonus = d^2 + d - 1
Bench:
8639247
Resolves #484
Ajith [Fri, 30 Oct 2015 00:06:13 +0000 (17:06 -0700)]
Reduce variation in rootDepth between different threads
Reduce the variation in Root Depth between different threads. This
prevents threads from searching at a depth much higher than Main Thread.
Performed well at STC 24 Threads:
ELO: 3.44 +-3.8 (95%) LOS: 96.1%
Total: 10000 W: 1627 L: 1528 D: 6845
And LTC 24 Threads
LLR: 1.43 (-2.94,2.94) [0.00,4.00]
Total: 3804 W: 500 L: 420 D: 2884
ELO : +7.31
p-value: 73.16%
Passed no regression at STC 3 Threads:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 40457 W: 7148 L: 7060 D: 26249
And LTC 3 Threads:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 17704 W: 2489 L: 2364 D: 12851
Raising a pull request early as 24 Thread tests are very expensive and
this is clearly a positive gain at high thread counts and high time
controls. The change is a small parameter tweak with no additional
logic.
No functional change for single thread mode.
Resolves #481
Stéphane Nicolet [Sun, 25 Oct 2015 11:07:22 +0000 (12:07 +0100)]
Some code and comment cleanup
- Remove all references to split points
- Some grammar and spelling fixes
No Functional change
Resolves #478
lucasart [Sat, 24 Oct 2015 21:50:51 +0000 (22:50 +0100)]
Use atomics instead of volatile
Rely on well defined behaviour for message passing, instead of volatile. Three
versions have been tested, to make sure this wouldn't cause a slowdown on any
platform.
v1: Sequentially consistent atomics
No mesurable regression, despite the extra memory barriers on x86. Even with 15
threads and extreme time pressure, both acting as a magnifying glass:
threads=15, tc=2+0.02
ELO: 2.59 +-3.4 (95%) LOS: 93.3%
Total: 18132 W: 4113 L: 3978 D: 10041
threads=7, tc=2+0.02
ELO: -1.64 +-3.6 (95%) LOS: 18.8%
Total: 16914 W: 4053 L: 4133 D: 8728
v2: Acquire/Release semantics
This version generates no extra barriers for x86 (on the hot path). As expected,
no regression either, under the same conditions:
threads=15, tc=2+0.02
ELO: 2.85 +-3.3 (95%) LOS: 95.4%
Total: 19661 W: 4640 L: 4479 D: 10542
threads=7, tc=2+0.02
ELO: 0.23 +-3.5 (95%) LOS: 55.1%
Total: 18108 W: 4326 L: 4314 D: 9468
As suggested by Joona, another test at LTC:
threads=15, tc=20+0.05
ELO: 0.64 +-2.6 (95%) LOS: 68.3%
Total: 20000 W: 3053 L: 3016 D: 13931
v3: Final version: SeqCst/Relaxed
threads=15, tc=10+0.1
ELO: 0.87 +-3.9 (95%) LOS: 67.1%
Total: 9541 W: 1478 L: 1454 D: 6609
Resolves #474
Stefano80 [Sat, 24 Oct 2015 22:12:59 +0000 (23:12 +0100)]
KRPPKRP endgame: Simplify ugly switch statement
No functional change
Resolves #470
Marco Costalba [Sat, 24 Oct 2015 05:27:24 +0000 (07:27 +0200)]
Cleanup history stats
And other assorted trivia.
No functional change.
Alain SAVARD [Mon, 19 Oct 2015 02:17:37 +0000 (22:17 -0400)]
Simplify threats
Using less parameters and code to compute Threats
Includes also a few spacing edits.
Run as a simplification.
Passed STC 10+0.1
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 18879 W: 3725 L: 3600 D: 11554
Passed LTC 60+0.4
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 74116 W: 11001 L: 10958 D: 52157
bench:
8004751
VoyagerOne [Wed, 21 Oct 2015 22:21:23 +0000 (18:21 -0400)]
History pruning
Prune moves with negative History
and CMH scores at low depth.
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 24182 W: 4672 L: 4439 D: 15071
LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 12579 W: 1959 L: 1792 D: 8828
bench:
8907701
Marco Costalba [Thu, 22 Oct 2015 04:57:06 +0000 (06:57 +0200)]
Update authors
Fishtest is a key factor of SF success.
Thanks to Fishtest we have not only greately
improved ELO but, even more important, we
have enabled a kind of joint development and
testing that it is the herat of on open
source project like SF.
Open sourcing is not just about open code, it is
about commuity development. In case of a chess engine
this has never been possible before due to missing
a strong and strict testing environment that allows
many people to contribute in a safe and coordinate way.
Fishtest is a new way of developing chess engines,
something that has never exsisted before.
No functional change.
Stefano80 [Wed, 21 Oct 2015 02:46:06 +0000 (19:46 -0700)]
Almost passed tuning attempts
Collect and give a second try to some almost passed tuning attempts and
one-line tweaks from the last month.
Passed STC
LLR: 3.07 (-2.94,2.94) [0.00,4.00]
Total: 15124 W: 2974 L: 2756 D: 9394
And LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 21577 W: 3507 L: 3289 D: 14781
Bench:
8855226
Resolves #464
mbootsector [Tue, 6 Oct 2015 06:15:17 +0000 (08:15 +0200)]
Lazy SMP
Start all threads searching on root position and
use only the shared TT table as synching scheme.
It seems this scheme scales better than YBWC for
high number of threads.
Verified for nor regression at STC 3 threads
LLR: -2.95 (-2.94,2.94) [-3.00,1.00]
Total: 40232 W: 6908 L: 7130 D: 26194
Verified for nor regression at LTC 3 threads
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 28186 W: 3908 L: 3798 D: 20480
Verified for nor regression at STC 7 threads
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 3607 W: 674 L: 526 D: 2407
Verified for nor regression at LTC 7 threads
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 4235 W: 671 L: 528 D: 3036
Tested with fixed games at LTC with 20 threads
ELO: 44.75 +-7.6 (95%) LOS: 100.0%
Total: 2069 W: 407 L: 142 D: 1520
Tested with fixed games at XLTC (120secs) with 20 threads
ELO: 28.01 +-6.7 (95%) LOS: 100.0%
Total: 2275 W: 349 L: 166 D: 1760
Original patch of mbootsector, with additional work
from Ivan Ivec (log formula), Joerg Oster (id loop
simplification) and Marco Costalba (assorted formatting
and rework).
Bench:
8116244
Stéphane Nicolet [Fri, 16 Oct 2015 04:27:52 +0000 (21:27 -0700)]
Asymmetry bonus for the attacking side
Use asymmetry in the position (king separation, pawn structure) to
compute an "initiative bonus" for the attacking side.
Passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 14563 W: 2826 L: 2636 D: 9101
And LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 14363 W: 2317 L: 2141 D: 9905
Bench:
8116244
Resolves #462
VoyagerOne [Mon, 12 Oct 2015 21:00:54 +0000 (14:00 -0700)]
Combination of two ideas:
Apply bonus for the prior CMH that caused a fail low.
Balance Stats: CMH and History bonuses are updated differently.
This eliminates the "fudge" factor weight when scoring moves. Also
eliminated discontinuity in the gravity history stat formula. (i.e. stat
scores will no longer inverse when depth exceeds 22)
STC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 21802 W: 4107 L: 3887 D: 13808
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 46036 W: 7046 L: 6756 D: 32234
Bench:
7677367
Jonathan Calovski [Wed, 7 Oct 2015 08:48:54 +0000 (19:48 +1100)]
Retire rook contact checks
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 34114 W: 6363 L: 6265 D: 21486
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 61776 W: 9349 L: 9289 D: 43138
LTC (after rebasing):
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 15261 W: 2343 L: 2214 D: 10704
Bench:
7523382
Resolves #442
Marco Costalba [Wed, 7 Oct 2015 18:33:37 +0000 (20:33 +0200)]
Travis CI: add gcc 4.8 for osx
This setup was still missing.
Suggested by Stéphane Nicolet.
No functional change.
Marco Costalba [Tue, 6 Oct 2015 09:59:06 +0000 (11:59 +0200)]
Travis CI: add clang and osx
Extend builds to clang and osx platforms.
And check bench numbers.
No functional change.
Stefano80 [Tue, 6 Oct 2015 02:48:47 +0000 (19:48 -0700)]
Tuning of assorted values
Passed STC
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 45401 W: 8590 L: 8274 D: 28537
Passed LTC
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 36089 W: 5589 L: 5331 D: 25169
Bench:
8397672
Resolves #445
Alain SAVARD [Tue, 6 Oct 2015 02:32:26 +0000 (03:32 +0100)]
Remove queen threat evaluation
Threats by queen seem to be worthless.
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 13627 W: 2607 L: 2473 D: 8547
LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 19146 W: 2950 L: 2827 D: 13369
Bench:
8222484
Resolves #439
Marco Costalba [Mon, 5 Oct 2015 08:09:03 +0000 (10:09 +0200)]
Add Trevis CI support
Add Travis CI support to GitHub repo.
After every push to master, Travis will build
the sources directly from GitHub repo according
to .travis.yml and verify everything is ok.
No functional change.
Marco Costalba [Fri, 2 Oct 2015 09:45:39 +0000 (11:45 +0200)]
Fix a comment in TTEntry::save
Comment was slightly incorrect.
No functional change.
Marco Costalba [Sun, 27 Sep 2015 08:53:39 +0000 (10:53 +0200)]
Run PVS-STUDIO analyzer
Fix issues after a run of PVS-STUDIO analyzer.
Mainly false positives but warnings are anyhow
useful to point out not very readable code.
Noteworthy is the memset() one, where PVS prefers ss-2
instead of stack. This is because memeset() could
be optimized away by the compiler when using 'stack',
due to stack being a local variable no more used after
memset. This should normally not happen, but when
it happens it leads to very sublte and difficult
to find bug, so better to be safe than sorry.
No functional change.
Stefan Geschwentner [Sat, 3 Oct 2015 10:46:53 +0000 (03:46 -0700)]
File based passed pawn bonus
Add file based bonus for passed pawns. Values tuned by SPSA.
STC:
LLR: 3.33 (-2.94,2.94) [0.00,5.00]
Total: 36889 W: 6805 L: 6507 D: 23577
LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 32301 W: 5101 L: 4858 D: 22342
Bench:
8073614
Resolves #436
Jonathan Calovski [Sat, 3 Oct 2015 10:36:51 +0000 (03:36 -0700)]
Bonus for checking moves
STC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 14531 W: 2765 L: 2576 D: 9190
LTC:
LLR: 3.20 (-2.94,2.94) [0.00,5.00]
Total: 52518 W: 8107 L: 7782 D: 36629
Bench:
7556477
Resolves #435
Marco Costalba [Sun, 27 Sep 2015 12:49:33 +0000 (14:49 +0200)]
Rework lock protecting
When changing 'search' and 'splitPointsSize' we have to
use thread locks, not split point ones, because can_join()
is called under the formers.
Verified succesfully with 24 hours toruture tests with 20
cores machine by Louis Zulli: it does not hangs.
Verifyed for no regressions with STC, 7 threads:
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 52804 W: 8159 L: 8087 D: 36558
No functional change.
Jonathan Calovski [Fri, 18 Sep 2015 22:28:26 +0000 (08:28 +1000)]
Refine ranks and increase resulting bonus.
STC:
LLR: 2.94 (-2.94,2.94) [0.00,4.00]
Total: 272379 W: 51773 L: 50658 D: 169948
LTC:
LLR: 3.06 (-2.94,2.94) [0.00,4.00]
Total: 41504 W: 6555 L: 6273 D: 28676
bench:
7658406
Resolves #430
mstembera [Tue, 15 Sep 2015 20:28:42 +0000 (13:28 -0700)]
Reduce writes in TT::probe().
Only refresh TT entry when it's really necessary.
This should give a small speed boost for some machines.
And it's a risk-free change.
No functional change.
Resolves #429
mstembera [Fri, 18 Sep 2015 00:13:45 +0000 (17:13 -0700)]
Remove unnecessary generation check in TT save
Checking for generation is unnecessary because if the key matches then the entry was probed and refreshed earlier.
STC 2MB
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 57391 W: 10671 L: 10613 D: 36107
http://tests.stockfishchess.org/tests/view/
55ef59fa0ebc5976a2d6da5d
LTC 8MB
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 60732 W: 9260 L: 9199 D: 42273
http://tests.stockfishchess.org/tests/view/
55ef8fe60ebc5976a2d6da6b
STC 16MB
LLR: 2.95 (-2.94,2.94) [-4.00,0.00]
Total: 23443 W: 4369 L: 4293 D: 14781
http://tests.stockfishchess.org/tests/view/
55ef8fe60ebc5976a2d6da6b
No functional change
Resolves #427
Stefan Geschwentner [Tue, 15 Sep 2015 12:55:09 +0000 (05:55 -0700)]
Scales the endgame score by the number of pawns.
Credits goes also to Stephane Nicolet for his great idea of scaling by pawns.
STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 9994 W: 1929 L: 1760 D: 6305
LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 11240 W: 1789 L: 1626 D: 7825
bench
7298564
Resolves #423
Joona Kiiski [Sun, 6 Sep 2015 20:36:59 +0000 (21:36 +0100)]
Careful SMP locking - Fix very occasional hangs
Louis Zulli reported that Stockfish suffers from very occasional hangs with his 20 cores machine.
Careful SMP debugging revealed that this was caused by "a ghost split point slave", where thread
was marked as a split point slave, but wasn't actually working on it.
The only logical explanation for this was double booking, where due to SMP race, the same thread
is booked for two different split points simultaneously.
Due to very intermittent nature of the problem, we can't say exactly how this happens.
The current handling of Thread specific variables is risky though. Volatile variables are in some
cases changed without spinlock being hold. In this case standard doesn't give us any kind of
guarantees about how the updated values are propagated to other threads.
We resolve the situation by enforcing very strict locking rules:
- Values for key thread variables (splitPointsSize, activeSplitPoint, searching)
can only be changed when the thread specific spinlock is held.
- Structural changes for splitPoints[] are only allowed when the thread specific spinlock is held.
- Thread booking decisions (per split point) can only be done when the thread specific spinlock is held.
With these changes hangs didn't occur anymore during 2 days torture testing on Zulli's machine.
We probably have a slight performance penalty in SMP mode due to more locking.
STC (7 threads):
ELO: -1.00 +-2.2 (95%) LOS: 18.4%
Total: 30000 W: 4538 L: 4624 D: 20838
However stability is worth more than 1-2 ELO points in this case.
No functional change
Resolves #422
mstembera [Mon, 7 Sep 2015 19:17:39 +0000 (20:17 +0100)]
Minor clean up of some function parameters
No function change
Resolves #416
mstembera [Wed, 2 Sep 2015 00:36:03 +0000 (17:36 -0700)]
Fix syzygy en passant issue
v = value without ep capture being considered
v1 = value of the ep capture
The correct logic is:
if without e.p. capture we are losing, and the value of e.p is either draw, or win or "loss, but 50 move rule saves us", then we should use the value of ep capture.
Credit and thanks to syzygy1 and lantonov !
No functional change (except with syzygy bases)
Resolves #415
Resolves #394
gguliash [Sun, 30 Aug 2015 18:53:07 +0000 (19:53 +0100)]
A small code simplification
No functional change
Resolves #411
Joona Kiiski [Tue, 25 Aug 2015 19:52:44 +0000 (20:52 +0100)]
History gravity
Instead of using hard coded Min and Max values for history,
always adjust the old value slightly downwards before adding a new value.
The adjustment acts like gravity that prevents the value escaping too
far from zero.
Bench:
8020484
Resolves #407
Marco Costalba [Tue, 25 Aug 2015 15:12:51 +0000 (17:12 +0200)]
Reformat trace code
Apart from usual renaiming, take advantage of
C++11 function template default parmeter to
get rid of Eval trampoline functions.
Some triviality fixes while there.
No functional change.
lucasart [Tue, 25 Aug 2015 11:46:37 +0000 (19:46 +0800)]
Prune castling moves
Align the behaviour with reductions. Initially castling moves had to be
treated differently, because the SEE did not handle them correctly. But now it
does.
STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 83750 W: 15722 L: 15711 D: 52317
LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 97183 W: 15120 L: 15115 D: 66948
bench
7759837
Resolves #403
mstembera [Thu, 20 Aug 2015 19:24:37 +0000 (20:24 +0100)]
Better document entry age calculation used in TT replace.
No functional change.
Resolves #401
Resolves #400
lucasart [Tue, 18 Aug 2015 10:53:16 +0000 (18:53 +0800)]
Retire dangerous flag
Replace by its value where it is used. Code is more clear that
way.
No functional change.
Resolves #402
Alain SAVARD [Mon, 17 Aug 2015 18:30:17 +0000 (19:30 +0100)]
Retire PawnSafePush bonus
PawnSafePush, with the value S(5,5) proved not "necessary"
possibly due to recent changes to MobilityArea and other changes to Connected bonus.
STC:
LLR: 3.22 (-2.94,2.94) [-3.00,1.00]
Total: 98528 W: 18757 L: 18759 D: 61012
LTC:
LLR: 5.30 (-2.94,2.94) [-3.00,1.00]
Total: 204194 W: 31698 L: 31734 D: 140762
Bench:
7620871
Resolves #396
Marco Costalba [Sat, 15 Aug 2015 13:55:14 +0000 (15:55 +0200)]
Reformat PassedPawnsBonus
Align to SF coding standards.
No functional change.
mstembera [Sat, 15 Aug 2015 11:22:54 +0000 (12:22 +0100)]
TT entry value based on depth and relative age
Calculate TT replace value as depth minus eight times relative age.
STC 2MB
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 45258 W: 8595 L: 8279 D: 28384
LTC 8MB
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 56401 W: 8809 L: 8489 D: 39103
STC 16MB
LLR: 2.96 (-2.94,2.94) [-4.00,0.00]
Total: 34764 W: 6565 L: 6529 D: 21670
Bench:
9069474
Resolves #395
DiscanX [Sun, 9 Aug 2015 17:25:41 +0000 (01:25 +0800)]
Tuned values for mid and end game passed pawns.
STC :
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 22691 W: 4468 L: 4228 D: 13995
LTC :
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 13620 W: 2216 L: 2023 D: 9381
Bench:
8384669
Resolves #391
mstembera [Sat, 8 Aug 2015 10:06:32 +0000 (03:06 -0700)]
Revert TT replacement strategy changes (#380)
It could cause problems with high depths and long time controls
Bench:
8626315
Resolves #390
Marco Costalba [Tue, 4 Aug 2015 07:00:52 +0000 (09:00 +0200)]
Rename Position::list
Use Position::square and Position::squares instead.
This allow us to remove king_square(), simplify
endgames and to have more naming uniformity.
Moreover, this is a prerequisite step in case
in the future we decide to retire piece lists
altoghter and use pop_lsb() to loop across
pieces and serialize the moves. In this way
we just need to change definition of Position::square
to something like:
template<PieceType Pt> inline
Square Position::square(Color c) const {
return lsb(byColorBB[c]);
}
No functional change.
Marco Costalba [Tue, 28 Jul 2015 10:53:13 +0000 (12:53 +0200)]
Simplify IID depth formula
Restore original formula messed up during
half-ply removal.
STC
LLR: 4.11 (-2.94,2.94) [-3.00,1.00]
Total: 21349 W: 4091 L: 3909 D: 13349
LTC
LLR: 5.42 (-2.94,2.94) [-3.00,1.00]
Total: 52819 W: 8321 L: 8122 D: 36376
bench:
8040572
VoyagerOne [Wed, 29 Jul 2015 16:50:45 +0000 (00:50 +0800)]
PV refutation penalty
Extra penalty for PV move in previous ply when it gets refuted.
STC:
LLR: 4.49 (-2.94,2.94) [-1.50,4.50]
Total: 41094 W: 7889 L: 7620 D: 25585
LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 12304 W: 1967 L: 1811 D: 8526
Bench:
8373608
Resolves #386
Alain SAVARD [Wed, 29 Jul 2015 16:47:51 +0000 (00:47 +0800)]
MobilityArea (simplified)
Based off of Pull request #383:
Include squares occupied by some pawns in the MobilityArea
a) not blocked
b) on rank 4 and above
c) or captures
Passed STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 8157 W: 1644 L: 1516 D: 4997
And LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 26086 W: 4274 L: 4051 D: 17761
-----------
Then, a simplification test failed, trying to remove b and c)
LLR: -2.95 (-2.94,2.94) [-3.00,1.00]
Total: 6048 W: 1117 L: 1288 D: 3643
Another simplification test, was run to remove just (c)
Passed STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 28073 W: 5364 L: 5255 D: 17454
And LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 34652 W: 5448 L: 5348 D: 23856
A parameter tweak test showed that changing b) for "on rank 3 and above"
does not work
LLR: -2.95 (-2.94,2.94) [0.00,4.00]
Total: 5233 W: 937 L: 1077 D: 3219
Finally, a small rewrite, and we have this version
Include squares occupied by some pawns in the MobilityArea which are
a) not blocked
b) on rank 4 and above
Bench:
8977899
Resolves #385
mstembera [Fri, 24 Jul 2015 16:33:53 +0000 (00:33 +0800)]
Tuned version of TT replacement policy
If the used multiplier of 8 was any number larger than DEPTH_MAX
this would be a non functional patch.
STC 2MB
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 16353 W: 3216 L: 3066 D: 10071
http://tests.stockfishchess.org/tests/view/
55a6d0630ebc590abbe1babd
LTC 8MB
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 134618 W: 21276 L: 20716 D: 92626
http://tests.stockfishchess.org/tests/view/
55a74d760ebc590abbe1bad6
STC 16MB
LLR: 2.96 (-2.94,2.94) [-4.00,0.00]
Total: 22549 W: 4257 L: 4178 D: 14114
http://tests.stockfishchess.org/tests/view/
55a9a2f90ebc590abbe1bb16
Bench:
7372460
Resolves #380
Marco Costalba [Sun, 19 Jul 2015 09:25:14 +0000 (11:25 +0200)]
Tidy up in movepick.cpp
Some formattng after recent changes.
No functional change.