stockfish
11 years agoRemove src/COPYING file
Marco Costalba [Thu, 14 Apr 2011 06:06:56 +0000 (07:06 +0100)]
Remove src/COPYING file

It is enough the one in the base directory

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove "divide by zero" workaround
Marco Costalba [Thu, 14 Apr 2011 06:04:32 +0000 (07:04 +0100)]
Remove "divide by zero" workaround

It is now useless because of the condition at the beginning.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoCleanup debug counters
Marco Costalba [Wed, 13 Apr 2011 13:12:33 +0000 (15:12 +0200)]
Cleanup debug counters

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove move_is_legal() under Position class
Marco Costalba [Wed, 13 Apr 2011 09:54:41 +0000 (11:54 +0200)]
Move move_is_legal() under Position class

It is a more logical place than in move generation file.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSome more cleanup in endgame.cpp
Marco Costalba [Wed, 13 Apr 2011 07:08:19 +0000 (09:08 +0200)]
Some more cleanup in endgame.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix some warnings and a compile error with icc
Marco Costalba [Tue, 12 Apr 2011 05:27:00 +0000 (07:27 +0200)]
Fix some warnings and a compile error with icc

Unfortunatly icc does not understand that weakerSide and
strongerSide belongs to the base class :-(

So we have define them in the derived class.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove EndgameFunctions to endgame.cpp
Marco Costalba [Mon, 11 Apr 2011 16:12:41 +0000 (18:12 +0200)]
Move EndgameFunctions to endgame.cpp

And cleanup code while there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIncrease MaterialTableSize 8 times
Marco Costalba [Mon, 11 Apr 2011 13:33:35 +0000 (15:33 +0200)]
Increase MaterialTableSize 8 times

Now that we prefetch in material hash table we
can increase its size and gain something.

Hit rate is now of 98% from 92%

Speedup of 0.8%

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIntroduce and use NoPawnsSF[] in material.cpp
Marco Costalba [Mon, 11 Apr 2011 12:50:56 +0000 (14:50 +0200)]
Introduce and use NoPawnsSF[] in material.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoTempeltize material imbalance
Marco Costalba [Mon, 11 Apr 2011 09:32:55 +0000 (11:32 +0200)]
Tempeltize material imbalance

Speedup of almost 1%

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSync material.h with pawns.h
Marco Costalba [Mon, 11 Apr 2011 07:54:41 +0000 (09:54 +0200)]
Sync material.h with pawns.h

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoPrefetch also material tables
Marco Costalba [Mon, 11 Apr 2011 07:03:34 +0000 (09:03 +0200)]
Prefetch also material tables

Prefetch both pawn and material tables in do_move() and
prefetch always, not only after a pawn move or a capture.

Speed up of 0,7%

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAssorted code style and comments in pawns.cpp and pawns.h
Marco Costalba [Sat, 9 Apr 2011 18:50:56 +0000 (19:50 +0100)]
Assorted code style and comments in pawns.cpp and pawns.h

The only interesting thing is that a backward or isolated
pawn cannot be a candidate passer, so code this condition.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire mate threat extension
Marco Costalba [Fri, 8 Apr 2011 06:48:05 +0000 (07:48 +0100)]
Retire mate threat extension

It seems we have a lot of totally useless code !

After 8577 games 1504 - 1451 - 5622 ELO +2 (+- 4.4)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix a compile error in debug mode
Marco Costalba [Thu, 7 Apr 2011 07:09:41 +0000 (08:09 +0100)]
Fix a compile error in debug mode

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAssorted code style and comments in search.cpp
Marco Costalba [Sun, 3 Apr 2011 08:19:08 +0000 (09:19 +0100)]
Assorted code style and comments in search.cpp

Nothing really serious....

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAdded -Wshadow option and fixed resulting warnings
Marco Costalba [Mon, 4 Apr 2011 07:53:44 +0000 (09:53 +0200)]
Added -Wshadow option and fixed resulting warnings

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoTeach SF to blunder
Marco Costalba [Sat, 2 Apr 2011 08:05:53 +0000 (09:05 +0100)]
Teach SF to blunder

Add blunder cabability to skill level feature.

The idea is that instead of choosing the best move at the end
of the ID loop, we now do this at a randomly chosen sampling depth
dependent on SkillLevel, so that at low skill levels we sample when
ID loop has reached only a small depth and so we have an higher
probability to pick up a blunder.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse prob cut search to prune bad captures
Joona Kiiski [Sat, 2 Apr 2011 07:15:05 +0000 (08:15 +0100)]
Use prob cut search to prune bad captures

The idea is to try a shallow search with reduced beta
on bad captures so to quickly prune them out in case
are really bad.

After 5529 games 966 - 868 - 3695  ELO +6 (+- 5.4) LOS 91%

Tested also version without upper limitation to 8 plies:

After 8780 games 1537 - 1398 - 5850  ELO +5 (+- 4.3) LOS 93%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire recapture extension also for PvNode
Marco Costalba [Sat, 26 Mar 2011 11:19:51 +0000 (12:19 +0100)]
Retire recapture extension also for PvNode

Seems that extension is useless.

After 10105 games
Mod vs Orig 1738 - 1702 - 6665  ELO +1 (+- 4)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse a constant instead of value_mate_in(PLY_MAX)
Marco Costalba [Fri, 1 Apr 2011 12:35:39 +0000 (14:35 +0200)]
Use a constant instead of value_mate_in(PLY_MAX)

And also apply the same to value_mated_in(PLY_MAX)

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire value_is_mate()
Marco Costalba [Fri, 1 Apr 2011 12:19:51 +0000 (14:19 +0200)]
Retire value_is_mate()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSimplify wait_for_stop_or_ponderhit()
Marco Costalba [Fri, 1 Apr 2011 11:48:13 +0000 (13:48 +0200)]
Simplify wait_for_stop_or_ponderhit()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire update_killers()
Marco Costalba [Fri, 1 Apr 2011 11:36:14 +0000 (13:36 +0200)]
Retire update_killers()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFine tune skill level
Marco Costalba [Sun, 27 Mar 2011 17:54:02 +0000 (18:54 +0100)]
Fine tune skill level

Rescaled Skill level from 0 to 20. At level 19 is still
comparable with Crafty 20.14, while at low levels strength
increase is now less steep.

Thanks to Joona and Heinz for testing and valuable
comments.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAdd "Skill level functionality
Marco Costalba [Sun, 27 Mar 2011 10:23:29 +0000 (11:23 +0100)]
Add "Skill level functionality

It is now possible to adjust skill level of Stockfish
from 10 (full strength) to 0.

Skill adjustment is done in such a way that is CPU speed and
time control largely independent, at least at low skills. It
means that given a skill we have same play level on a mobile
phone and on a super OCTAL CPU, at 1' per game or at 180'.

At skill 9 strength is that of an average engine, I have used
Crafty 20.14 to tune and we are more or less there. At skill 0
engine is pretty weak but still shows a realistic play.

When skill is not used we don't have any impact on the regular
code.

Idea to use MultiPV is from Heinz van Saanen, implementation and
formulas by me.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix a compile error with icc
Marco Costalba [Sat, 26 Mar 2011 07:42:38 +0000 (08:42 +0100)]
Fix a compile error with icc

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSend PV line to GUI only after resolving a fail high
Marco Costalba [Thu, 24 Mar 2011 10:06:00 +0000 (11:06 +0100)]
Send PV line to GUI only after resolving a fail high

This is how Shredder, Rybka and others do and
avoids user is confused by a fail high (sent to GUI)
followed by a fail low (not sent).

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoTriviality in position.cpp
Marco Costalba [Thu, 24 Mar 2011 09:05:14 +0000 (10:05 +0100)]
Triviality in position.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire move_ambiguity() altogether
Marco Costalba [Wed, 23 Mar 2011 09:50:50 +0000 (10:50 +0100)]
Retire move_ambiguity() altogether

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSimplify move_ambiguity()
Marco Costalba [Tue, 22 Mar 2011 08:24:14 +0000 (09:24 +0100)]
Simplify move_ambiguity()

And additional small touches in move.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoDo not send ponder move if we don't have it
Marco Costalba [Sat, 19 Mar 2011 15:00:09 +0000 (16:00 +0100)]
Do not send ponder move if we don't have it

Has been reported by Justin Blanchard that
this creates problems on some buggy GUI.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse intrinsic in pop_1st_bit() under MSVC 64 bits
Marco Costalba [Thu, 17 Mar 2011 12:47:15 +0000 (13:47 +0100)]
Use intrinsic in pop_1st_bit() under MSVC 64 bits

Around 1% speedup when compiled with MSVC 64

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAdditional cleanup in bitbase.cpp
Marco Costalba [Sat, 12 Mar 2011 15:57:02 +0000 (16:57 +0100)]
Additional cleanup in bitbase.cpp

Also better document what code does.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove KPKBitbase[] where it belongs
Marco Costalba [Sat, 12 Mar 2011 11:04:02 +0000 (12:04 +0100)]
Move KPKBitbase[] where it belongs

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix a couple of issues in bitbase.cpp
Marco Costalba [Sat, 12 Mar 2011 10:22:02 +0000 (11:22 +0100)]
Fix a couple of issues in bitbase.cpp

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoReintroduce initialization of some bitboards
Marco Costalba [Thu, 10 Mar 2011 13:39:53 +0000 (14:39 +0100)]
Reintroduce initialization of some bitboards

With off-by-one bug in InFrontBB[] loop fixed.

Also use int instead of File to workaround a bug
in mingw 4.4.0 in first loop that cycles forever.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename NonSlidingAttacksBB[] in StepAttacksBB[]
Marco Costalba [Wed, 9 Mar 2011 08:58:26 +0000 (09:58 +0100)]
Rename NonSlidingAttacksBB[] in StepAttacksBB[]

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUpdate copyright notes in rkiss.h
Marco Costalba [Wed, 9 Mar 2011 08:20:43 +0000 (09:20 +0100)]
Update copyright notes in rkiss.h

New info after a thread on talkchess:

http://www.talkchess.com/forum/viewtopic.php?t=38313

and some emails exchange with Heinz.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRevert previous patch due to miscompile under gcc
Marco Costalba [Thu, 10 Mar 2011 07:07:07 +0000 (08:07 +0100)]
Revert previous patch due to miscompile under gcc

I need to understand what's going on, in the
meantime revert.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoChange initialization of some bitboards
Marco Costalba [Tue, 8 Mar 2011 13:38:17 +0000 (14:38 +0100)]
Change initialization of some bitboards

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIncrease MAX_THREADS to 32
Marco Costalba [Sun, 20 Feb 2011 10:07:13 +0000 (11:07 +0100)]
Increase MAX_THREADS to 32

No speed regression after 8731 games:
Mod vs Orig 1394 - 1342 - 5995  ELO +2 (+- 4.1)

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIntroduce and use rot() in rkiss.h
Marco Costalba [Mon, 7 Mar 2011 17:13:02 +0000 (18:13 +0100)]
Introduce and use rot() in rkiss.h

Also fix indentation.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSimplify aspirationDelta update rule
Marco Costalba [Tue, 1 Mar 2011 12:15:13 +0000 (13:15 +0100)]
Simplify aspirationDelta update rule

After 7522 games:
Mod vs Orig 1229 - 1148 - 5145  ELO +3 (+- 4.5) LOS 83%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoBe sure to read options before to call trace_evaluate()
Marco Costalba [Tue, 1 Mar 2011 12:32:19 +0000 (13:32 +0100)]
Be sure to read options before to call trace_evaluate()

Otherwise in case we change an option with setoption and
then ask for "eval" command the evaluation is not updated.

Spotted by Justin Blanchard.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix aspiration corner case
Marco Costalba [Mon, 28 Feb 2011 19:17:57 +0000 (20:17 +0100)]
Fix aspiration corner case

Fix a corner case where we start aspiration window and
suddendly we get a VALUE_KNOWN_WIN / MATE score, this makes
aspiration to blow up in a series of researches loops.

Exit aspiration loop in that case.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove a FIXME in id_loop()
Marco Costalba [Mon, 28 Feb 2011 08:00:17 +0000 (09:00 +0100)]
Remove a FIXME in id_loop()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoScore root move list during first iteration
Marco Costalba [Sat, 26 Feb 2011 17:29:22 +0000 (18:29 +0100)]
Score root move list during first iteration

Use first iteration to get a proper startup score
and possibly detect an easy move.

After 5180 games:
Mod vs Orig 847 - 823 - 3510  ELO +1 (+- 5.5)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove an useless condition in equal SEE pruning
Marco Costalba [Sun, 27 Feb 2011 08:28:30 +0000 (09:28 +0100)]
Remove an useless condition in equal SEE pruning

Because we are never in check there and evaluation cannot
return a mated value the condition is useless.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoPrune moves with equal SEE in qsearch
Marco Costalba [Tue, 22 Feb 2011 22:23:45 +0000 (23:23 +0100)]
Prune moves with equal SEE in qsearch

After 5166 games:
Mod vs Orig 890 - 762 - 3514  ELO +8 (+- 5.5) LOS 96%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAdd evaluation tracing code
Marco Costalba [Sat, 26 Feb 2011 13:09:58 +0000 (14:09 +0100)]
Add evaluation tracing code

This patch is based on Justin Blanchard's original
work and allows to breakdown evaluation in its sub terms and
show to the user.

Tracing code has zero speed impact when not used.

Note that tracing code is not thread-safe, but this
should not be a problem given the typical usage scenario.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoCorrectly round evaluation to grain size
Marco Costalba [Mon, 21 Feb 2011 11:45:51 +0000 (12:45 +0100)]
Correctly round evaluation to grain size

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoDepth dependant singular extension margin
Marco Costalba [Thu, 17 Feb 2011 07:24:35 +0000 (08:24 +0100)]
Depth dependant singular extension margin

After 7965 games:
Mod vs Orig 1324 - 1249 - 5392  ELO +3 (+- 4.4) LOS 81%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove all enum types definitions to types.h
Marco Costalba [Wed, 23 Feb 2011 20:27:22 +0000 (21:27 +0100)]
Move all enum types definitions to types.h

Cleanup headers while there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire color.h
Marco Costalba [Wed, 23 Feb 2011 13:34:00 +0000 (14:34 +0100)]
Retire color.h

Move contents to piece.h and square.h

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename piece_of_color_and_type() to make_piece()
Marco Costalba [Wed, 23 Feb 2011 13:25:46 +0000 (14:25 +0100)]
Rename piece_of_color_and_type() to make_piece()

To be aligned with make_square()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire piece_type_from_char()
Marco Costalba [Wed, 23 Feb 2011 13:17:18 +0000 (14:17 +0100)]
Retire piece_type_from_char()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoTriviality in main.cpp
Marco Costalba [Wed, 23 Feb 2011 11:23:16 +0000 (12:23 +0100)]
Triviality in main.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire enum SquareDelta
Marco Costalba [Wed, 23 Feb 2011 09:03:30 +0000 (10:03 +0100)]
Retire enum SquareDelta

Use Square instead. At the end is the same because we were
anyway foreseen operators on mixed terms (Square, SquareDelta).

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSmall simplifications in square.h
Marco Costalba [Wed, 23 Feb 2011 08:43:47 +0000 (09:43 +0100)]
Small simplifications in square.h

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIntroduce and use speed_to_uci()
Marco Costalba [Sat, 19 Feb 2011 11:22:23 +0000 (12:22 +0100)]
Introduce and use speed_to_uci()

And retire nps()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename SplitPoint parentSstack
Marco Costalba [Fri, 18 Feb 2011 16:02:25 +0000 (17:02 +0100)]
Rename SplitPoint parentSstack

Now that we don't have anymore a search stack array in
SplitPoint we can rename this data member to somthing more
usual.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire SearchStack sstack[] from SplitPoint
Marco Costalba [Fri, 18 Feb 2011 14:44:02 +0000 (15:44 +0100)]
Retire SearchStack sstack[] from SplitPoint

Use a local variable instead. To make it work we need to
correctly init next ply search stack at the beginning of the
search because now that ss is allocated on the stack instead
of on the global storage it contains garbage.

As a side effect we can peform a fast search stack
init in id_loop().

With this patch size of SplitPoint goes from 71944 to 136 bytes,
and consequently size of Thread goes from 575568 to 1104 bytes.

Finally the size of ThreadsManager that contains all the thread
info goes from 9209248 to just 17824 bytes !!

No functional change also in faked split.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSync Root new depth to what we do in search()
Marco Costalba [Thu, 17 Feb 2011 07:55:56 +0000 (08:55 +0100)]
Sync Root new depth to what we do in search()

This allow us to restore the old depth 12 benchmark
and fixes one and for all the depth mess.

Test confirms no regression:
After 5658 games 892 - 924 - 3842  ELO -1 (+- 5.2)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUnify best move update logic
Marco Costalba [Thu, 17 Feb 2011 08:24:55 +0000 (09:24 +0100)]
Unify best move update logic

Try to rewrite the Root case using as most as common
code as possible.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoDo not special case reductions for MultiPV case
Marco Costalba [Thu, 17 Feb 2011 08:08:27 +0000 (09:08 +0100)]
Do not special case reductions for MultiPV case

Note that this introduces an asymmetry in which best move
is searched deeper then others also in MultiPV, but this is
not an error per se.

No functional change when MultiPV = 1

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAvoid permanent PV entries in TT
Marco Costalba [Wed, 16 Feb 2011 07:56:24 +0000 (08:56 +0100)]
Avoid permanent PV entries  in TT

This patch removes a condition that allows a PV entry to remain
in TT across games for an unlimited time.

Although this produces a nice ELO boost in the long term it
is an artifact that affects tests results bewteen version
with and without this feature.

So remove now and readd before to release because it actually
seems a strong feature.

As example a verification tournament against SF 2.0.1 starting around
+10 ELO after 4K games sligltly climbed to +21 ELO after 14K games !!!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoWrite the LogFile only at the end of an iteration
Marco Costalba [Sun, 13 Feb 2011 10:13:54 +0000 (11:13 +0100)]
Write the LogFile only at the end of an iteration

Skip writing fail high/low sequences. Note that we don't need
fail high/low markers anymore in pretty_pv().

No functional change but some do/undo move sequences.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSpell checking fixes in search.cpp
Marco Costalba [Sat, 12 Feb 2011 18:04:27 +0000 (19:04 +0100)]
Spell checking fixes in search.cpp

Reported by Eelco on open-chess.org

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename iteration in depth in id_loop()
Marco Costalba [Sat, 12 Feb 2011 17:40:16 +0000 (18:40 +0100)]
Rename iteration in depth in id_loop()

And retire the redundant one.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoStart to count iterations from 1
Marco Costalba [Sat, 12 Feb 2011 17:09:08 +0000 (18:09 +0100)]
Start to count iterations from 1

First search should be done at iteration = 1, not 2. So offset
the variable by one.

As a nice side effect now search correctly stops at PLY_MAX
included, not after searching (PLY_MAX - 1) as before.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix wrong reported depth
Marco Costalba [Sat, 12 Feb 2011 16:39:48 +0000 (17:39 +0100)]
Fix wrong reported depth

Interestingly this patch will make people complain search depth
is reduced against 2.0.1 ;-) but actually it is only an artifact.

