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

3480 commits

Author SHA1 Message Date
Marco Costalba
dccaa145d2 Compute SplitPoint::spLevel on the fly
And retire a redundant field. This is important also
from a concept point of view becuase we want to keep
SMP structures as simple as possible with the only
strictly necessary data.

Verified with

dbg_hit_on(sp->spLevel != level)

that the values are 100% the same out of more 50K samples.

No functional change.
2015-02-18 21:50:35 +01:00
Marco Costalba
6656ed8904 Simplify attackUnits formula
Use '/ 8' instead of '* 31 / 256'

Passed STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 55077 W: 10999 L: 10940 D: 33138

And LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 14751 W: 2530 L: 2400 D: 9821

bench: 7911944
2015-02-17 08:23:35 +01:00
Joona Kiiski
d65f75c153 Improve smp performance for high number of threads
Balance threads between split points.

There are huge differences between different machines and autopurging makes it very difficult to measure the improvement in fishtest, but the following was recorded for 16 threads at 15+0.05:

    For Bravone (1000 games): 0 ELO
    For Glinscott (1000 games): +20 ELO
    For bKingUs (1000 games): +50 ELO
    For fastGM (1500 games): +50 ELO

The change was regression for no one, and a big improvement for some, so it should be fine to commit it.
Also for 8 threads at 15+0.05 we measured a statistically significant improvement:
ELO: 6.19 +-3.9 (95%) LOS: 99.9%
Total: 10325 W: 1824 L: 1640 D: 6861

Finally it was verified that there was no (significant) regression for

4 threads:
ELO: 0.09 +-2.8 (95%) LOS: 52.4%
Total: 19908 W: 3422 L: 3417 D: 13069

2 threads:
ELO: 0.38 +-3.0 (95%) LOS: 60.0%
Total: 19044 W: 3480 L: 3459 D: 12105

1 thread:
ELO: -1.27 +-2.1 (95%) LOS: 12.3%
Total: 40000 W: 7829 L: 7975 D: 24196

Resolves #258
2015-02-16 20:36:13 +00:00
lucasart
f8f5dcbb68 Compute checkers from scratch
This micro-optimization only complicates the code and provides no benefit.
Removing it is even a speedup on my machine (i7-3770k, linux, gcc 4.9.1):

stat        test     master    diff
mean   2,403,118  2,390,904  12,214
stdev     12,043     10,620   3,677

speedup       0.51%
P(speedup>0) 100.0%

No functional change.
2015-02-16 09:34:26 +08:00
Marco Costalba
20a5c07472 Further simplify KingDanger init
And remove a tale whitespace while there.

No functional change.
2015-02-14 15:56:54 +01:00
snicolet
a8f9c7a790 Small bonus for all safe pawn pushes
Pawn flexibility: add a small bonus for all safe pawn pushes

STC:
LLR: 2.70 (-2.94,2.94) [-1.50,4.50]
Total: 18233 W: 3705 L: 3557 D: 10971

LTC:
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 17684 W: 3042 L: 2854 D: 11788

Bench: 7369224

Resolves #253
2015-02-13 21:33:00 +00:00
hxim
44a571c1c7 Fix KingDanger[] array initialization
Use integer arithmetic instead of floating point arithmetic.
Floating point arithmetic was causing different results for some 32-bit compiles

No functional change

Resolves #249
Resolves #250
2015-02-09 22:02:35 +00:00
Joona Kiiski
e118570038 Pawn Center Bind Bonus
Bonus for two pawns controlling the same central square

STC:

LLR: 3.14 (-2.94,2.94) [-1.50,4.50]
Total: 15974 W: 3291 L: 3133 D: 9550

LTC:

LLR: 3.24 (-2.94,2.94) [0.00,6.00]
Total: 10449 W: 1837 L: 1674 D: 6938

Idea from Lyudmil Tsvetkov.

Bench: 7699138

Resolves #248
2015-02-08 19:28:01 +00:00
Marco Costalba
170bdf40cd Rename dbg_hit_on_c() to dbg_hit_on()
Use an overload instead of a new named function.

I have found this handier and easier when adding
some quick debug code.

No functional change.
2015-02-07 11:18:06 +01:00
lucasart
35aa21c1fe Removes useless templates, some of which lead to code duplication: is_K*() functions.
No functional change

