1
0
Fork 0
Commit Graph

3745 Commits (SF7_status)

Author SHA1 Message Date
mbootsector 1d5eaba573 Retire follow-up move heuristic
STC: http://tests.stockfishchess.org/tests/view/5501d0f30ebc5902160ec0fd
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 34891 W: 6904 L: 6808 D: 21179

LTC: http://tests.stockfishchess.org/tests/view/550328540ebc5902160ec133
LLR: 3.10 (-2.94,2.94) [-3.00,1.00]
Total: 182653 W: 29866 L: 29993 D: 122794

Bench: 8396161

Resolves #310
2015-03-28 22:12:06 +00:00
VoyagerOne ac8e6ff000 Use CounterMoveHistory when calculating LMR for cut nodes
If the sum of CounterMoveHistory heuristic and History heuristic is below zero,
then reduce an extra ply in cut nodes

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 6479 W: 1099 L: 967 D: 4413

Bench: 7773299

Resolves #315
2015-03-28 21:15:49 +00:00
Marco Costalba 3a6753328c Clean up previous patch
No functional change.
2015-03-25 07:05:27 +01:00
joergoster 50182f1100 Tuned values for the pawn piece square table
Quick measure at very fast tc:
ELO: 4.77 +-2.2 (95%) LOS: 100.0%
Total: 40124 W: 8711 L: 8160 D: 23253

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 52284 W: 8880 L: 8559 D: 34845

Bench: 8865736

Resolves #311
2015-03-25 07:39:44 +08:00
VoyagerOne e51965aa57 Introduce a new counter move history penalty
Extra penalty for TT move in previous ply when it gets refuted

STC:

LLR: 2.94 (-2.94,2.94) [-1.50,4.50]
Total: 31303 W: 6216 L: 6025 D: 19062

LTC:

LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 6950 W: 1189 L: 1054 D: 4707

Bench: 8191926

Resolves #309
2015-03-24 23:04:08 +00:00
Joona Kiiski a7381d5e81 Fully yielding locks, no spinning
7 threads:

ELO: 2.00 +-2.7 (95%) LOS: 92.4%
Total: 20000 W: 3276 L: 3161 D: 13563

There is no functional change in single thread mode

Resolves #304
2015-03-24 21:34:19 +00:00
Marco Costalba dc3a5f791e Allow Bitbases::init() to be called more than once
Currently if we call it more than once, we crash.

This is not a real problem, because this function is
indeed called just once. Nevertheless with this small fix,
that gets rid of a hidden 'static' variable, we cleanly
resolve the issue.

While there, fix also ThreadPool::exit to return in a
consistent state. Now all the init() functions but
UCI::init() are reentrant and can be called multiple
times.

No functional change.
2015-03-23 17:14:31 +01:00
Marco Costalba 35a082064f Double magics generation speed
Profiling shows that resetting attacks table after
a failed candidate magic attempt is the biggest
time consumer, so rewrite the logic avoiding the
memset()

Magics init for rook+bishop goes from 200msecs to
under 100msec.

No functional change.
2015-03-23 17:10:38 +01:00
Marco Costalba be77406a55 Get rid of nativeThread
No functional change.
2015-03-23 09:02:52 +01:00
Marco Costalba 26dabb1e6b Use only one ConditionVariable to sync UI
To sync UI with main thread it is enough a single
condition variable because here we have a single
producer / single consumer design pattern.

Two condition variables are strictly needed just for
many producers / many consumers case.

Note that this is possible because now we don't send to
sleep idle threads anymore while searching, so that now
only UI can wake up the main thread and we can use the
same ConditionVariable for both threads.

The natural consequence is to retire wait_for_think_finished()
and move all the logic under MainThread class, yielding the
rename of teh function to join()

No functional change.
2015-03-21 07:55:33 +01:00
lucasart 35b6079852 Fix comment
We always probe, but we do not prune at PV nodes.

No functional change.

