Commit graph

2891 commits

Author SHA1 Message Date
Marco Costalba 05c6f7a40b 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.
2013-06-08 10:56:20 +02:00
Marco Costalba 2a98042c21 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.
2013-06-01 16:19:42 +02:00
Marco Costalba 46409a7852 Assorted renaming in evaluation
And some reshuffle too.

No functional change.
2013-06-01 13:17:39 +02:00
jundery d8b266af8b 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
2013-05-31 09:17:48 +02:00
Marco Costalba abb40777bf Shrink engine UCI name
Some GUI have problems with long names.

Reported by George Speight.

No functional change.
2013-05-27 17:43:38 +02:00
Marco Costalba 90abcac1c7 Add Pawn Structure also to polyglot.ini
No functional change.
2013-05-25 13:14:41 +02:00
Marco Costalba 7222f47350 Re-add "Pawn Structure" UCI option
And reshuffle the code to not special case
this parameter.

No functional change.
2013-05-25 12:38:14 +02:00
Marco Costalba eafb66e1aa More uniform tracing code
No functional change.
2013-05-25 12:01:50 +02:00
Uri Blass d4a02b135d 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
2013-05-23 17:59:39 +02:00
Marco Costalba d3608c4e79 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.
2013-05-19 22:00:49 +02:00
Marco Costalba 38cfbeeb50 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
2013-05-19 21:41:56 +02:00
Marco Costalba 77547a4ef1 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
2013-05-19 21:36:23 +02:00
Marco Costalba 8ceef92266 Mimic an iterator for looping across MoveList
Seems more conventional.

No functional change.
2013-05-19 13:28:25 +02:00
Joona Kiiski f7c013edd0 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
2013-05-16 16:20:50 +02:00
Marco Costalba 148490f04c 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.
2013-05-15 20:59:56 +02:00
Uri Blass 7c6f346c90 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
2013-05-15 00:34:05 +02:00
Marco Costalba 1a34496761 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
2013-05-15 00:06:11 +02:00
Gary Linscott 049e5ca191 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
2013-05-14 23:52:44 +02:00
Marco Costalba 19dd0de4ff Reformat previous patch
No functional change.
2013-05-13 20:42:44 +02:00
Joona Kiiski 8a61b030a6 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
2013-05-13 19:48:41 +02:00
Joona Kiiski c7e31d5aa8 Simple always overwrite Refutation table 2013-05-12 21:21:46 +01:00
Marco Costalba 818a3537a7 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.
2013-05-11 11:49:44 +02:00
Marco Costalba bcbc9bfd1f Some code reformat in evaluate_pieces
No functional change.
2013-05-11 11:13:06 +02:00
Marco Costalba 7eda7335fd Simplify previous patch
No functional change.
2013-05-09 19:09:51 +02:00
Marco Costalba 02606a8c83 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
2013-05-08 23:04:11 +02:00
Reuven Peleg e7505324f6 Avoid explicit bitwise operators
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-05-05 22:51:18 +02:00
jundery 653c0527a7 Passed pawn eval
Use a stepped function to evaluate bonuses and add the bonus to the
middle game

bench: 4857939
2013-05-05 11:12:04 -06:00
Marco Costalba 7f4c7cd785 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
2013-05-05 13:46:26 +02:00
Marco Costalba 0958e5c6d3 Simplify previous condition
No functional change.
2013-05-05 12:31:32 +02:00
Marco Costalba 9fc77bc414 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
2013-05-05 12:27:11 +02:00
Marco Costalba 3b92159908 Further simplify previous patch
No functional change.
2013-05-04 12:15:31 +02:00
homoSapiensSapiens e00bb13e85 Merge some conditions
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2013-05-04 11:13:22 +02:00
Marco Costalba 3b41e62666 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.
2013-05-03 15:24:54 +02:00
Marco Costalba 37c91aa94c 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.
2013-05-03 10:26:03 +02:00
Marco Costalba 43f67eab5f 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
2013-05-03 10:12:31 +02:00
Gary Linscott 11d30b6298 Fix rounding issue 2013-05-02 14:37:55 -04:00
Gary Linscott 3edb15d183 More aggressive move count pruning 2013-05-02 09:47:34 -04:00
Marco Costalba d44ac0a485 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.
2013-05-02 09:38:23 +02:00
Marco Costalba 481eda4ca0 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.
2013-05-01 23:42:16 +02:00
jhellis3 7323231786 Tweak Mobility Area
Only consider pawns and the king as restricting.
2013-05-01 02:37:50 -05:00
Marco Costalba e381951a24 Restore development version
No functional change.
2013-04-30 20:01:07 +02:00
Marco Costalba aa2368a687 Stockfish 3
Stockfish bench signature is: 4176431
2013-04-30 19:42:43 +02:00
Marco Costalba 293c44bc09 Revert "Cache line aligned TT"
This reverts commit 083fe58124

It seems to break Android build

No functional change.
2013-04-30 19:42:21 +02:00
Marco Costalba 06b9140e5c 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.
2013-04-29 00:55:32 +02:00
Marco Costalba 156635749b 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
2013-04-27 13:08:11 +02:00
Marco Costalba 083fe58124 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.
2013-04-26 19:38:11 +02:00
Marco Costalba e508494a99 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
2013-04-26 12:14:01 +02:00
Marco Costalba 2ef53ee368 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.
2013-04-25 21:52:26 +02:00
Marco Costalba d810441b35 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.
2013-04-25 12:57:37 +02:00
Ryan Schmitt 79bcb2ca54 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>
2013-04-25 12:13:17 +02:00