]> git.sesse.net Git - stockfish/log
stockfish
8 years agoUse atomics instead of volatile
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

8 years agoKRPPKRP endgame: Simplify ugly switch statement
Stefano80 [Sat, 24 Oct 2015 22:12:59 +0000 (23:12 +0100)]
KRPPKRP endgame: Simplify ugly switch statement

No functional change

Resolves #470

8 years agoCleanup history stats
Marco Costalba [Sat, 24 Oct 2015 05:27:24 +0000 (07:27 +0200)]
Cleanup history stats

And other assorted trivia.

No functional change.

8 years agoSimplify threats
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

8 years agoHistory pruning
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

8 years agoUpdate authors
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.

8 years agoAlmost passed tuning attempts
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

8 years agoLazy SMP
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

8 years agoAsymmetry bonus for the attacking side
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

8 years agoCombination of two ideas:
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

8 years agoRetire rook contact checks
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

8 years agoTravis CI: add gcc 4.8 for osx
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.

8 years agoTravis CI: add clang and osx
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.

8 years agoTuning of assorted values
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

8 years agoRemove queen threat evaluation
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

8 years agoAdd Trevis CI support
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.

8 years agoFix a comment in TTEntry::save
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.

8 years agoRun PVS-STUDIO analyzer
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.

8 years agoFile based passed pawn bonus
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

8 years agoBonus for checking moves
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

8 years agoRework lock protecting
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.

8 years agoRefine ranks and increase resulting bonus.
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

8 years agoReduce writes in TT::probe().
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

8 years agoRemove unnecessary generation check in TT save
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

8 years agoScales the endgame score by the number of pawns.
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

8 years agoCareful SMP locking - Fix very occasional hangs
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

8 years agoMinor clean up of some function parameters
mstembera [Mon, 7 Sep 2015 19:17:39 +0000 (20:17 +0100)]
Minor clean up of some function parameters

No function change

Resolves #416

8 years agoFix syzygy en passant issue
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

8 years agoA small code simplification
gguliash [Sun, 30 Aug 2015 18:53:07 +0000 (19:53 +0100)]
A small code simplification

No functional change

Resolves #411

8 years agoHistory gravity
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

8 years agoReformat trace code
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.

8 years agoPrune castling moves
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

8 years agoBetter document entry age calculation used in TT replace.
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

8 years agoRetire dangerous flag
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

8 years agoRetire PawnSafePush bonus
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

8 years agoReformat PassedPawnsBonus
Marco Costalba [Sat, 15 Aug 2015 13:55:14 +0000 (15:55 +0200)]
Reformat PassedPawnsBonus

Align to SF coding standards.

No functional change.

8 years agoTT entry value based on depth and relative age
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

8 years agoTuned values for mid and end game passed pawns.
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

