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

3670 commits

Author SHA1 Message Date
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
686b45e121 Retire one do_move() overload
After Lucas patch it is almost useless.

No functional change.
2015-02-15 12:23:03 +01:00
lucasart
dc13004283 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-15 12:11:05 +01:00
Marco Costalba
901bfb1f55 Revert "Delayed killers checking"
It seems a slowdown when run with fishbench.

No functional change.
2015-02-15 11:32:53 +01: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
Marco Costalba
e38eb2302d Further simplify KingDanger init
And remove a tale whitespace while there.

No functional change.
2015-02-14 15:55:11 +01:00
Marco Costalba
0af24a1445 Sync with master
Bench: 7369224
2015-02-14 15:30:16 +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
Marco Costalba
c0a80afe89 Reformat tracing functions
No functional change.
2015-02-13 11:54:46 +01: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
Marco Costalba
ce8ac7997c Sync with master
bench: 7699138
2015-02-08 21:32:14 +01: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
8f10f6c9cd Shuffle put_piece() and friends signatures
It is more consistent with the others member functions.

No functional change.
2015-02-08 18:17:08 +01:00
Marco Costalba
3184852bdc Small tweaks in do_move and friends
Also remove useless StateCopySize64 optimization:
compiler uses SSE movups instruction anyhow and
does not need this trick (verified with fishbench).

No functional change.
2015-02-08 13:09:29 +01:00
Marco Costalba
99c9cae586 Avoid casting to char* in prefetch()
Funny enough, gcc __builtin_prefetch() expects
already a void*, instead Windows's _mm_prefetch()
requires a char*.

The patch allows to remove ugly casts from caller
sites.

No functional change.
2015-02-07 19:13:41 +01:00
Marco Costalba
152a4dc5cd Rewrite pos_is_ok()
No functional change.
2015-02-07 15:02:28 +01:00
Marco Costalba
47a0768102 Micro-optimize SEE
Results for 10 tests for each version (gcc 4.8.3 on mingw):

            Base      Test      Diff
    Mean    1502447   1507917   -5470
    StDev   3119      1364      4153

p-value: 0,906
speedup: 0,004

Results for 10 tests for each version (MSVC 2013):

            Base      Test      Diff
    Mean    1400899   1403713   -2814
    StDev   1273      2804      2700

p-value: 0,851
speedup: 0,002

No functional change.
2015-02-07 12:21:39 +01: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
Marco Costalba
8b0fee9998 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:15:38 +01:00
Marco Costalba
1277a42823 Sync with master
bench: 7696257
2015-02-07 10:32:28 +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
1c7a727795 Use move assignment in movegen.h
No functional change and same speed (tested with perft)
2015-02-01 16:42:31 +01:00
Marco Costalba
e56e5045dd Allow to assign a Move to an ExtMove
After defining ExtMove::operator Move(), this is a
natural extension.

No fnctional change.
2015-02-01 13:31:49 +01:00
Marco Costalba
20d6a8e57f Delay checking for duplicated killer moves
Follow the usual approach to delay computation
as far as possible, in case an earlier killer
cut-offs we avoid to do useless work.

This also greatly simplifies the code.

No functional change.
2015-02-01 13:17:42 +01:00
Marco Costalba
0dc6f16992 Small tweaks in movepick.cpp
No functional change.
2015-02-01 12:01:35 +01:00
Marco Costalba
21120288a3 Silence a warning under MSVC
warning C4100: 'ci' : unreferenced formal parameter

It is a silly and wrong one, but just silent it.

No functional change.
2015-02-01 10:40:22 +01:00
Marco Costalba
519b2fe849 More readable score<CAPTURES>()
No functional change.
2015-01-31 20:13:38 +01:00
Marco Costalba
f3189bdc9a Use C++11 loops in MovePicker
No functional change.
2015-01-31 20:02:08 +01:00
Marco Costalba
65f46794af Implicit conversion from ExtMove to Move
Verified with perft there is no speed regression,
and code is simpler. It is also conceptually correct
becuase an extended move is just a move that happens
to have also a score.

No functional change.
2015-01-31 19:22:07 +01:00
Marco Costalba
81d6c4a0d6 Another small tweak to skills
No functional change.
2015-01-31 18:24:39 +01:00
Marco Costalba
60c121f3b1 Sync with master
bench: 7374604
2015-01-31 13:05:51 +01:00
Marco Costalba
45eac9507c Use C++ loops in insert_pv_in_tt
Also small tweak to extract_ponder_from_tt

No functional change.
2015-01-31 12:57:52 +01:00
Marco Costalba
bfd0f95f06 Move uci_pv under UCI namespace
That's the correct place.

No functional change.
2015-01-31 12:18:24 +01:00
Marco Costalba
1b947aafbf Convert Reductions[] from int8_t to Depth
This is the type anyhow. Assorted cleanup while there.

No functional change.
2015-01-31 11:44:35 +01: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
f6f1d24223 Sync with master
bench: 7374604
2015-01-30 17:58:18 +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
14f7d9a629 Re-arrange Skill struct
Instead of swapping sub-optimal move in Skill
d'tor, make it explicitly at the end of the search.

Also streamline and clarify relation with multiPV
and pass it directly instead of relying on the hacky
'candidates' member.

No functional change.
2015-01-25 11:16:54 +01:00