stockfish
11 years agoCorrectly handle castle in see()
Marco Costalba [Fri, 20 May 2011 05:57:20 +0000 (06:57 +0100)]
Correctly handle castle in see()

Suggested by Onno.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix brekage from previous patches
Marco Costalba [Wed, 18 May 2011 05:46:08 +0000 (06:46 +0100)]
Fix brekage from previous patches

It is interesting the fact that we need to test for
move_is_castle(m) anyway and not relying on testing
if destination square is attacked. Indeed the latter
condition fails if the castling rook is attacked,
castling is coded as "king captures the rook" but it
is legal in that case.

Verified no functional change with beginning of the series.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMicro-optimize pl_move_is_legal()
Marco Costalba [Tue, 17 May 2011 22:44:55 +0000 (23:44 +0100)]
Micro-optimize pl_move_is_legal()

Remove the check for castling moves because it is
already implicit in the check for king moves and castling
is so rare that doing the check is just a slow down.

Thanks to Marek Kwiatkowski.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire move_is_capture_or_promotion()
Marco Costalba [Tue, 17 May 2011 22:39:14 +0000 (23:39 +0100)]
Retire move_is_capture_or_promotion()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix move_is_capture() definition
Marco Costalba [Tue, 17 May 2011 22:31:40 +0000 (23:31 +0100)]
Fix move_is_capture() definition

The structure of move is changed so should also the two
functions. It happens that it works by accident !

Bug spotted by Marek Kwiatkowski

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire test for king moves in see()
Marco Costalba [Tue, 17 May 2011 10:24:06 +0000 (12:24 +0200)]
Retire test for king moves in see()

We already test this condition in see_sign() and
so it is almost always a redundant verification.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire Position::see(Square from, Square to) overload
Marco Costalba [Tue, 17 May 2011 10:09:45 +0000 (12:09 +0200)]
Retire Position::see(Square from, Square to) overload

Alomst unuseful.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoPrefer an assert to a comment in position.h
Marco Costalba [Tue, 17 May 2011 09:47:52 +0000 (11:47 +0200)]
Prefer an assert to a comment in position.h

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoLet 'make' with no arguments to show compilation options
Marco Costalba [Tue, 17 May 2011 07:09:26 +0000 (09:09 +0200)]
Let 'make' with no arguments to show compilation options

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoPrefer ttMove to tte->move() in search()
Marco Costalba [Mon, 16 May 2011 08:59:51 +0000 (10:59 +0200)]
Prefer ttMove to tte->move() in search()

Avoids aliasing problems due to TT overwrites.

Node changes becuase of IID.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse standard naming conventions in book.cpp
Marco Costalba [Sun, 8 May 2011 09:40:30 +0000 (10:40 +0100)]
Use standard naming conventions in book.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoReintroduce operator>>() in Book class
Marco Costalba [Sun, 8 May 2011 08:12:28 +0000 (09:12 +0100)]
Reintroduce operator>>() in Book class

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRestore development version
Marco Costalba [Sun, 8 May 2011 08:01:41 +0000 (09:01 +0100)]
Restore development version

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoStockfish 2.1.1
Marco Costalba [Sun, 8 May 2011 07:46:33 +0000 (08:46 +0100)]
Stockfish 2.1.1

stockfish bench signature is: 6487630

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSpell fix in evaluate.cpp
Marco Costalba [Sat, 7 May 2011 09:08:53 +0000 (10:08 +0100)]
Spell fix in evaluate.cpp

Spotted by Eelco.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix reading of book file
Marco Costalba [Sat, 7 May 2011 08:03:59 +0000 (09:03 +0100)]
Fix reading of book file

Bug is subtle because appears only under MSVC 32 bits in
optimized version, hence was missed before.

Bug is due to the fact that evaluation order of terms of a
sum is undefined by the standard, so in get_int() we have:

return 256 * get_int<n-1>() + bookFile.get();

And if get() is evaluated before get_int() we have a corrupted
key.

The patch rewrites the code in a more natural and predictable way.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove redundant assignment in search()
Marco Costalba [Thu, 5 May 2011 09:55:28 +0000 (11:55 +0200)]
Remove redundant assignment in search()

It is already assigned few lines before.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRestore development version
Marco Costalba [Thu, 5 May 2011 05:35:42 +0000 (06:35 +0100)]
Restore development version

No functional change.

11 years agoFix a warning in debug mode
Marco Costalba [Tue, 3 May 2011 18:29:21 +0000 (19:29 +0100)]
Fix a warning in debug mode

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoStockfish 2.1
Marco Costalba [Tue, 3 May 2011 08:00:10 +0000 (10:00 +0200)]
Stockfish 2.1

stockfish bench signature is: 6487630

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoReintroduce permanent PV entries in TT
Marco Costalba [Tue, 3 May 2011 07:54:22 +0000 (09:54 +0200)]
Reintroduce permanent PV entries in TT