Resolves #300
2015-03-20 22:40:03 +00:00
Marco Costalba ebf3735754 Retire ConditionVariable
Now that we use spinlocks everywhere and don't put
threads to sleep while idle, we can use the slower
(but no more in hot path) std::condition_variable_any
instead of our homwgrown ConditionVariable struct.

Verified fo rno regression at STC with 7 threads:
ELO: -0.66 +-2.7 (95%) LOS: 31.8%
Total: 20000 W: 3210 L: 3248 D: 13542

No functional change
2015-03-20 03:05:25 +01:00
joergoster 966bc477af Tuned mobility with another SPSA run
Further improved mobility values after another SPSA session, 50k
iterations.

Elo measure at very fast 9+0.05":
ELO: 3.40 +-2.2 (95%) LOS: 99.9%
Total: 40000 W: 8434 L: 8042 D: 23524

and LTC SPRT[0, 4]:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 11052 W: 1874 L: 1687 D: 7491

Bench: 8226843

Resolves #301
2015-03-20 08:08:21 +08:00
joergoster c6f987d1ad Fix the comment for Position::is_draw()
We no longer check for insufficient material.

No functional change

Resolves #299
2015-03-18 20:30:50 +00:00
lucasart d477a0d611 connected should be bool, not Bitboard
There's no reason to define it as a Bitboard, so for consistency, use bool.

This is even a speedup on my machine: i7-3770k, using gcc 4.9.1 (linux):

    stat        test     master    diff
    mean   2,341,338  2,327,998  13,134
    stdev     15,765     14,717   5,405

    speedup       0.56%
    P(speedup>0) 100.0%

No functional change.

Resolves #298
2015-03-18 20:21:41 +00:00
Marco Costalba 54889618c2 Reformat FastMove
Align to SF coding style.

Verified no regression:

LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 55938 W: 10893 L: 10835 D: 34210

No functional change.
2015-03-18 08:12:59 +01:00
Marco Costalba 9a6cfee73b Simplify nosleep logic
Avoid redundant 'while' conditions. It is enough to
check them in the outer loop.

Quick tested for no regression 10K games at 4 threads
ELO: -1.32 +-3.9 (95%) LOS: 25.6%
Total: 10000 W: 1653 L: 1691 D: 6656

No functional change.
2015-03-18 08:01:50 +01:00
Marco Costalba 2e8552db76 Fix a bogus use of mutex
Spinlock must be used instead.

Tested for no regression at 15+0.05 th 4:

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 25928 W: 4303 L: 4190 D: 17435

No functional change.

Resolves #297
2015-03-17 08:19:29 +00:00
Marco Costalba a4b2eeea75 Re-arrange history update code
Unify the quites moves loop for both cases,
the compiler optimizes away the

 if (is_ok((ss-1)->currentMove))

inside loop, so that the result is same
speed as original.

No functional change.
2015-03-16 15:14:09 +01:00
Marco Costalba 13d4df95cd Use acquire() and release() for spinlocks
It is more idiomatick than lock() and unlock()

No functional change.
2015-03-16 08:14:08 +01:00
Vince Negri bae4679de2 Fix dependency generation for MacOSX
No functional change

Resolves #290
2015-03-15 20:31:43 +00:00
Joona Kiiski a3943b2aa7 Fix dependency generation for C++11
No functional change

Resolves #291
2015-03-15 20:26:08 +00:00
Joona Kiiski f04f50b368 Do not sleep, but yield
During the search, do not block on condition variable, but instead use std::this_thread::yield().

Clear gain with 16 threads. Again results vary highly depending on hardware, but on average it's a clear gain.

ELO: 12.17 +-4.3 (95%) LOS: 100.0%
Total: 7998 W: 1407 L: 1127 D: 5464

There is no functional change in single thread mode

Resolves #294
2015-03-15 19:45:30 +00:00
joergoster a4b98a052e New values for Mobility and Outposts.
Both are the result of a SPSA tuning session with a custom book, 50k iterations each.

After an additional tuning session of the mobility values, tuning the delta values, with following result.