Spotted by Joona.

No functional change apart from a different do / undo move
sequence due to teh fact that we don't call pv_info_to_uci()
anymore before entering id loop.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove sending of PV line to id_loop()
Marco Costalba [Fri, 11 Feb 2011 05:20:16 +0000 (06:20 +0100)]
Move sending of PV line to id_loop()

No functional change apart form move reordering because
pv_info_to_uci() performs a do / undo_move sequence.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMaximum aspiration delta of 24
Marco Costalba [Thu, 10 Feb 2011 20:09:20 +0000 (21:09 +0100)]
Maximum aspiration delta of 24

After 9080 games
1430 - 1342 - 6308  ELO +3 (+- 2.9)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMaximum aspiration delta of 64
Joona Kiiski [Sat, 5 Feb 2011 18:24:42 +0000 (20:24 +0200)]
Maximum aspiration delta of 64

After 9242 games
Mod vs Orig: 1483 - 1373 - 6386  ELO +4 (+- 2.9)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSimplify latest patches
Marco Costalba [Sun, 6 Feb 2011 11:36:59 +0000 (12:36 +0100)]
Simplify latest patches

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire some conditions from ok_to_use_TT_pv
Joona Kiiski [Wed, 2 Feb 2011 22:49:26 +0000 (00:49 +0200)]
Retire some conditions from ok_to_use_TT_pv