We are now ready to release so restore this
improvment before 2.1

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUpdate Readme.txt to 32 threads and bsfq on Windows
Marco Costalba [Tue, 3 May 2011 07:24:51 +0000 (09:24 +0200)]
Update Readme.txt to 32 threads and bsfq on Windows

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix bug in evaluate_passed_pawns()
Marco Costalba [Sat, 30 Apr 2011 12:02:56 +0000 (13:02 +0100)]
Fix bug in evaluate_passed_pawns()

If blockSq is already on rank 8, blockSq + pawn_push(Us) is on rank 9,
outside of board. It does not make sense to measure king distance to
a field outside the board.

Bug spotted by Fruity:
http://open-chess.org/viewtopic.php?f=5&t=1156&start=10

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire "Pawn Structure" UCI option
Marco Costalba [Mon, 2 May 2011 12:15:06 +0000 (14:15 +0200)]
Retire "Pawn Structure" UCI option

Almost useless for the user and now is in sync with
the material value that is already weighted.

A small speedup of 0,4% because we avoid an apply_weight()
call in a fast path.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename stuff in evaluate.cpp
Marco Costalba [Mon, 2 May 2011 07:43:16 +0000 (09:43 +0200)]
Rename stuff in evaluate.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoAdditional tweaks in evaluate_unstoppable_pawns()
Marco Costalba [Sun, 1 May 2011 10:00:19 +0000 (11:00 +0100)]
Additional tweaks in evaluate_unstoppable_pawns()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove redundancy in evaluate_unstoppable_pawns()
Marco Costalba [Sun, 1 May 2011 09:31:27 +0000 (10:31 +0100)]
Remove redundancy in evaluate_unstoppable_pawns()

Spotted by Fruity
http://open-chess.org/viewtopic.php?f=5&t=1156&start=20

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSmall reformat in evaluate_unstoppable_pawns()
Marco Costalba [Sun, 1 May 2011 06:11:58 +0000 (07:11 +0100)]
Small reformat in evaluate_unstoppable_pawns()

Also simplify tracing because evaluate_unstoppable_pawns()
return always zero if both colors have non pawn material.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUpdate polyglot.ini
Marco Costalba [Sun, 1 May 2011 06:49:40 +0000 (07:49 +0100)]
Update polyglot.ini

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename check related functions
Marco Costalba [Fri, 29 Apr 2011 14:26:48 +0000 (16:26 +0200)]
Rename check related functions

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSmall renaming in thread.cpp
Marco Costalba [Fri, 29 Apr 2011 08:07:23 +0000 (10:07 +0200)]
Small renaming in thread.cpp

To better self document the code.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename Option in UCIOPtion
Marco Costalba [Fri, 29 Apr 2011 07:18:54 +0000 (09:18 +0200)]
Rename Option in UCIOPtion

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoLimit history range to +-2000
Marco Costalba [Thu, 28 Apr 2011 07:00:10 +0000 (08:00 +0100)]
Limit history range to +-2000

Extensive test series on tweaking history limit and bonus
formula. At the end this was the best.

After 11959 games:

Mod vs Orig 2087 - 1934 - 7938 ELO +4 (+- 3.7) LOS 92%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoPerft counts leaf nodes not generated moves.
Marco Costalba [Wed, 27 Apr 2011 22:20:42 +0000 (23:20 +0100)]
Perft counts leaf nodes not generated moves.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse probe() as name for looking up into an hash table
Marco Costalba [Tue, 26 Apr 2011 12:10:02 +0000 (14:10 +0200)]
Use probe() as name for looking up into an hash table

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoTidy up uci.cpp and siblings
Marco Costalba [Tue, 26 Apr 2011 09:19:57 +0000 (11:19 +0200)]
Tidy up uci.cpp and siblings

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove OpeningBook and RK where are actually used
Marco Costalba [Tue, 26 Apr 2011 07:02:12 +0000 (09:02 +0200)]
Move OpeningBook and RK where are actually used

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix a compile error with gcc
Marco Costalba [Mon, 25 Apr 2011 21:59:56 +0000 (22:59 +0100)]
Fix a compile error with gcc

It seems gcc does not like an extra semicolon.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove MovePickerExt specializations away from headings
Marco Costalba [Mon, 25 Apr 2011 12:14:23 +0000 (13:14 +0100)]
Move MovePickerExt specializations away from headings

This unclutters a bit the heading part of search.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoTidy up benchmark.cpp
Marco Costalba [Mon, 25 Apr 2011 09:46:52 +0000 (10:46 +0100)]
Tidy up benchmark.cpp

Node count is different just becuase now we don't log on
"bench.txt" file anymore so that we avoid some calls to
pretty_pv() that calls Position::do_move().

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoLarge API rename in ThreadsManager
Marco Costalba [Sun, 24 Apr 2011 23:22:48 +0000 (00:22 +0100)]
Large API rename in ThreadsManager

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoDon't allocate MAX_THREADS hash tables if not necessary
Marco Costalba [Sun, 24 Apr 2011 17:46:26 +0000 (18:46 +0100)]
Don't allocate MAX_THREADS hash tables if not necessary