40k games at 9+0.05:
ELO: 4.13 +-2.2 (95%) LOS: 100.0%
Total: 40000 W: 8581 L: 8106 D: 23313

and LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 36518 W: 6049 L: 5782 D: 24687

Bench: 8567402

Resolves #284
2015-03-14 21:35:52 +00:00
Marco Costalba e5da0e4b79 Link with -static in mingw
Fixes reported startup error about missing libwinpthread-1.dll
when the dll is not in the path.

The current -static-xxxx flags, introduced with:

https://github.com/official-stockfish/Stockfish/commit/373503f4a9a990054b5

Only take in account standard libraries, but not thread
library.

No functional change.

Resolves #289
2015-03-14 19:23:54 +00:00
Joona Kiiski d71f707040 Introduce yielding spin locks
Idea and original implementation by Stephane Nicolet

7 threads 15+0.05
ELO: 3.54 +-2.9 (95%) LOS: 99.2%
Total: 17971 W: 2976 L: 2793 D: 12202

There is no functional change in single thread mode
2015-03-14 19:14:52 +00:00
Joona Kiiski 558b0c848c Remove check for gcc version from Makefile.
This check is obsolete.
very old gcc versions can't compile c++11 code.

No functional change

Resolves #285
2015-03-13 20:29:28 +00:00
mstembera 062ca91db5 New easy move implementation
Spend much less time in positions where one move is much better than all other alternatives.
We carry forward pv stability information from the previous search to identify such positions.
It's based on my old InstaMove idea but with two significant improvements.

1) Much better instability detection inside the search itself.
2) When it's time to make a FastMove we no longer make it instantly but still spend at least 10% of normal time verifying it.

Credit to Gull for the inspiration.
BIG thanks to Gary because this would not work without accurate PV!

20K
ELO: 8.22 +-3.0 (95%) LOS: 100.0%
Total: 20000 W: 4203 L: 3730 D: 12067

STC
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 23266 W: 4662 L: 4492 D: 14112

LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 12470 W: 2091 L: 1931 D: 8448

Resolves #283
2015-03-12 19:49:30 +00:00
Stefan Geschwentner 13c11f4048 Introduce Counter Move History tables
Introduce a counter move history table which additionally is indexed by the last move's piece and target square.
For quiet move ordering use now the sum of standard and counter move history table.

STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 4747 W: 1005 L: 885 D: 2857

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 5726 W: 1001 L: 872 D: 3853

Because of reported low NPS on multi core test
STC (7 threads):
ELO: 7.26 +-3.3 (95%) LOS: 100.0%
Total: 14937 W: 2710 L: 2398 D: 9829

Bench: 7725341

Resolves #282
2015-03-12 07:29:57 +00:00
Joona Kiiski 81c7975dcd Use thread specific mutexes instead of a global one.
This is necessary to improve the scalability with high number of cores.

There is no functional change in a single thread mode.

Resolves #281
2015-03-11 21:59:34 +00:00
Marco Costalba 4b59347194 Retire spinlocks
Use Mutex instead.

This is in preparaation for merging with master branch,
where we stilll don't have spinlocks.

Eventually spinlocks will be readded in some future
patch, once c++11 has been merged.

No functional change.
2015-03-11 21:20:47 +01:00
Marco Costalba 6027652773 Cleanup thread_win.h
No functional change.
2015-03-10 17:13:52 +01:00
Marco Costalba 04372316b3 Disable spinlocks
To allow testing on fishtest.

No functional change.
2015-03-10 12:47:49 +01:00
Marco Costalba 8725494966 Add thread_win32.h header
Workaround slow std::thread implementation in mingw
and gcc for Windows with our own old low level thread
functions.

No functional change.
2015-03-10 12:42:40 +01:00
Marco Costalba be50952533 Sync with master
bench: 8285241
2015-03-07 10:56:01 +01:00
Marco Costalba e53774bc49 Sync with master
No functional change.
2015-03-07 10:45:58 +01:00
hxim 3017e8c604 Transform minKingPawnDistance into a local variable
minKingPawnDistance is used only as local variable in one place so we don't need it to be part of "Pawns::Entry" structure.