Resolves #245
2015-02-07 09:12:04 +00:00
Stefan Geschwentner
18b0809639 Add bonus for pawn attack threats
Latent pawn attacks: Add a bonus to safe pawn pushes which attacks an
enemy piece.  Based on an idea of Lyudmil Tsvetkov.

STC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 7925 W: 1666 L: 1537 D: 4722

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 40109 W: 6841 L: 6546 D: 26722

Bench: 7696257

Resolves #240
2015-02-03 11:19:33 +08:00
mstembera
f4136c5434 Profile build options
I went through all the individual compile options that differ between
-fprofile-generate/-fprofile-use  and  -fprofile-arcs/-fbranch-probabilities
and distilled the speed difference down to only turning off
-fno-peel-loops and -fno-tracer.  Using this we still get the full speedup
(maybe a bit more because other optimizations stay on) and it's also much cleaner
because we can get rid of the "@rm -f ucioption.gc*" hack for all versions of gcc.

No functional change.

Resolves #237
2015-02-03 11:09:37 +08:00
NicklasPersson
ddccb5355c Improved King Safety values
From an SPSA-session on king safety.

STC:
ELO: 3.21 +-2.1 (95%) LOS: 99.8%
Total: 40000 W: 8181 L: 7812 D: 24007

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 47765 W: 8091 L: 7785 D: 31889

Bench: 8589262

Resolves #241
2015-02-03 04:00:52 +08:00
Marco Costalba
a7592e69d7 Fix a MSVC warning
warning C4805: '|' : unsafe mix of type 'Bitboard' and type 'bool' in operation

No functional change.
2015-01-31 10:19:00 +01:00
Jean-Francois Romang
a3b4e9e23c Ressurrect hashfull patch
This is an old patch from Jean-Francois Romang to send
UCI hashfull info to the GUI:
https://github.com/mcostalba/Stockfish/pull/60/files

It was wrongly judged as a slowdown, but it takes much
less than 1 ms to run, indeed on my core i5 2.6Ghz it
takes about 2 microsecs to run!

Regression test is good:

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 7352 W: 1548 L: 1401 D: 4403

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 61432 W: 10307 L: 10251 D: 40874

I have set the name of the author to the original
one.

No functional change.
2015-01-30 18:07:20 +01:00
Marco Costalba
ce0a95c2c0 Simplify skill level and reduce ELO
This patch has two positive effects:

- Retire a hackish formula and leave
  just a natural, simple and plain one.

- Reduce strenght at very low level, but
  don't impact medium/high levels.

Actually even at level 0, SF is still too
strong for many beginners (this was reported
many times for instance on Droidfish user
comments on Google Play).

Test on fishtest shows that ELO drop is around
170 ELO at level 0 (good!), 130 ELO at level 1
and smoothly reduces (as expected) until level
10 where the drop is just of 8 ELO.

No functional change.
2015-01-29 22:35:24 +01:00
Alain SAVARD
8aa8608c2a Simplify backward pawn definition
Make use of 'lever' attribute

No functional change

Resolves #234
2015-01-28 21:29:04 +00:00
NicklasPersson
7837fb2aca King safety tuning with values obtained by SPSA.
Part I:

LTC:

LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 11529 W: 2075 L: 1882 D: 7572

Part II:

LTC:

ELO: 2.07 +-2.1 (95%) LOS: 97.3%
Total: 34859 W: 5967 L: 5759 D: 23133

Bench: 7374604

Resolves #228
2015-01-28 21:05:21 +00:00
Joona Kiiski
9f0d5241bf Restore development version
No functional change
2015-01-28 20:53:50 +00:00
Joona Kiiski
5b555525d2 Stockfish 6
Stockfish bench signature is: 8918745
2015-01-27 20:27:38 +00:00
Joona Kiiski
c4518e395e Stockfish 6 Release Candidate 3
- Fix a skill level problem: Don't allow move pruning at root node
- Revert "Fix profile build for gcc on Mac OSX". Results for a faster binary in x86-64.
- Fix a MSVC warning

Bench: 8918745
2015-01-25 22:03:57 +00:00
Stefan Geschwentner
d8b3ad2208 Fix a skill level problem: Don't allow move pruning at root node
Bench: 8918745

