]> git.sesse.net Git - stockfish/log
stockfish
15 years agoSpace inflate sp_search
Marco Costalba [Tue, 9 Sep 2008 09:15:58 +0000 (11:15 +0200)]
Space inflate sp_search

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUse TT in qsearch
Marco Costalba [Tue, 9 Sep 2008 05:37:46 +0000 (07:37 +0200)]
Use TT in qsearch

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agosearch: fix a bug and clear history update
Marco Costalba [Sun, 7 Sep 2008 07:38:19 +0000 (09:38 +0200)]
search: fix a bug and clear history update

When a move produces a beta-cut off is marked as
success in history and all the remaining ones are
marked as failures.

The loop across the searched moves, that is used
to register failures, does not skip the good one,
that is then registered as a failure too.

The patch fixes the bug and cleanup the code.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate qsearch
Marco Costalba [Sun, 7 Sep 2008 06:31:30 +0000 (08:31 +0200)]
Space inflate qsearch

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate search()
Marco Costalba [Sat, 6 Sep 2008 16:25:58 +0000 (18:25 +0200)]
Space inflate search()

Same as previous patch but for search() function.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agosearch_pv: spaces inflate
Marco Costalba [Sat, 6 Sep 2008 15:12:39 +0000 (17:12 +0200)]
search_pv: spaces inflate

It seems easier to understand, at least to me.

Hopefully no functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSplit transposition table lookup in a separate function
Marco Costalba [Sat, 6 Sep 2008 13:53:43 +0000 (15:53 +0200)]
Split transposition table lookup in a separate function

This slims down the code and is a prerequisite for
future patches.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTranspositionTable: add first_entry() helper
Marco Costalba [Sat, 6 Sep 2008 10:30:07 +0000 (12:30 +0200)]
TranspositionTable: add first_entry() helper

An inline function to retrieve the first TT entry
given a position.

Plus usual whitespace noise.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd simple debug hit rate counter
Marco Costalba [Sat, 6 Sep 2008 10:22:10 +0000 (12:22 +0200)]
Add simple debug hit rate counter

Add a very simple debug framework to
measure the hit rate of a given condition.

Simply insert macro

dbg_hit_on(x);

Anywhere you want to compute hit rate of condition x
and then call, as example in poll(), function
dbg_print_hit_rate() to print current results.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTranspositionTable: micro optimize first cycle
Marco Costalba [Sat, 6 Sep 2008 10:21:08 +0000 (12:21 +0200)]
TranspositionTable: micro optimize first cycle

In the common case (>95%) tte == replace so skip
additional comparisons in this case.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTranspositionTable: early skip on an empty TT entry
Marco Costalba [Sat, 6 Sep 2008 10:20:28 +0000 (12:20 +0200)]
TranspositionTable: early skip on an empty TT entry

Instead of going for the whole 4 cycle loop early
skip if TT entry is empty.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTranspositionTable: spaces inflate
Marco Costalba [Sat, 6 Sep 2008 10:19:29 +0000 (12:19 +0200)]
TranspositionTable: spaces inflate

No functional change, just a tidy up in
preparation for next patches.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRootMoveList: inline trivial accessors
Marco Costalba [Sat, 6 Sep 2008 04:37:00 +0000 (06:37 +0200)]
RootMoveList: inline trivial accessors

Although not performance critical, trivial
accessors can be inlined without any harm.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRootMoveList sorting: be compatible with std::sort
Marco Costalba [Fri, 5 Sep 2008 07:04:45 +0000 (09:04 +0200)]
RootMoveList sorting: be compatible with std::sort

sort() and sort_multipv() are almost the same, so
use only one implementation.

Also introduce the natural RootMove::operator<() to
compare the moves instead of compare_root_moves(),
this will allow to use std::sort instead of our
home grown bubble-sort.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoscan_for_easy_move: we don't need a loop here
Marco Costalba [Wed, 3 Sep 2008 21:33:49 +0000 (23:33 +0200)]
scan_for_easy_move: we don't need a loop here

Moves are already sorted, so just consider the best
and the second one.

Some trailing whitespace remove noise crept in due
to my editor removes it before to save.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoBetter document RootMoveList c'tor
Marco Costalba [Wed, 3 Sep 2008 21:29:04 +0000 (23:29 +0200)]
Better document RootMoveList c'tor

Also some code tidy-up.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFix a couple of bugs (fallout from previous patches)
Marco Costalba [Mon, 1 Sep 2008 20:05:23 +0000 (22:05 +0200)]
Fix a couple of bugs (fallout from previous patches)

After testing and comparing output with standard Glaurung
a couple of issues arised.

A default value was wrong and init_uci_options() missed a couple
of stringify() calls. Also storing bool values as "false" and "true"
needs some care.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoucioptions: Fix stringification of a bool
Marco Costalba [Mon, 1 Sep 2008 14:58:02 +0000 (16:58 +0200)]
ucioptions: Fix stringification of a bool

We want stringify a bool as "true" and "false",
not "1" and "0".

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoPreserve options order when printed
Marco Costalba [Mon, 1 Sep 2008 14:03:01 +0000 (16:03 +0200)]
Preserve options order when printed

Use a vector instead of a map so that options
are printed according to their original order.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRewrite ucioptions.cpp to use C++
Marco Costalba [Mon, 1 Sep 2008 12:05:02 +0000 (14:05 +0200)]
Rewrite ucioptions.cpp to use C++

Instead of old-style C string functions use standard
library to greatly streamline the implementation.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFinally remove UCIInputParser class altogether
Marco Costalba [Mon, 1 Sep 2008 06:16:17 +0000 (08:16 +0200)]
Finally remove UCIInputParser class altogether

Class UCIInputParser is now a typedef of a std::istringstream,
this greatly simplifies the code, especially the many conversions
from string to integer are now handled automatically by the
stream instead of relying on a chunk of C-style atoi() calls.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUse a string stream in UCIInputParser
Marco Costalba [Mon, 1 Sep 2008 06:06:34 +0000 (08:06 +0200)]
Use a string stream in UCIInputParser

Use a std::istringstream instead of an home
grown string tokenizer code.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAvoid casts to handle isspace() arguments
Marco Costalba [Mon, 1 Sep 2008 06:03:21 +0000 (08:03 +0200)]
Avoid casts to handle isspace() arguments

Use proper standard conversion to deal
with negative values of a char.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoInitial import of Glaurung 2.1
Marco Costalba [Mon, 1 Sep 2008 05:59:13 +0000 (07:59 +0200)]
Initial import of Glaurung 2.1