]> git.sesse.net Git - stockfish/log
stockfish
10 years agoSimplify aspiration window code
Marco Costalba [Wed, 3 Jul 2013 06:54:44 +0000 (08:54 +0200)]
Simplify aspiration window code

Here the main difference is that now we center
aspiration window on last returned score. This allows
to simplify handling of mate scores.

We have done a reversed SPRT tests, where we wanted to
verify if master is stronger than this patch.

Long TC: master vs this patch (reverse test)
LLR: -2.95 (-2.94,2.94)
Total: 37992 W: 7012 L: 6920 D: 24060

bench: 4507288

10 years agoDisable flto when debugging
Marco Costalba [Wed, 3 Jul 2013 06:21:21 +0000 (08:21 +0200)]
Disable flto when debugging

Link-time optimization does not work well with
generation of debugging information:

http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

Reported by Louis Zulli

No functional change.

10 years agoRevert "Remove confusing optimization"
Marco Costalba [Tue, 2 Jul 2013 18:06:24 +0000 (20:06 +0200)]
Revert "Remove confusing optimization"

This reverts commit e05c80a08859f6c4f0f599ca0b262ced00ad66fe.

we gain a speed up of 1.5% under gcc !

No functional change.

10 years agoMerge branch 'master' into aspiration
Marco Costalba [Tue, 2 Jul 2013 05:25:47 +0000 (07:25 +0200)]
Merge branch 'master' into aspiration

bench: 4507288

10 years agoRevert "Increase earlier aspiration window size"
Marco Costalba [Tue, 2 Jul 2013 05:25:39 +0000 (07:25 +0200)]
Revert "Increase earlier aspiration window size"

This reverts commit b88bc7b7667fc6ddbfc7412fb2c0bfc13e3bf11c.

10 years agoEntering a pawn endgame is no more dangerous
Marco Costalba [Tue, 2 Jul 2013 05:24:17 +0000 (07:24 +0200)]
Entering a pawn endgame is no more dangerous

A simplification of the 'dangerous' definition.

Seems neutral at reverse test at long TC

master vs patch
LLR: -2.96 (-2.94,2.94)
Total: 16974 W: 3122 L: 3139 D: 10713

bench: 4689029

10 years agoIncrease earlier aspiration window size
Marco Costalba [Mon, 1 Jul 2013 17:29:23 +0000 (19:29 +0200)]
Increase earlier aspiration window size

bench: 4377851

10 years agoMerge branch 'master' into aspiration
Marco Costalba [Mon, 1 Jul 2013 17:25:23 +0000 (19:25 +0200)]
Merge branch 'master' into aspiration

10 years agoFix a stale comment
Marco Costalba [Sun, 30 Jun 2013 11:12:04 +0000 (13:12 +0200)]
Fix a stale comment

No functional change.

10 years agoSimplify search results update
Marco Costalba [Sun, 30 Jun 2013 10:30:57 +0000 (12:30 +0200)]
Simplify search results update

Also some rename while there.

No functional change.

10 years agoReorder conditions according to their frequency
Marco Costalba [Sun, 30 Jun 2013 09:35:03 +0000 (11:35 +0200)]
Reorder conditions according to their frequency

This should minimize useless tests.

No functional change.

10 years agoCenter aspiration window on last returned score
Marco Costalba [Sun, 30 Jun 2013 09:00:19 +0000 (11:00 +0200)]
Center aspiration window on last returned score

bench: 4428212

10 years agoSimplify aspiration window loop
Marco Costalba [Sun, 30 Jun 2013 08:32:09 +0000 (10:32 +0200)]
Simplify aspiration window loop

Don't open the window in case we find a mate score: this
will be takes care with next patch.

No functional change.

10 years agoUse calloc() in TranspositionTable::set_size()
Marco Costalba [Sat, 29 Jun 2013 08:23:43 +0000 (10:23 +0200)]
Use calloc() in TranspositionTable::set_size()

Function calloc() already initializes memory to
zero, so avoid calling clear() afterwards.

Also some renaming while there (inspired by DiscoCheck).

No functional change.

10 years agoFix some stale comments
Marco Costalba [Sun, 23 Jun 2013 11:19:03 +0000 (13:19 +0200)]
Fix some stale comments

No functional change.

10 years agoMove SquareDistance[] to bitboard.cpp
Marco Costalba [Sun, 23 Jun 2013 11:08:10 +0000 (13:08 +0200)]
Move SquareDistance[] to bitboard.cpp