After 4844 games 768 - 747 - 3329  ELO +2

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse TT for pruning also in PV nodes
Marco Costalba [Mon, 31 Jan 2011 12:05:01 +0000 (13:05 +0100)]
Use TT for pruning also in PV nodes

Biggest advantage is be able to analize positions
without "loss of memory" when goind back/forth in
a position.

Patch has proven to fix analysys problems and is even
worths some elo points.

After 5811 games Mod- Orig:
1037 - 902 - 3872 +8 ELO  (+- 3.6) LOS 97%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSilence silly MSVC warning c4146
Marco Costalba [Sat, 29 Jan 2011 13:10:05 +0000 (14:10 +0100)]
Silence silly MSVC warning c4146

Warning C4146: unary minus operator applied to
unsigned type, result still unsigned.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove defined(IS_64BIT) in init_sliding_attacks()
Marco Costalba [Sat, 29 Jan 2011 12:59:23 +0000 (13:59 +0100)]
Remove defined(IS_64BIT) in init_sliding_attacks()

No functional change bith in 32 and 64 bits.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoDo not use <algorithm> in to_fen()
Marco Costalba [Sat, 29 Jan 2011 12:14:01 +0000 (13:14 +0100)]
Do not use <algorithm> in to_fen()

Seems there are some problems on HP-UX compiler.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire obsolete reentrancy check in pos.print()
Marco Costalba [Sat, 29 Jan 2011 11:11:00 +0000 (12:11 +0100)]
Retire obsolete reentrancy check in pos.print()