8 years agoRevert TT replacement strategy changes (#380)
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

8 years agoRename Position::list
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.

8 years agoSimplify IID depth formula
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

8 years agoPV refutation penalty
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

8 years agoMobilityArea (simplified)
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

8 years agoTuned version of TT replacement policy
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

8 years agoTidy up in movepick.cpp
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.

8 years agoFix formatting of previous patch
Marco Costalba [Thu, 16 Jul 2015 06:17:40 +0000 (08:17 +0200)]
Fix formatting of previous patch

No functional change.

8 years agoLMR Simplification: Remove countermove condition
VoyagerOne [Mon, 13 Jul 2015 22:19:09 +0000 (18:19 -0400)]
LMR Simplification: Remove countermove condition

Removed countermove condition for decreasing reduction.

LTC:
LLR: 3.01 (-2.94,2.94) [-3.00,1.00]
Total: 32410 W: 5092 L: 4986 D: 22332

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 24450 W: 4632 L: 4517 D: 15301

Bench: 6943812

Resolves #378

8 years agoConsistent TT replace policy
mstembera [Wed, 15 Jul 2015 19:15:14 +0000 (20:15 +0100)]
Consistent TT replace policy

This fixes an inconsistency bug where TT entries were valued differently
depending on which pointer they were accessed through.

STC 2MB
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 11301 W: 2176 L: 2038 D: 7087

LTC 8MB
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17732 W: 2870 L: 2745 D: 12117

STC 16MB
LLR: 2.96 (-2.94,2.94) [-4.00,0.00]
Total: 17401 W: 3324 L: 3227 D: 10850

Bench: 8248164

Resolves #377

8 years agoUse distance<file>() function in endgame.cpp
joergoster [Wed, 8 Jul 2015 11:48:42 +0000 (13:48 +0200)]
Use distance<file>() function in endgame.cpp

This one occurance of distance function was most likely overlooked.

No functional change.

Resolves #376

8 years agoRemove useless razoring condition
Marco Costalba [Tue, 30 Jun 2015 11:50:59 +0000 (13:50 +0200)]
Remove useless razoring condition

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20626 W: 3977 L: 3855 D: 12794

LTC:
LLR: 3.10 (-2.94,2.94) [-3.00,1.00]
Total: 87334 W: 13675 L: 13648 D: 60011

Retire also the now unused pawn_on_7th() helper.

bench: 8248166

8 years agoCMH Fix: Exclude captures for TT move refutation penalty
VoyagerOne [Sat, 27 Jun 2015 16:19:42 +0000 (12:19 -0400)]
CMH Fix: Exclude captures for TT move refutation penalty

This will make sure we store only quiet moves for TT Penalty.

STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 34748 W: 6617 L: 6420 D: 21711

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 19975 W: 3259 L: 3137 D: 13579

Bench: 8063826

Resolves #373

8 years agoCorrectly check for no-makefile compile
Marco Costalba [Sun, 28 Jun 2015 08:24:10 +0000 (10:24 +0200)]
Correctly check for no-makefile compile

Under Windows with MSVC we use the IDE to compile,
in this case we infer some compiler flags usually
set by Makefile.

The condition to check this was wrong, namely when compiling
with mingw under Windows 64 bit we always set IS_64BIT and
USE_BSFQ even if compiled with ARCH=x86-32 (this is how I
found it).

Small code style touches while there.

No functional change.

8 years agoLMR Tweak: Decrease reduction if cmh>0 && history>0.
VoyagerOne [Sat, 27 Jun 2015 08:41:17 +0000 (09:41 +0100)]
LMR Tweak: Decrease reduction if cmh>0 && history>0.

STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 9627 W: 1879 L: 1748 D: 6000

LTC:
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 21543 W: 3433 L: 3234 D: 14876

Bench: 8646407

Resolves #370 #371

8 years agoFix compile on icc
Marco Costalba [Thu, 25 Jun 2015 03:15:09 +0000 (05:15 +0200)]
Fix compile on icc

Error is:

  a value of type "int" cannot be assigned to an entity of type "Value"

Also retire the now unused squares_of_color() function.

No functional change.

8 years agoSmall coding style fix for Outpost array
joergoster [Wed, 17 Jun 2015 14:02:02 +0000 (15:02 +0100)]
Small coding style fix for Outpost array

No functional change

Resolves #367

8 years agoRetire -Wno-long-long
lucasart [Mon, 8 Jun 2015 12:47:24 +0000 (20:47 +0800)]
Retire -Wno-long-long

long long is part of the C++11 standard.

No functional change.

Resolves #364

8 years agoSimplify outpost evaluation
lucasart [Sun, 7 Jun 2015 08:49:01 +0000 (09:49 +0100)]
Simplify outpost evaluation

STC

LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 114149 W: 21986 L: 22032 D: 70131

LTC

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 52232 W: 8468 L: 8396 D: 35368

Bench: 6716940

No functional change

Resolves #363

8 years agoRemove intermediate re-search in LMR
Vince Negri [Sun, 31 May 2015 09:52:41 +0000 (10:52 +0100)]
Remove intermediate re-search in LMR

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20149 W: 3830 L: 3707 D: 12612

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 45384 W: 7089 L: 7006 D: 31289

Bench: 8110365

Resolves #361

8 years agoRename stages
Marco Costalba [Thu, 4 Jun 2015 10:25:49 +0000 (12:25 +0200)]
Rename stages

Hopefully more clear.

No functional change.

8 years agoTune pawn shelter/storm
lucasart [Tue, 2 Jun 2015 19:08:35 +0000 (12:08 -0700)]
Tune pawn shelter/storm

STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 31679 W: 6183 L: 5912 D: 19584

LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 43550 W: 6885 L: 6602 D: 30063

Bench: 9219343

Resolves #360

8 years agoTweak backward pawns definition
Stéphane Nicolet [Tue, 2 Jun 2015 19:06:46 +0000 (12:06 -0700)]
Tweak backward pawns definition

Advanced pawns cannot be backward. Also lower the backward penalty in
endgame.

Passed STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 18534 W: 3588 L: 3433 D: 11513

and LTC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 21319 W: 3415 L: 3217 D: 14687

Bench: 7271152

Resolves #359

8 years agoChecking for rook color when setting castling
Marco Costalba [Fri, 29 May 2015 03:38:40 +0000 (05:38 +0200)]
Checking for rook color when setting castling

In Chess960 we can have legal positions with
opponent rook in A or H file and with castling
available, for instance:

4k3/pppppppp/8/8/8/8/PPPPPPPP/rR2K3 w Q - 0 1

In those cases we pick up the wrong rook when
setting castling.

Fix it by checking the color of the rook.

Bug reported by Matthew Lai.

No functional change.

8 years agoSimplify backward pawn scoring
lucasart [Fri, 22 May 2015 10:39:36 +0000 (18:39 +0800)]
Simplify backward pawn scoring

STC

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 52322 W: 10011 L: 9945 D: 32366

LTC

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 14143 W: 2334 L: 2203 D: 9606

Bench: 7976423

Resolves #354

8 years agoResolve build failure for Mac
Joona Kiiski [Thu, 21 May 2015 19:04:19 +0000 (20:04 +0100)]
Resolve build failure for Mac

Remove '-Wl' switch from gcc arguments when compiling for Mac

No functional change

Resolves #353

8 years agoFix merge error for Tuned PSQT
lucasart [Thu, 21 May 2015 11:52:25 +0000 (19:52 +0800)]
Fix merge error for Tuned PSQT

Fall-out from 411e704f

Bench: 7907776

Resolves #352

8 years agoRemove Gain Stats
Stefan Geschwentner [Mon, 18 May 2015 20:58:13 +0000 (13:58 -0700)]
Remove Gain Stats

Additionally in futility pruning the margin is raised for compensation.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 48481 W: 9229 L: 9156 D: 30096

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 32058 W: 5134 L: 5031 D: 21893

Bench: 8098149

Resolves #350

8 years agoTuned PSQT
lucasart [Sat, 16 May 2015 01:12:36 +0000 (09:12 +0800)]
Tuned PSQT

STC:
LLR: 3.11 (-2.94,2.94) [-0.50,4.50]
Total: 58764 W: 11530 L: 11185 D: 36049

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.50]
Total: 282710 W: 46339 L: 45209 D: 191162