No functional change.

10 years agoDon't explicitize enum values when not needed
Marco Costalba [Sun, 23 Jun 2013 09:15:58 +0000 (11:15 +0200)]
Don't explicitize enum values when not needed

Compiler will chose the correct values in sequential
order for you.

Also move file and rank bitboards definitions to
bitboard.h

No functional change.

10 years agoRetire in_front_bb(Color c, Square s) overload
Marco Costalba [Sun, 23 Jun 2013 08:16:43 +0000 (10:16 +0200)]
Retire in_front_bb(Color c, Square s) overload

Explciitly call rank_of() in the few places where
it is used.

No functional change.

10 years agoRetire ThisAndAdjacentFilesBB[]
Marco Costalba [Sun, 23 Jun 2013 08:03:48 +0000 (10:03 +0200)]
Retire ThisAndAdjacentFilesBB[]

It is unused. Also renamed attack_span_mask to
pawn_attack_span

No functional change.

10 years agoSimplify hidden_checkers()
Marco Costalba [Sun, 23 Jun 2013 06:08:16 +0000 (08:08 +0200)]
Simplify hidden_checkers()

De-templetize and pass color as function argument.
No speed change.

No functional change.

10 years agoName functions along corresponding UCI commands
Marco Costalba [Sat, 22 Jun 2013 10:45:14 +0000 (12:45 +0200)]
Name functions along corresponding UCI commands

No functional change.

10 years agoMicro-optimize perft
Marco Costalba [Fri, 21 Jun 2013 07:10:03 +0000 (09:10 +0200)]
Micro-optimize perft

Avoid to call perft function when we just need to count
moves, at leaf nodes.

Speed up of almost 2%

No functional change.

10 years agoInclude file attacks in 'major on pawn'
Ryan Schmitt [Mon, 17 Jun 2013 16:55:00 +0000 (18:55 +0200)]
Include file attacks in 'major on pawn'

Passed both short TC:
LLR: 2.97 (-2.94,2.94)
Total: 57846 W: 12248 L: 11974 D: 33624

And long one:
LLR: 2.95 (-2.94,2.94)
Total: 9181 W: 1732 L: 1581 D: 5868

bench: 4609948

10 years agoRemove confusing optimization
Reuven Peleg [Mon, 17 Jun 2013 10:49:11 +0000 (13:49 +0300)]
Remove confusing optimization

Here we skip the call to pos.attacks_from<ROOK>(s) in the 98%
of cases, testing the first 2 members first. Unfortunatly
code is a bit triky and not clear. So we give up to the
speed optimization in exchange of more code clarity.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
10 years agoMerge some if statements in pos_is_ok()
Reuven Peleg [Mon, 17 Jun 2013 08:54:55 +0000 (11:54 +0300)]
Merge some if statements in pos_is_ok()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
10 years agoRemove redundant condition in probcut
Marco Costalba [Mon, 17 Jun 2013 07:30:59 +0000 (09:30 +0200)]
Remove redundant condition in probcut

When !ss->skipNullMove it is assured that excludedMove == MOVE_NONE

No functional change.

10 years agoRename piece_count and piece_list
Marco Costalba [Sun, 16 Jun 2013 09:59:40 +0000 (11:59 +0200)]
Rename piece_count and piece_list

No functional change.

10 years agoDon't calculate pawnsOnSquares twice
Marco Costalba [Sun, 16 Jun 2013 08:51:17 +0000 (10:51 +0200)]
Don't calculate pawnsOnSquares twice

And reformat some code while there.

No functional change.

10 years agoUse move_pawns() in Pawns::probe
Marco Costalba [Sun, 16 Jun 2013 08:08:44 +0000 (10:08 +0200)]
Use move_pawns() in Pawns::probe

And rename some stuff.

No functional change.

10 years agoRevert "Reduce more CUT nodes only if parent node is reduced"
Marco Costalba [Fri, 14 Jun 2013 06:24:37 +0000 (08:24 +0200)]
Revert "Reduce more CUT nodes only if parent node is reduced"

This reverts commit d54e8a59551a7ebcbf2c2155dce46c7386b1742a.

It was not proved with SPRT this tweak is stronger. So revert it
for now to follow fishtest guidelines.

bench: 5108393

10 years agoFix description of TT entry
Marco Costalba [Fri, 14 Jun 2013 06:20:13 +0000 (08:20 +0200)]
Fix description of TT entry