We dont' call MovePicker from print() anymore, so that
reentrancy check in now not needed.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire singleEvasion
Marco Costalba [Mon, 24 Jan 2011 07:42:22 +0000 (08:42 +0100)]
Retire singleEvasion

This let us get rid of number_of_evasions()

After 5487 games
Mod- Orig: 851 - 852 - 3784 +0 ELO  (+- 3.7)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAdd a MovePicker c'tor specialized for qsearch
Marco Costalba [Sun, 23 Jan 2011 21:59:05 +0000 (22:59 +0100)]
Add a MovePicker c'tor specialized for qsearch

This simple patch shows a speed increase of
more then 2% !

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIntroduce and use qsearch_scoring()
Marco Costalba [Sun, 23 Jan 2011 09:19:30 +0000 (10:19 +0100)]
Introduce and use qsearch_scoring()

Move qsearch scoring functionality out of RootMoveList
initialization. Will be needed by future patches.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire InitialDepth
Marco Costalba [Sun, 23 Jan 2011 09:52:51 +0000 (10:52 +0100)]
Retire InitialDepth

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoPass TT move instead of Rml[0].pv[0] to MovePicker
Marco Costalba [Sun, 23 Jan 2011 07:59:16 +0000 (08:59 +0100)]
Pass TT move instead of Rml[0].pv[0] to MovePicker