Bench: 8512947

Resolves #349

8 years agoCleanup work in misc.cpp
Marco Costalba [Sat, 9 May 2015 09:09:06 +0000 (11:09 +0200)]
Cleanup work in misc.cpp

Also some code style tidy up of latest patches.

Also renamed checkSq -> checkSquares because it
is a bitboard and not a square.

No functional change.

8 years agoSmart TT save
mstembera [Sat, 9 May 2015 16:43:57 +0000 (17:43 +0100)]
Smart TT save

Don't overwrite more valuable data with less valuable data

STC 2MB
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 21132 W: 4108 L: 3946 D: 13078
http://tests.stockfishchess.org/tests/view/5547d59f0ebc5940ca5d6883

LTC 8MB
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 13381 W: 2149 L: 1987 D: 9245
http://tests.stockfishchess.org/tests/view/5549b5a80ebc5940ca5d68b9

STC 16MB regression w/ zero effective hash pressure
LLR: 2.96 (-2.94,2.94) [-5.00,0.00]
Total: 18944 W: 3607 L: 3564 D: 11773
http://tests.stockfishchess.org/tests/view/554b0fda0ebc5940ca5d68ea

Bench: 8787152

Resolves #347

8 years agoEdge distance
lucasart [Sun, 3 May 2015 22:57:22 +0000 (06:57 +0800)]
Edge distance