It was way outdated and wrong !

No functional change.

10 years agoReduce more CUT nodes only if parent node is reduced
Marco Costalba [Thu, 13 Jun 2013 17:53:14 +0000 (19:53 +0200)]
Reduce more CUT nodes only if parent node is reduced

So when we are doing a LMR search at the parent ALL node.

This patch didn't prove stronger at 60" TC
LLR: -2.97 (-2.94,2.94)
Total: 22398 W: 4070 L: 4060 D: 14268

But, first, it scores at 50%, second (and most important for me) the opposite,
i.e. normal reduction when parent node is not reduced, seems very bad:
LLR: -2.95 (-2.94,2.94)
Total: 7036 W: 1446 L: 1534 D: 4056

According to Don, this idea of increased reduction of CUT nodes
works because if parent node is reduced, missing a cut-off due to
reduced depth search (meaning position is somehow tricky) forces
a full depth research at parent node, giving due insight in this
set of sensible positions.

IOW if we expect a node to fail-high at depth n, then we assume it
should fail-high also at depth n-1, if this doesn't happen it means
position is tricky enough to deserve a research at depth n+1.

bench: 4687419

10 years agoReduce more CUT nodes
Marco Costalba [Thu, 13 Jun 2013 17:50:32 +0000 (19:50 +0200)]
Reduce more CUT nodes

We got a good result from this tweak, in line with
what was already found by Don Dailey.

At short TC:
LLR: 2.95 (-2.94,2.94)
Total: 13097 W: 2742 L: 2598 D: 7757

At long TC:
LLR: 2.97 (-2.94,2.94)
Total: 7281 W: 1408 L: 1265 D: 4608

bench: 5108393

10 years agoIntroduce Cut/All node definitions
Marco Costalba [Sun, 9 Jun 2013 07:43:04 +0000 (09:43 +0200)]
Introduce Cut/All node definitions

Follow Don Dailey definition of cut/all node:

"If the previous node was a cut node, we consider this an ALL node.
The only exception is for PV nodes which are a special case of ALL nodes.
In the PVS framework, the first zero width window searched from a PV
node is by our definition a CUT node and if you have to do a re-search
then it is suddenly promoted to a PV nodes (as per PVS search) and only
then can the cut and all nodes swap positions. In other words, these
internal search failures can force the status of every node in the subtree
to swap if it propagates back to the last PV nodes."

http://talkchess.com/forum/viewtopic.php?topic_view=threads&p=519741&t=47577

With this definition we have an hit rate higher than 90% on:

    if (!PvNode && depth > 4 * ONE_PLY)
        dbg_hit_on_c(cutNode, (bestValue >= beta));

And an hit rate of just 28% on:

    if (!PvNode && depth > 4 * ONE_PLY)
        dbg_hit_on_c(!cutNode, (bestValue >= beta));

No functional change.

10 years agoDon't use std::vector::data()
Marco Costalba [Thu, 13 Jun 2013 05:42:43 +0000 (07:42 +0200)]
Don't use std::vector::data()

It is a C++11 only function.

Reported by Eelco.

No functional change.

10 years agoFix again early stop ss pointer
Marco Costalba [Sun, 9 Jun 2013 21:32:12 +0000 (23:32 +0200)]
Fix again early stop ss pointer

Fix was wrong becuase search starts from ss+1,
code is a bit tricky here, so rewrite in a way
to be more easy to read and understand.

Spotted by Eelco.

No functional change.

10 years agoDon't need to expose namespace Zobrist
Marco Costalba [Sun, 9 Jun 2013 21:24:36 +0000 (23:24 +0200)]
Don't need to expose namespace Zobrist

It can be local to position.cpp

No functional change.

10 years agoZobrist::init() should be Position::init()
Marco Costalba [Sun, 9 Jun 2013 11:43:30 +0000 (13:43 +0200)]
Zobrist::init() should be Position::init()

No functional change.

10 years agoConvert pieceSquareTable to 3 dimensions
Marco Costalba [Sun, 9 Jun 2013 11:05:41 +0000 (13:05 +0200)]
Convert pieceSquareTable to 3 dimensions

No functional change.

10 years agoMore consistent 'piece' variable naming
Marco Costalba [Sun, 9 Jun 2013 10:56:05 +0000 (12:56 +0200)]
More consistent 'piece' variable naming