No functional change.

Resolves #277
2015-03-07 09:03:19 +00:00
Stéphane Nicolet 8fcaa78a04 Update Makefile for Mac OS X compilation
This change in the Makefile restores the possibility to compile
Stockfish on Mac OS X 10.9 and 10.10 after the C++11 has been merged.

To use the default (fastest) settings, compile with:

make build ARCH=x86-64-modern

To test the clang settings, compile with

make build ARCH=x86-64-modern COMP=clang

Beware that the clang settings may provide a slightly slower (6%)
executable.

Backported from master.

No functional change

Resolves #275
2015-03-07 08:39:21 +01:00
Marco Costalba a590d1d52d Re-enable spinlocks
For branch C++11, that doe snot run on fishtest,
there is no need of this kludge, let only master
have it.

No functional change.
2015-03-07 08:38:26 +01:00
Joona Kiiski 856a5f3aaa Revert C++11 merge
Restore the state of repo back to commit 'Simplify pawn code a bit' (1e6d21dbb6)

No functional change
2015-03-07 07:38:22 +00:00
Stéphane Nicolet 6fa6da3ee1 Update Makefile for Mac OS X compilation
This change in the Makefile restores the possibility to compile
Stockfish on Mac OS X 10.9 and 10.10 after the C++11 has been merged.

To use the default (fastest) settings, compile with:

make build ARCH=x86-64-modern

To test the clang settings, compile with

make build ARCH=x86-64-modern COMP=clang

Beware that the clang settings may provide a slightly slower (6%)
executable.

No functional change

Resolves #275
2015-03-05 04:18:59 +00:00
Marco Costalba cb2111f0b6 Disable spinlocks
Now that c++11 branch has been merged in master,
disable unconditionally the spinlocks and use mutex
instead. This will allow to run fishtest even on HT
machines withouth changes.

In the future we will reintorduce spinlocks, once
we will have took care of fishtest.

No functional change.
2015-03-02 08:11:39 +01:00
Marco Costalba 6645115377 Allow to disable spinlocks
And use mutex instead. You may never want to do this.
It is a workaround to run c++11 on fishtest where many
machiens have HTenabled and this can be a problem when
number of cores set is higher than number of physical cores.

To disable spinlocks, just compile with -DNO_SPINLOCK flag

No functional change.
2015-03-01 17:16:05 +01:00
Marco Costalba 63a5fc2366 Rename available_to()
Change this API to be more natural and simple.

Inspired by a patch by Joona.

No functional change.
2015-03-01 12:33:05 +01:00
Marco Costalba 0da7295795 Sync with master
bench: 8285241
2015-02-28 20:22:28 +01:00
Stéphane Nicolet 1e6d21dbb6 Simplify pawn code a bit
Simplify a bit the number of bitwise operators used to calculate the
pawn evaluation in pawns.cpp

No functional change.

Resolves #269
2015-03-01 01:01:37 +08:00
Stéphane Nicolet 9369f4963d Raise penalty for knight attacked by pawn
Raise a bit the penalty for knight attacked by pawn.

STC:
LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 27744 W: 5563 L: 5380 D: 16801

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 87571 W: 14747 L: 14314 D: 58510

Bench: 8285241

Resolves #270
2015-03-01 00:58:32 +08:00
Marco Costalba a459709fcc Retire apply_weight()
Use the more natural operator*() instead.

No functional change.
2015-02-27 10:38:12 +01:00
Marco Costalba 2dbb1adf2a Sync with master
bench: 8069601
2015-02-26 20:50:39 +01:00
Marco Costalba 8a2c4134a6 Normalize twice supported pawns
Align codying style to current conventions and move
formula for twice supported pawns to Pawns::init()
where it should be.

No functional change.
2015-02-27 01:56:16 +08:00