Instead of crafting a clever formula to calculate the array offset, simply use a
3 dimensional array. Remove the comment while at it, because now the code is
self-documenting.

No functional change.

Resolves #344

8 years agoRestore deterministic search state
lucasart [Wed, 6 May 2015 11:24:00 +0000 (19:24 +0800)]
Restore deterministic search state

Introduce helper function Search::reset() which clears all kind of search
memory, in order to restore a deterministic search state.

Generalize TT.clear() into Search::reset() for the following use cases:
- bench: needed to guarantee deterministic bench (ie. if you call bench from
interactive command line twice in a row you get the same value).
- Clear Hash: restore clean search state, which is the purpose of this button.
- ucinewgame: ditto.

No functional change.

Resolves #346

8 years agoNever clear stats
lucasart [Tue, 5 May 2015 11:10:19 +0000 (19:10 +0800)]
Never clear stats

Based on an idea and patch by VoyagerOne.

Small simplification, but was tedted for an ELO gain anyway.

STC:
LLR: 2.95 (-2.94,2.94) [-1.00,4.00]
Total: 5375 W: 1119 L: 977 D: 3279

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 17893 W: 2984 L: 2792 D: 12117

bench 8322847

8 years agoHalve PSQT row data
Marco Costalba [Sun, 3 May 2015 06:06:10 +0000 (08:06 +0200)]
Halve PSQT row data

Use symmetry along vertical middle axis of the board
to reduce the number of parameters.

For instance psqt value of SQ_A5 == SQ_A4 and value of
SQ_F8 == SQ_F1.

This is always true, at least until now nobody came in
with an asymmetric psqt table that worked.

Original patch by Lucas.

No functional change.

8 years agoSplit PSQT init from Position init
Marco Costalba [Sat, 2 May 2015 00:36:39 +0000 (02:36 +0200)]
Split PSQT init from Position init

Easier for tuning psq tables:

TUNE(myParameters, PSQT::init);

Also move PSQT code in a new *.cpp file, and retire the
old and hacky psqtab.h that required to be included only
once to work correctly, this is not idiomatic for a header
file.

Give wide visibility to psq tables (previously visible only
in position.cpp), this will easy the use of psq tables outside
Position, for instance in move ordering.

Finally trivial code style fixes of the latest patches.

Original patch of Lucas Braesch.

No functional change.

8 years agoImprove ordering of good captures using rank term
Stefano80 [Sun, 3 May 2015 17:18:38 +0000 (10:18 -0700)]
Improve ordering of good captures using rank term

Rank based term improved approximation of pos.see() for scoring good
captures.

STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 4632 W: 945 L: 827 D: 2860

LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 25770 W: 4184 L: 3964 D: 17622

Bench: 7593704

Resolves #342

8 years agoReplace MVV/LVA by MVV for good captures
Stefano80 [Tue, 28 Apr 2015 21:06:18 +0000 (22:06 +0100)]
Replace MVV/LVA by MVV for good captures

Passed STC

LLR: 3.71 (-2.94,2.94) [-3.00,1.00]
Total: 64363 W: 12299 L: 12214 D: 39850

and LTC

LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 69976 W: 11056 L: 11011 D: 47909

Bench: 8012532

Resolves #340

8 years agoChange extra ply LMR condition to: cmh <= 0 && hist < 0
VoyagerOne [Sun, 26 Apr 2015 19:12:25 +0000 (20:12 +0100)]
Change extra ply LMR condition to: cmh <= 0 && hist < 0

Extra ply LMR condition is now cmh <= 0 && h < 0
Instead of cmh + h < 0

STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 55210 W: 10812 L: 10557 D: 33841

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 13212 W: 2239 L: 2045 D: 8928