No functional change.

10 years agoIntroduce operator~(Piece c)
Marco Costalba [Sun, 9 Jun 2013 10:43:12 +0000 (12:43 +0200)]
Introduce operator~(Piece c)

Small syntactic sugar to reverse piece color.

No functional change.

10 years agoRetire psq_delta()
Marco Costalba [Sun, 9 Jun 2013 10:24:43 +0000 (12:24 +0200)]
Retire psq_delta()

No functional change.

10 years agoUse alpha instead of beta-1
Marco Costalba [Sun, 9 Jun 2013 09:52:39 +0000 (11:52 +0200)]
Use alpha instead of beta-1

It is more directly related to a fail-low.

No functional change.

10 years agoFix incorrect 'ss' pointer in early stop check
Marco Costalba [Sun, 9 Jun 2013 08:58:24 +0000 (10:58 +0200)]
Fix incorrect 'ss' pointer in early stop check

The exclusion search used to verify one move is much
better than other shall be called with 'ss' and not
'ss+1'

No functional change.

10 years agoFix a typo
Dariusz Orzechowski [Tue, 4 Jun 2013 21:52:00 +0000 (23:52 +0200)]
Fix a typo

No functional change.

10 years agoFix search log when using skills
Marco Costalba [Sat, 8 Jun 2013 08:35:35 +0000 (10:35 +0200)]
Fix search log when using skills

In case of we pick a sub-optimal move be
sure to print this, and not the best one
on seach log file.

Bug spotted by Guenther Demetz.

No functional change.

10 years agoFix a crash when 'go' multiple times
Marco Costalba [Sat, 1 Jun 2013 13:45:46 +0000 (15:45 +0200)]
Fix a crash when 'go' multiple times

Search is started after setting a position and
issuing UCI 'go' command. Then if we stop the search
and call 'go' again without setting a new position it
is assumed that the previous setup is preserved, but
this is not the case because what happens is that
SetupStates is reset to NULL, leading to a crash as
soon as RootPos.is_draw() is called because st->previous
is now stale.

UCI protocol is not very clear about requiring that a
position is setup always before launching a search,
so here we easy the life of GUI developers assuming
that the current state is preserved after returning
from a 'stop' command.

Bug reported by Gregor Cramer.

No functional change.

10 years agoAssorted renaming in evaluation
Marco Costalba [Sat, 1 Jun 2013 09:48:38 +0000 (11:48 +0200)]
Assorted renaming in evaluation

And some reshuffle too.

No functional change.

10 years agoPassed pawn tuning
jundery [Thu, 30 May 2013 03:07:24 +0000 (21:07 -0600)]
Passed pawn tuning

A small number of tests with simulated
annealing at 15s indicated these values
may be better

And this is verified at long 60+0.05 TC
LLR: 2.95 (-2.94,2.94)
Total: 40658 W: 7821 L: 7501 D: 25336

bench: 4931544

10 years agoShrink engine UCI name
Marco Costalba [Mon, 27 May 2013 15:42:52 +0000 (17:42 +0200)]
Shrink engine UCI name

Some GUI have problems with long names.

Reported by George Speight.

No functional change.

10 years agoAdd Pawn Structure also to polyglot.ini
Marco Costalba [Sat, 25 May 2013 11:14:41 +0000 (13:14 +0200)]
Add Pawn Structure also to polyglot.ini

No functional change.

10 years agoRe-add "Pawn Structure" UCI option
Marco Costalba [Sat, 25 May 2013 10:18:58 +0000 (12:18 +0200)]
Re-add "Pawn Structure" UCI option

And reshuffle the code to not special case
this parameter.

No functional change.

10 years agoMore uniform tracing code
Marco Costalba [Sat, 25 May 2013 09:57:18 +0000 (11:57 +0200)]
More uniform tracing code

No functional change.

10 years agoBunch of 3 small patches
Uri Blass [Tue, 21 May 2013 22:58:52 +0000 (01:58 +0300)]
Bunch of 3 small patches

This patch is the sum of:

- Grainsize of 4 instead of 8

- Removing "depth < DEPTH_ZERO"

- Change DEPTH_QS_RECAPTURES = -5 to -7

All the patches individually failed to pass SPRT but scored
around 50%.

Together they pass easily short TC:
LLR: 2.96 (-2.94,2.94)
Total: 4429 W: 964 L: 844 D: 2621