This prevent crashing on mobile devices with limited RAM,
currently with MAX_THREADS = 32 we would need 44MB that
could be too much for a poor cellphone.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove pawn and material tables under Thread class
Marco Costalba [Sun, 24 Apr 2011 08:20:03 +0000 (09:20 +0100)]
Move pawn and material tables under Thread class

This change allows to remove some quite a bit of code
and seems the natural thing to do.

Introduced file thread.cpp to move away from search.cpp a lot
of threads related stuff.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRename MOVES_MAX in MAX_MOVES
Marco Costalba [Sun, 24 Apr 2011 07:54:36 +0000 (08:54 +0100)]
Rename MOVES_MAX in MAX_MOVES

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire extensions as UCI option
Marco Costalba [Sun, 24 Apr 2011 07:31:47 +0000 (08:31 +0100)]
Retire extensions as UCI option

There is no real need why an user should change these values.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoDocument why we use per-thread pawn and material tables
Marco Costalba [Sun, 24 Apr 2011 07:18:39 +0000 (08:18 +0100)]
Document why we use per-thread pawn and material tables

Arisen from a discussion on talkchess.

No fnctional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix some comments in early stop detection
Marco Costalba [Sat, 23 Apr 2011 14:42:23 +0000 (15:42 +0100)]
Fix some comments in early stop detection

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire UseLogFile in search.cpp
Marco Costalba [Sat, 23 Apr 2011 13:57:05 +0000 (14:57 +0100)]
Retire UseLogFile in search.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIntroduce and use SearchLimits
Marco Costalba [Fri, 22 Apr 2011 13:52:03 +0000 (15:52 +0200)]
Introduce and use SearchLimits

Pack a bit of global variables related to search limits in
a single struct.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse move_is_special() in pawn endgame condition
Marco Costalba [Fri, 22 Apr 2011 10:02:54 +0000 (12:02 +0200)]
Use move_is_special() in pawn endgame condition

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRetire SearchStartTime global
Marco Costalba [Fri, 22 Apr 2011 09:57:22 +0000 (11:57 +0200)]
Retire SearchStartTime global

Use a static variable inside current_search_time() instead.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoReduce loops in init_threads() and exit_threads()
Marco Costalba [Fri, 22 Apr 2011 07:55:47 +0000 (09:55 +0200)]
Reduce loops in init_threads() and exit_threads()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove wake_sleeping_thread() to Thread class
Marco Costalba [Wed, 20 Apr 2011 09:18:36 +0000 (11:18 +0200)]
Move wake_sleeping_thread() to Thread class

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoCorrectly implementg selDepth feature
Marco Costalba [Tue, 19 Apr 2011 08:24:43 +0000 (10:24 +0200)]
Correctly implementg selDepth feature

Send to GUI the deepest search depth apart from
qsearch of the PV line.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove sleepLock and sleepCond under Thread
Marco Costalba [Tue, 19 Apr 2011 07:56:59 +0000 (09:56 +0200)]
Move sleepLock and sleepCond under Thread

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoIncrease risk of blunders at low skill levels
Marco Costalba [Tue, 19 Apr 2011 07:29:28 +0000 (09:29 +0200)]
Increase risk of blunders at low skill levels

According to Heinz's tests current setup is in fact too
strong for weak players. This seems the best according
to his tests.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoUse only history to score non captures
Marco Costalba [Sat, 16 Apr 2011 09:25:22 +0000 (10:25 +0100)]
Use only history to score non captures

It seems gain is practically unuseful, so remove.

After 13554 games:
Mod vs Orig 2252 - 2319 - 8983 ELO -1 (+- 3.4)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoSmall simplification in scale_by_game_phase()
Marco Costalba [Sun, 17 Apr 2011 09:31:26 +0000 (10:31 +0100)]
Small simplification in scale_by_game_phase()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoMove ply to SearchStack
Marco Costalba [Sat, 16 Apr 2011 13:41:53 +0000 (14:41 +0100)]
Move ply to SearchStack

Shrink search() signature for better readibility.

We get also a nice 1.3% speed increase.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoRemove one indentation level in get_next_move()
Marco Costalba [Sat, 16 Apr 2011 10:24:30 +0000 (11:24 +0100)]
Remove one indentation level in get_next_move()

Small renaming and fix some comments.

No functional and no speed change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoCode style in tt.cpp
Marco Costalba [Fri, 15 Apr 2011 16:14:12 +0000 (18:14 +0200)]
Code style in tt.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoBetter self-document LMR reduction() formula
Marco Costalba [Fri, 15 Apr 2011 15:41:45 +0000 (17:41 +0200)]
Better self-document LMR reduction() formula

Suggested by Onno

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoPromote OptionsMap to a class
Marco Costalba [Thu, 14 Apr 2011 13:59:49 +0000 (15:59 +0200)]
Promote OptionsMap to a class

And add a bit of documentation too.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
11 years agoFix a stale comment
Marco Costalba [Sat, 16 Apr 2011 09:21:13 +0000 (10:21 +0100)]
Fix a stale comment

Spotted by Onno

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
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>