Bench: 8420865

Resolves #339

9 years agoExclude queen from Rook Contact Check computation
Alain SAVARD [Sat, 18 Apr 2015 21:12:56 +0000 (22:12 +0100)]
Exclude queen from Rook Contact Check computation

In ei.attackedBy, Queen does not x-ray through Rook, but the Rook does
X-ray through the Queen.

So most of the rook contact checks supported by queen are, in fact,
Queen Contact Checks and they are already scored separately.

Bench: 7762189

Resolves #338

9 years agoRetire FORCE_INLINE
lucasart [Wed, 15 Apr 2015 20:21:45 +0000 (21:21 +0100)]
Retire FORCE_INLINE

No speed regression on my machine (i7-3770k, gcc 4.9.1, linux 3.16):

        stat        test     master   diff
        mean   2,482,415  2,474,987  7,906
        stdev      4,603      5,644  2,497

        speedup        0.32%
        P(speedup>0)  100.0%

Fishtest 9+0.03:

ELO: 0.26 +-1.8 (95%) LOS: 61.2%
Total: 60000 W: 12437 L: 12392 D: 35171

No functional change.

Resolves #334

9 years agoRemoved extra condition (history < 0) in LMR to help sync up with move ordering.
VoyagerOne [Fri, 10 Apr 2015 21:50:19 +0000 (17:50 -0400)]
Removed extra condition (history < 0) in LMR to help sync up with move ordering.

LMR condition is now cmh+history<0
Instead of history<0 OR cmh+history<0

STC:
LLR: 2.96 (-2.94,2.94) [-3.00, 1.00]
Total: 26446 W: 5092 L: 4980 D: 16374

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00, 1.00]
Total: 14129 W: 2340 L: 2209 D: 9580

Bench: 7815183

Resolves #331

9 years agoAssorted cleanup of last patches
Marco Costalba [Sat, 11 Apr 2015 21:21:52 +0000 (23:21 +0200)]
Assorted cleanup of last patches

No functional change.

9 years agoAllow Position::init() to be called more than once
Marco Costalba [Fri, 10 Apr 2015 06:57:35 +0000 (08:57 +0200)]
Allow Position::init() to be called more than once

Currently Zobrist::castling[] are not properly zeroed
and rely on the compiler to do this at startup, but this
makes Position::init() to set different values every time
it is called!

This is a bit odd, and although not impacting normal usage,
can yield to subtle misbehaviour, very difficult to track
down, in case we happen to call it more than once for some
reason. I found this while developing tuning support and
it took me a while to track it down.

So properly init Zobrist::castling[]

No functional change.

Resolves #329

9 years agoUpdate stats at pv nodes
Stefan Geschwentner [Fri, 10 Apr 2015 19:32:39 +0000 (20:32 +0100)]
Update stats at pv nodes

If a quiet best move is found at a pv node then always update stats.

STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 41485 W: 8047 L: 7830 D: 25608

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 14351 W: 2420 L: 2250 D: 9681

Bench: 6985247

Resolves #330

9 years agoNew formula for quiet move scoring: 3 * cmh + 1 * hist
mstembera [Fri, 10 Apr 2015 19:09:45 +0000 (20:09 +0100)]
New formula for quiet move scoring: 3 * cmh + 1 * hist

STC

LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 45363 W: 8759 L: 8532 D: 28072

LTC

LLR: 3.51 (-2.94,2.94) [0.00,4.00]
Total: 125092 W: 20032 L: 19468 D: 85592

Bench: 7058819

Resolves #328

9 years agoupdate stats also in check
Stefan Geschwentner [Sun, 5 Apr 2015 18:36:11 +0000 (20:36 +0200)]
update stats also in check

Update stats also if in check (drop condition).

STC:
LLR: 3.22 (-2.94,2.94) [-3.00,1.00]
Total: 87472 W: 16929 L: 16913 D: 53630

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 39971 W: 6436 L: 6345 D: 27190

Bench: 7086031

Resolves #327