And with some difficult long TC of 60+0.05:
LLR: 2.95 (-2.94,2.94)
Total: 64133 W: 11968 L: 11532 D: 40633

bench: 4821467

10 years agoMicroptimize MoveList loop
Marco Costalba [Sun, 19 May 2013 20:00:49 +0000 (22:00 +0200)]
Microptimize MoveList loop

Add MOVE_NONE at the tail, this allows to loop
across MoveList checking for *it != MOVE_NONE,
and because *it is used imediately after compiler
is able to reuse it.

With this small patch perft speed increased of 3%

And it is also a semplification !

No functional change.

10 years agoDelay killers[] initialization
Marco Costalba [Sat, 18 May 2013 10:49:31 +0000 (12:49 +0200)]
Delay killers[] initialization

Most of the time we cut-off earlier, at captures, so this
results in useless work.

There is a small functionality change becuase 'ss' can change
from MovePicker c'tor to when killers are tried due, for
instance, to singular search.

bench: 4603795

10 years agoReduce countermoves less in LMR
Marco Costalba [Sun, 19 May 2013 19:32:52 +0000 (21:32 +0200)]
Reduce countermoves less in LMR

Passed SPRT for both short TC 15+0.05:
LLR: 2.95 (-2.94,2.94)
Total: 17724 W: 3756 L: 3598 D: 10370

And long TC 60+0.05:
LLR: 2.95 (-2.94,2.94)
Total: 22672 W: 4232 L: 4011 D: 14429

bench: 4418832

10 years agoMimic an iterator for looping across MoveList
Marco Costalba [Sun, 19 May 2013 11:28:25 +0000 (13:28 +0200)]
Mimic an iterator for looping across MoveList

Seems more conventional.

No functional change.

10 years agoUse two counter moves instead of one
Joona Kiiski [Wed, 15 May 2013 19:31:45 +0000 (20:31 +0100)]
Use two counter moves instead of one

Very good at long 60"+0.05 TC
LLR: 2.95 (-2.94,2.94)
Total: 5954 W: 1151 L: 1016 D: 3787

[edit: slightly changed form original patch to avoid useless loop
 across killers when killer is MOVE_NONE]

bench: 4327405

10 years agoRename Refutation to Countermove
Marco Costalba [Wed, 15 May 2013 18:35:54 +0000 (20:35 +0200)]
Rename Refutation to Countermove

Use proper naming according to:

http://chessprogramming.wikispaces.com/Countermove+Heuristic

The name of this idea is "Countermove Heuristic" and was
first introduced by Jos Uiterwijk in 1992

No functional change.

10 years agoIncreased mobility array
Uri Blass [Tue, 14 May 2013 22:19:51 +0000 (23:19 +0100)]
Increased mobility array

Performed more or less well at short TC
LLR: 2.95 (-2.94,2.94)
Total: 50517 W: 9815 L: 9574 D: 31128

And a bit better at long TC
LLR: 2.96 (-2.94,2.94)
Total: 15564 W: 2805 L: 2624 D: 10135

bench: 4375253

10 years agoRevert trapped rook bug fix
Marco Costalba [Tue, 14 May 2013 22:06:11 +0000 (00:06 +0200)]
Revert trapped rook bug fix

It seems that do  not limiting checking the
trapped rook only on rank 1 improves the
score.

At long TC
LLR: 2.97 (-2.94,2.94)
Total: 6581 W: 1346 L: 1204 D: 4031

bench: 4985012

10 years agoMinor bugfixes to refutation table
Gary Linscott [Mon, 13 May 2013 19:04:18 +0000 (12:04 -0700)]
Minor bugfixes to refutation table

Don't update refutation table in case of
previous move is MOVE_NULL or MOVE_NONE
and don't try refutation if is already
a killer move.

Pass both short TC
LLR: 2.96 (-2.94,2.94)
Total: 4310 W: 953 L: 869 D: 2488

And long one
LLR: 2.95 (-2.94,2.94)
Total: 6707 W: 1254 L: 1184 D: 4269

bench: 4785954

10 years agoReformat previous patch
Marco Costalba [Mon, 13 May 2013 18:07:10 +0000 (20:07 +0200)]
Reformat previous patch

No functional change.

10 years agoEnable refuation table
Joona Kiiski [Sun, 12 May 2013 20:23:29 +0000 (21:23 +0100)]
Enable refuation table