This is used for secondary scoring so it does not
changes the fact that Rml[0].pv[0] is always tried
as first anyhow.

It happens this is even a no functional change patch
becuase we reinsert PV in TT after a search so that
TT move is actually Rml[0].pv[0].

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoDifferent searchedMoves system
Joona Kiiski [Sun, 16 Jan 2011 23:29:44 +0000 (01:29 +0200)]
Different searchedMoves system

After 8751 games on russian cluster
Mod- Orig: 1426 - 1323 - 6002  ELO +4 (+- 2.9) LOS 86%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove special Root cases
Marco Costalba [Sun, 23 Jan 2011 07:36:12 +0000 (08:36 +0100)]
Remove special Root cases

So to better spot where the differences really
count. Also add some more additional cleanup.

Harmless functional change and no regression.

After 5780 games
Mod- Orig: 931 - 955 - 3894 ELO -1 (+- 3.6)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire init_ss_array()
Marco Costalba [Thu, 20 Jan 2011 08:05:52 +0000 (09:05 +0100)]
Retire init_ss_array()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSmall cleanup in init_sliding_attacks()
Marco Costalba [Wed, 19 Jan 2011 16:48:05 +0000 (17:48 +0100)]
Small cleanup in init_sliding_attacks()

No functional change both in 32 and 64 bits.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoNumbers formatting in bitboard.cpp
Marco Costalba [Wed, 19 Jan 2011 16:00:48 +0000 (17:00 +0100)]
Numbers formatting in bitboard.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse opposite_color_squares() instead of same_color_squares()
Marco Costalba [Wed, 19 Jan 2011 12:43:07 +0000 (13:43 +0100)]
Use opposite_color_squares() instead of same_color_squares()