Resolves #231
2015-01-25 21:57:13 +00:00
Joona Kiiski
ec36b8dea9 Revert "Fix profile build for gcc on Mac OSX"
Seems to be a performance regression for standard build.

For SF6 people compiling on Mac OSX using profile-build option
just need to make necessary adjustments manually...

No functional change

Resolves #223
2015-01-25 21:51:09 +00:00
Marco Costalba
8ebf30d44a Fix a MSVC warning at W4
Warning is C4512 (assignment operator could not be generated)

Now, apart the foreign syzygy code, everything compiles
without warnings at warning level 4.

Backported from C++11 branch.

No functional change.
2015-01-25 09:36:05 +01:00
Joona Kiiski
5154ac9cff Stockfish 6 Release Candidate 2
- Fix a compilation issue related to BMI2 PEXT instruction
- Retrieve a ponder move from TT if PV is only one move long

Bench: 8080602

No functional change
2015-01-24 19:42:49 +00:00
Marco Costalba
54b5b528d9 Don't use _pext_u64() directly
This intrinsic to call BMI2 PEXT instruction is
defined in immintrin.h. This header should be
included only when USE_PEXT is defined, otherwise
we define _pext_u64 as 0 forcing a nop.

But under some mingw platforms, even if we don't
include the header, immintrin.h gets included
anyhow through an include chain that starts with
STL <algorithm> header. So we end up both defining
_pext_u64 function and at the same time defining
_pext_u64 as 0 leading to a compile error.

The correct solution is of not using _pext_u64 directly.

This patch fixes a compile error with some mingw64
package when compiling with x86-64.

No functional change.

Resolves #222
2015-01-24 19:38:06 +00:00
Marco Costalba
44643c2770 Try hard to retrieve a ponder move
In case we stop the search during a fail-high
it is possible we return to GUI without a ponder
move. This patch try harder to find a ponder move
retrieving it from TT. This is important in games
played with 'ponder on'.

bench: 8080602

Resolves #221
2015-01-24 19:35:31 +00:00
Joona Kiiski
97a034ad3e Stockfish 6 Release Candidate 1
Bench: 8080602

No functional change

Resolves #218
2015-01-18 14:53:11 +00:00
Joona Kiiski
1b62b47b62 Fix profile build for gcc on Mac OSX
Switch back to using -fprofile-generate and
-fprofile-use flags

No functional change

Resolves #219
Resolves #210
2015-01-18 14:42:30 +00:00
Joona Kiiski
7f51610103 Don't print fail-high or fail-lows in MultiPV mode
Supposed to give a better user experience when using MultiPV mode

No functional change

Resolves #217
2015-01-18 14:38:46 +00:00
Marco Costalba
c73f33f37e Fix syzygy warnings with Intel compiler
Quick hack, a better job would require to
first move all syzygy code up to SF standard.

No functional change.
2015-01-18 07:29:51 +01:00
Marco Costalba
05cb58f4fc Fix some missing rename from previous patch
No functional change.
2015-01-17 22:15:15 +01:00
Marco Costalba
595fc342cf Fix a possible overflow in TT resize
On platforms where size_t is 32 bit, we
can have an overflow in this expression:

(mbSize * 1024 * 1024)

Fix it setting max hash size of 2GB on platforms
where size_t is 32 bit.

A small rename while there: now struct Cluster
is definied inside class TranspositionTable so
we should drop the redundant TT prefix.

No functional change.
2015-01-17 21:42:47 +01:00
mstembera
58fdb84b0d Simplify and optimize value extractors
Speed up results by Joona:

gcc-4.7 (1.5%)
gcc-4.8 (0.5%)
gcc-4.9 (1.0%)

Speed up results by mstembera:

gcc 474
p-value: 0.719

gcc 482
p-value: 1

gcc 492
p-value: 0.859

No functional change

Resolves #211
2015-01-16 19:03:49 +00:00
lucasart
ab276357d7 Enable futility pruning for PV nodes in qsearch
STC:

LLR: 4.20 (-2.94,2.94) [-3.00,1.00]
Total: 85573 W: 17195 L: 17125 D: 51253

LTC:

LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 43385 W: 7298 L: 7214 D: 28873

Bench: 8080602