Very good result both at short TC 15+0.05
LLR: 2.95 (-2.94,2.94)
Total: 2803 W: 596 L: 483 D: 1724

And at long TC 60+0.05
LLR: 2.95 (-2.94,2.94)
Total: 2862 W: 548 L: 431 D: 1883

bench: 4329221

10 years agoSimple always overwrite Refutation table
Joona Kiiski [Sun, 12 May 2013 20:21:46 +0000 (21:21 +0100)]
Simple always overwrite Refutation table

10 years agoUse Them instead of ~Us
Marco Costalba [Sat, 11 May 2013 09:32:34 +0000 (11:32 +0200)]
Use Them instead of ~Us

Unortunatly we have no guarantee that the call to
operator~(Color c) is resolved at compile time.

Perhaps the solution would be to use C++11 const_expr,
but for now simply use the good old-style ternary operator
that works as expected.

No functional change.

10 years agoSome code reformat in evaluate_pieces
Marco Costalba [Sat, 11 May 2013 07:29:02 +0000 (09:29 +0200)]
Some code reformat in evaluate_pieces

No functional change.

10 years agoSimplify previous patch
Marco Costalba [Wed, 8 May 2013 21:06:21 +0000 (23:06 +0200)]
Simplify previous patch

No functional change.

10 years agoMerge 'passed_pawns' tweaks
Marco Costalba [Wed, 8 May 2013 21:02:08 +0000 (23:02 +0200)]
Merge 'passed_pawns' tweaks

Good at both short and long TC

15+0.05
LLR: 2.96 (-2.94,2.94)
Total: 28220 W: 5531 L: 5349 D: 17340

TC 60+0.05
LLR: 2.95 (-2.94,2.94)
Total: 12612 W: 2221 L: 2057 D: 8334

bench: 4857939

10 years agoAvoid explicit bitwise operators
Reuven Peleg [Sun, 5 May 2013 19:39:06 +0000 (22:39 +0300)]
Avoid explicit bitwise operators

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
10 years agoPassed pawn eval
jundery [Sun, 5 May 2013 17:12:04 +0000 (11:12 -0600)]
Passed pawn eval

Use a stepped function to evaluate bonuses and add the bonus to the
middle game

bench: 4857939

10 years agoMerge increased 'movecount' pruning
Marco Costalba [Sun, 5 May 2013 11:43:26 +0000 (13:43 +0200)]
Merge increased 'movecount' pruning

Good at both short and long TC

15+0.05
LLR: 2.95 (-2.94,2.94)
Total: 13814 W: 2731 L: 2588 D: 8495

TC 60+0.05
LLR: 2.95 (-2.94,2.94)
Total: 18013 W: 3136 L: 2946 D: 11931

bench: 4306557

10 years agoSimplify previous condition
Marco Costalba [Sat, 4 May 2013 10:27:19 +0000 (12:27 +0200)]
Simplify previous condition

No functional change.

10 years agoFix trapped rook condition
Marco Costalba [Sat, 4 May 2013 10:18:18 +0000 (12:18 +0200)]
Fix trapped rook condition

A rook is trapped if on rank 1 as is the king.
Currently the condition aloows for the rook
to be also in front of the pawns as long
as king is on first rank.

Verified with short TC test:
LLR: -1.71 (-2.94,2.94)
Total: 23234 W: 4317 L: 4317 D: 14600

Here what it counts is that after 23K games
result is equal.

bench: 4696542

10 years agoFurther simplify previous patch
Marco Costalba [Sat, 4 May 2013 09:42:34 +0000 (11:42 +0200)]
Further simplify previous patch

No functional change.

10 years agoMerge some conditions
homoSapiensSapiens [Fri, 3 May 2013 11:01:41 +0000 (14:01 +0300)]
Merge some conditions

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
10 years agoDrop some redundant defined(_WIN64)
Marco Costalba [Fri, 3 May 2013 13:21:23 +0000 (15:21 +0200)]
Drop some redundant defined(_WIN64)

When it is already defined(_WIN32).

According to Microsoft documentation:
http://msdn.microsoft.com/en-us/library/b0084kay.aspx

_WIN32 Defined for applications for Win32 and Win64. Always defined.

_WIN64 Defined for applications for Win64.

Patch suggested by Joona.

No functional change.

10 years agoPrint time and node count before search ends
Marco Costalba [Fri, 3 May 2013 08:25:25 +0000 (10:25 +0200)]
Print time and node count before search ends