It is almost alwasy the requested test and is a bit faster too.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire RelativeRankBB[]
Marco Costalba [Wed, 19 Jan 2011 11:20:06 +0000 (12:20 +0100)]
Retire RelativeRankBB[]

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire some unused functions in bitboard.h
Marco Costalba [Wed, 19 Jan 2011 09:53:47 +0000 (10:53 +0100)]
Retire some unused functions in bitboard.h

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix some warnings under icc
Marco Costalba [Tue, 18 Jan 2011 17:35:20 +0000 (18:35 +0100)]
Fix some warnings under icc

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSort root moves moves in MovePickerExt
Marco Costalba [Tue, 18 Jan 2011 08:18:34 +0000 (09:18 +0100)]
Sort root moves moves in MovePickerExt

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix a (bestValue == -VALUE_INFINITE) assert
Marco Costalba [Tue, 18 Jan 2011 06:34:36 +0000 (07:34 +0100)]
Fix a (bestValue == -VALUE_INFINITE) assert

In case of a Root node we can leave with bestValue set
to -VALUE_INFINITE if search is stopped by the GUI and
stopReques flag is raised.

This patch fixes the issue.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAdditional cleanup in id_loop()
Marco Costalba [Mon, 17 Jan 2011 18:02:50 +0000 (19:02 +0100)]
Additional cleanup in id_loop()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse a global RootMoveList object instead of a pointer
Marco Costalba [Mon, 17 Jan 2011 17:41:26 +0000 (18:41 +0100)]
Use a global RootMoveList object instead of a pointer

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>