9 years agoPrune evasions when we can castle
lucasart [Sat, 4 Apr 2015 00:00:15 +0000 (08:00 +0800)]
Prune evasions when we can castle

A minor simplification.

STC:

LLR: 2.95 (-2.94,2.94) [-3.50,0.50]
Total: 67877 W: 12882 L: 12904 D: 42091

STC:

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20677 W: 4023 L: 3901 D: 12753

LTC:

LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 12221 W: 2022 L: 1888 D: 8311

Bench: 7911336

Resolves #326

9 years agoUse minimumSplitDepth = 5
Stéphane Nicolet [Sat, 4 Apr 2015 16:07:45 +0000 (18:07 +0200)]
Use minimumSplitDepth = 5

Using minimumSplitDepth = 5 seems to be the best compromise in the
current SMP implementation

STC, 11 threads:

ELO: 14.87 +-4.1 (95%) LOS: 100.0%
Total: 8509 W: 1497 L: 1133 D: 5879

STC, 4 threads:

ELO: 0.30 +-2.8 (95%) LOS: 58.2%
Total: 20000 W: 3365 L: 3348 D: 13287

STC, 2 threads:

ELO: -1.02 +-2.0 (95%) LOS: 16.4%
Total: 40000 W: 7087 L: 7204 D: 25709

Resolves #324

9 years agoFix MSVC warning from previous patch
Marco Costalba [Fri, 3 Apr 2015 17:29:29 +0000 (19:29 +0200)]
Fix MSVC warning from previous patch

No functional change.

9 years agoFix elapsed()
Marco Costalba [Fri, 3 Apr 2015 02:53:53 +0000 (04:53 +0200)]
Fix elapsed()

Messed up during merge.

No functional change.

9 years agoAdd support for playing in 'nodes as time' mode
Marco Costalba [Sun, 22 Mar 2015 20:15:44 +0000 (21:15 +0100)]
Add support for playing in 'nodes as time' mode

When running more games in parallel, or simply when running a game
with a background process, due to how OS scheduling works, there is no
guarantee that the CPU resources allocated evenly between the two
players. This introduces noise in the result that leads to unreliable
result and in the worst cases can even invalidate the result. For
instance in SF test framework we avoid running from clouds virtual
machines because are a known source of very unstable CPU speed.

To overcome this issue, without requiring changes to the GUI, the idea
is to use searched nodes instead of time, and to convert time to
available nodes upfront, at the beginning of the game.

When nodestime UCI option is set at a given nodes per milliseconds
(npmsec), at the beginning of the game (and only once), the engine
reads the available time to think, sent by the GUI with 'go wtime x'
UCI command. Then it translates time in available nodes (nodes =
npmsec * x), then feeds available nodes instead of time to the time
management logic and starts the search. During the search the engine
checks the searched nodes against the available ones in such a way
that all the time management logic still fully applies, and the game
mimics a real one played on real time. When the search finishes,
before returning best move, the total available nodes are updated,
subtracting the real searched nodes. After the first move, the time
information sent by the GUI is ignored, and the engine fully relies on
the updated total available nodes to feed time management.

To avoid time losses, the speed of the engine (npms) must be set to a
value lower than real speed so that if the real TC is for instance 30
secs, and npms is half of the real speed, the game will last on
average 15 secs, so much less than the TC limit, providing for a
safety 'time buffer'.

There are 2 main limitations with this mode.

1. Engine speed should be the same for both players, and this limits
the approach to mainly parameter tuning patches.

2. Because npms is fixed while, in real engines, the speed increases
toward endgame, this introduces an artifact that is equivalent to an
altered time management. Namely it is like the time management gives
less available time than what should be in standard case.

May be the second limitation could be mitigated in a future with a
smarter 'dynamic npms' approach.

Tests shows that the standard deviation of the results with 'nodestime'
is lower than in standard TC, as is expected because now all the introduced
noise due the random speed variability of the engines during the game is
fully removed.

Original NIT idea by Michael Hoffman that shows how to play in NIT mode
without requiring changes to the GUI. This implementation goes a bit
further, the key difference is that we read TC from GUI only once upfront
instead of re-reading after every move as in Michael's implementation.