This info is normally printed together with
PV info in uci_pv() but when search is stopped,
for instance when max search time is reached,
uci_pv is not called and we miss this bits.

Suggested by gravy_train

No functional change.

10 years agoMerge mobility area tweak
Marco Costalba [Fri, 3 May 2013 08:10:08 +0000 (10:10 +0200)]
Merge mobility area tweak

A nice improvment.

Was good at 15+0.05
LLR: 2.96 (-2.94,2.94)
Total: 10731 W: 2176 L: 2040 D: 6515

And at 60"+0.05
LLR: 2.96 (-2.94,2.94)
Total: 10601 W: 1968 L: 1810 D: 6823

bench: 4676606

10 years agoFix rounding issue
Gary Linscott [Thu, 2 May 2013 18:37:55 +0000 (14:37 -0400)]
Fix rounding issue

10 years agoMore aggressive move count pruning
Gary Linscott [Thu, 2 May 2013 13:47:34 +0000 (09:47 -0400)]
More aggressive move count pruning

10 years agoAnother take at TT alignment
Marco Costalba [Thu, 2 May 2013 07:35:52 +0000 (09:35 +0200)]
Another take at TT alignment

This time revert to original version but using
uintptr_t instead of size_t

Suggested by Lucas.

No functional change.

10 years agoRe-add "Cache line aligned TT"
Marco Costalba [Wed, 1 May 2013 20:55:23 +0000 (22:55 +0200)]
Re-add "Cache line aligned TT"

But this time do not play with pointers, in
particular do not assume that size_t is an
unsigned type of the same width as pointers.

This code should be fully portable.

No functional change.

10 years agoTweak Mobility Area
jhellis3 [Wed, 1 May 2013 07:37:50 +0000 (02:37 -0500)]
Tweak Mobility Area

Only consider pawns and the king as restricting.

10 years agoRestore development version
Marco Costalba [Tue, 30 Apr 2013 18:00:05 +0000 (20:00 +0200)]
Restore development version

No functional change.

10 years agoStockfish 3
Marco Costalba [Sun, 28 Apr 2013 22:59:57 +0000 (00:59 +0200)]
Stockfish 3

Stockfish bench signature is: 4176431

10 years agoRevert "Cache line aligned TT"
Marco Costalba [Tue, 30 Apr 2013 06:08:54 +0000 (08:08 +0200)]
Revert "Cache line aligned TT"

This reverts commit 083fe5812485597e13943b690cc24a8f25c0d140

It seems to break Android build

No functional change.

10 years agoTemporary revert "Expose EvalInfo struct to search"
Marco Costalba [Sun, 28 Apr 2013 22:54:08 +0000 (00:54 +0200)]
Temporary revert "Expose EvalInfo struct to search"

It is not needed for the release and introduces
a slowdown, although very small.

Probably it will be readded after the release.

No functional change.

10 years agoFix a 'value > VALUE_INFINITE' assert
Marco Costalba [Sat, 27 Apr 2013 11:07:12 +0000 (13:07 +0200)]
Fix a 'value > VALUE_INFINITE' assert

This fixes an assert while testing with debug on.

Assert was due to static null pruning returning value

eval - futility_margin(depth, (ss-1)->futilityMoveCount)

That was sometimes higher than VALUE_INFINITE triggering
an assert at the caller site.

Because eval con be equal to ttValue and anyhow is read from
TT that can be corrupted in SMP case, we need to sanity
check it before to use.

bench: 4176431

10 years agoCache line aligned TT
Marco Costalba [Fri, 26 Apr 2013 16:45:54 +0000 (18:45 +0200)]
Cache line aligned TT

Let TT clusters (16*4=64 bytes) to hold on a singe cache line.
This avoids the need for the double prefetch.

Original patches by Lucas and Jean-Francois that has also tested
on his AMD FX:

BIG HASHTABLE

./stockfish bench 1024 1 18 > /dev/null

Before:
1437642 nps
1426519 nps
1438493 nps

After:
1474482 nps
1476375 nps
1475877 nps

SMALL HASHTABLE

./stockfish bench 128 1 18 > /dev/null

Before:
1435207 nps
1435586 nps
1433741 nps

After:
1479143 nps
1471042 nps
1472286 nps

No functional change.

10 years agoFix a crash introduced few days ago
Marco Costalba [Fri, 26 Apr 2013 10:12:53 +0000 (12:12 +0200)]
Fix a crash introduced few days ago