Resolves #206
2015-01-14 20:21:54 +00:00
Stefan Geschwentner
4abe333e1f Enable Futility pruning in PV nodes
STC:

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 21553 W: 4342 L: 4221 D: 12990

LTC:

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 7675 W: 1351 L: 1209 D: 5115

Bench: 8668014

Resolves #205
2015-01-14 20:13:48 +00:00
hxim
7b20bb6e1a Use VALUE_ZERO instead of 0 when comparing with Value
This is the correct practice.

No functional change

Resolves #208
2015-01-13 21:07:18 +00:00
Marco Costalba
4eb2d8ce09 Assorted headers cleanup
Mostly comments fixing and other small things.

No functional change.
2015-01-11 22:56:35 +01:00
Marco Costalba
b97df4c236 Fix a crash of syzygy on Android
On Android-ARM current TB code crashes at
random times even in single thread mode.

Reported, debugged, fixed and verified
by Peter Osterlund.

No functional change.

Resolves #201
2015-01-11 20:10:31 +00:00
Stefano80
17bcdb9212 Higher movetime resolution for benchmarks
Use a millisecond movetime precision for benchmarks

No functional change

Resolves #198
2015-01-11 20:07:11 +00:00
Marco Costalba
202a78e8e4 Fix compile for Android 5
Android 5 can only run position independent executables.

Note that this breaks Android 4.0 and earlier.

See here for more info:
http://stackoverflow.com/questions/24818902/running-a-native-library-on-android-l-error-only-position-independent-executab

Thanks to Peter Osterlund for the support.

No functional change
2015-01-11 10:52:42 +01:00
Marco Costalba
42b48b08e8 Update copyright year
No functional change.
2015-01-10 11:46:28 +01:00
Marco Costalba
aea2fde611 Assorted formatting and comment tweaks in position.h
No functional change.
2015-01-07 09:09:41 +01:00
lucasart
b73ae56ee1 Tune null search reduction
STC

LLR: 2.96 (-2.94,2.94) [-0.50,4.50]
Total: 107289 W: 21851 L: 21325 D: 64113

LTC

LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 83837 W: 14378 L: 13916 D: 55543

Bench: 7604776

Resolves #194
2015-01-05 22:09:12 +00:00
Marco Costalba
3fda064a66 Retire one implementation of pop_lsb()
We have two implementations that are equivalent,
so retire one.

Plus usual tidy up of comments and code reshuffle.

No functional change.
2015-01-03 22:16:30 +01:00
lucasart
a6e292034a Remove a useless optimization
This optimization is aimed at old hardware only (withouth popcount), and even on
non popcount compile (ARCH=x86-64), it provides no mesurable speedup:

stat        test     master     diff
mean   2,341,779  2,354,699  -12,920
stdev     12,910     14,770   18,150

speedup      -0.55%
P(speedup>0)  23.8%

No functional change.

Resolves #187
2015-01-03 20:40:57 +00:00
Joona Kiiski
c7332d5610 Smoother king safety
STC:

LLR: 4.03 (-2.94,2.94) [-1.50,4.50]
Total: 35707 W: 7352 L: 7106 D: 21249

LTC:

LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 24563 W: 4330 L: 4095 D: 16138

Bench: 8411409

Resolves #190
2015-01-03 20:34:20 +00:00
Marco Costalba
9d1e2c0e76 Assorted work in uci.cpp
- Change UCI::value() signature

This function should only return the value,
lowerbound and upperbound info is up to the
caller because it requires external knowledge,
out of the scope of this little helper.

- Retire 'key' command

It is not an UCI command and is absolutely
useless: never used.

- Comments fixing and other trivia

No functional change.
2015-01-03 18:46:59 +01:00
Marco Costalba
c150f07291 Fix a silly warning with Intel compiler
Intel compiler cries for an explicit cast

warning #2259: non-pointer conversion from "double" to "int"
may lose significant bits

No functional change.
2015-01-03 10:17:04 +01:00
Marco Costalba
62f531254e Fix comments in thread.cpp
And reshuffle a bit the functions to place
them in a consistent order.

To be on the safe side, patch has been
validated for no regression/crashes with
a small 8K games test with 3 threads:

ELO: 3.98 +-4.4 (95%) LOS: 96.3%
Total: 8388 W: 1500 L: 1404 D: 5484

No functional change.
2015-01-03 09:34:58 +01:00