No functional change.

9 years agoRename of TimeMgr and friends
Marco Costalba [Thu, 2 Apr 2015 07:07:17 +0000 (09:07 +0200)]
Rename of TimeMgr and friends

More natural naming IMO.

No functional change.

9 years agoIntroduce elapsed_time()
Marco Costalba [Thu, 2 Apr 2015 06:52:22 +0000 (08:52 +0200)]
Introduce elapsed_time()

And reformat a bit time manager code.

Note that now we set starting search time in think() and
no more in ThreadPool::start_thinking(), the added delay
is less than 1 msec, so below timer resolution (5msec) and
should not affect time lossses ratio.

No functional change.

9 years agoSimplification to use only one counter move.
mstembera [Thu, 2 Apr 2015 17:16:15 +0000 (01:16 +0800)]
Simplification to use only one counter move.

STC http://tests.stockfishchess.org/tests/view/5518dca30ebc5902160ec5d0
LLR: 2.95 (-2.94,2.94) [-3.50,0.50]
Total: 18868 W: 3638 L: 3530 D: 11700

LTC http://tests.stockfishchess.org/tests/view/5518f7ed0ebc5902160ec5d4
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 69767 W: 11019 L: 10973 D: 47775

Extracted from http://tests.stockfishchess.org/tests/view/5511028a0ebc5902160ec40b

Original patch by hxim.  All credit goes to him.

Bench: 7664249

Resolves #320

9 years agoAssorted code style of latest commits
Marco Costalba [Sun, 29 Mar 2015 07:24:17 +0000 (09:24 +0200)]
Assorted code style of latest commits

No functional chnage.

9 years agoFix indentations for hanging pawns code
Joona Kiiski [Sun, 29 Mar 2015 07:54:25 +0000 (08:54 +0100)]
Fix indentations for hanging pawns code

No functional change

9 years agoRemove some difficult to understand C++11 constructs
lucasart [Fri, 27 Mar 2015 01:44:57 +0000 (09:44 +0800)]
Remove some difficult to understand C++11 constructs

Code like this is more a case of showing off one's C++ knowledge, rather than
using it adequately, IMHO.

**First loop (std::generate)**

Iterators are inadequate here, because they lose the key information which is
idx. As a result, we need to carry a redundant idx variable, and increment it
along the way. Very clumsy.
Usage of std::generate and a lambda function only obfuscate the code, which is
merely a simple and stupid loop over the elements of a vector.

**Second loop (std::accumulate)**

This code is thoroughlly incomprehensible. Restore the original, which was much
simpler to understand.

**Third loop (range based loop)**

Again, a range based loop is inadequate, because we lose idx! To resolve this
artificially created problem, the data model was made redundant (idx is a data
member of db[] elements!?), which is ugly and unjustified. A simple and stupid
for loop with idx does the job much better.

No functional change.

Resolves #313

9 years agoPSV3_1
Alain SAVARD [Sat, 28 Mar 2015 23:30:46 +0000 (07:30 +0800)]
PSV3_1

Small speed-up in pawn.cpp
Results for 10 tests for each version:

Base      Test      Diff
Mean    1435636   1445238   -9602
StDev   22576     23189     1848

p-value: 1
speedup: 0.007

No functional change

Resolves #295

9 years agoGive a reduced bonus for threats by hanging pawns
Ajith [Sat, 28 Mar 2015 23:27:43 +0000 (07:27 +0800)]
Give a reduced bonus for threats by hanging pawns

Passed STC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 105539 W: 20389 L: 20001 D: 65149

and LTC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 9629 W: 1577 L: 1432 D: 6620

Bench: 7658627

Resolves #317

9 years agoRetire follow-up move heuristic
mbootsector [Sat, 28 Mar 2015 22:09:48 +0000 (22:09 +0000)]
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

9 years agoUse CounterMoveHistory when calculating LMR for cut nodes
VoyagerOne [Sat, 28 Mar 2015 21:15:49 +0000 (21:15 +0000)]
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