Crash is due to uninitialized ss->futilityMoveCount that
when happens to be negative, yields to an out of range
access in futility_margin().

Bug is subtle because it shows itself only in SMP case.
Indeed in single thread mode we only use the

Stack ss[MAX_PLY_PLUS_2];

Allocated at the begin of id_loop() and due to pure
(bad) luck, it happens that for all the MAX_PLY_PLUS_2
elements, ss[i].futilityMoveCount >= 0

Note that the patch does not prevent futilityMoveCount
to be overwritten after, for instance singular search
or null verification, but to keep things readable and
because the effect is almost unmeasurable, we here
prefer a slightly incorrect but simpler patch.

bench: 4311634

10 years agoStore Eval::Info in Search::Stack
Marco Costalba [Thu, 25 Apr 2013 19:51:05 +0000 (21:51 +0200)]
Store Eval::Info in Search::Stack

Instead of a pointer. This should fix the issue of
remaining with a stale pointer when for instance calling
IID, but also null search verification, singular search
and razoring where we call search with the same ss
pointer. In this case ss->ei is overwritten in the
search() call and upon returning remains stale.

This patch could have a performance hit because Eval::Info
is big (176 bytes) and during splitting we copy 4 ss entries.

On the good side, this patch is a clean solution.

Proposed by Gary.

No functional change.

10 years agoExpose EvalInfo struct to search
Marco Costalba [Thu, 25 Apr 2013 10:43:55 +0000 (12:43 +0200)]
Expose EvalInfo struct to search

Allow to use EvalInfo struct, populated by
evaluation(), in search.

In particular we allocate Eval::Info on the stack
and pass a pointer to this to evaluate().

Also add to Search::Stack a pointer to Eval::Info,
this allows to reference eval info of previous/next
nodes.

WARNING: Eval::Info is NOT initialized and is populated
by evaluate(), only if the latter is called, and this
does not happen in all the code paths, so care should be
taken when accessing this struct.

No functional change.

10 years agoIncrease rook/queen on 7th bonus
Ryan Schmitt [Thu, 11 Apr 2013 02:17:13 +0000 (19:17 -0700)]
Increase rook/queen on 7th bonus

Shows an increase at 15+0.05
LLR: 3.01 (-2.94,2.94)
Total: 20450 W: 4091 L: 3927 D: 12432

And at 60+0.05
LLR: 2.97 (-2.94,2.94)
Total: 61432 W: 10849 L: 10441 D: 40142

bench: 4493356

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
10 years agoMerge Joona's increased static null pruning
Marco Costalba [Thu, 25 Apr 2013 09:39:06 +0000 (11:39 +0200)]
Merge Joona's increased static null pruning

The idea is to fail high more easily in static
null test if in the parent node we are already
very deep in the move list, so the propability
to fail high there is very low.

[edit: I have slightly changed the functionality
moving

ss->futilityMoveCount = moveCount;

At the end of the pruning code, this should not affect
ELO in anyway, but makes code more natural and logic]

Test with SPRT is good at 15+0.05
LLR: 2.96 (-2.94,2.94)
Total: 50653 W: 10024 L: 9780 D: 30849

And at 60+0.05
LLR: 2.97 (-2.94,2.94)
Total: 40799 W: 7227 L: 6921 D: 26651

bench: 4530093

10 years agoFix cpu_count() on some platforms
Marco Costalba [Thu, 25 Apr 2013 08:56:56 +0000 (10:56 +0200)]
Fix cpu_count() on some platforms

When we use sysconf(_SC_NPROCESSORS_ONLN) to get number of
cores, we have to include sysconf library that is unistd.h

Sometimes it happens to work just becuase unistd.h indirectly
included by some other libraries, but not always.

Reported and fixed by Eyal BD

No functional change.

10 years agoFix potential overflow
Joona Kiiski [Tue, 23 Apr 2013 06:26:36 +0000 (07:26 +0100)]
Fix potential overflow

10 years agoMore aggressive post-futility pruning
Joona Kiiski [Sun, 21 Apr 2013 13:53:27 +0000 (14:53 +0100)]
More aggressive post-futility pruning

11 years agoSkip a couple of popcount in previous patch
Marco Costalba [Fri, 19 Apr 2013 07:41:28 +0000 (09:41 +0200)]
Skip a couple of popcount in previous patch

And some little tidy up

No functional change.