1
0
Fork 0
Commit Graph

5384 Commits (riscv64-cartesi)

Author SHA1 Message Date
Marco Costalba 4c5eaeb363 Disable a stupid and noisy MSVC warning
Remove the crap from compiler messages.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:27:09 +02:00
Marco Costalba 925f97f4e7 Teach Benchmark to read positions from a file
This comes handy to test the engine on different
sets of positions, not only the 15 default ones.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:27:08 +02:00
Marco Costalba f1e245850f Reformat benchmark interface
Prepare to following patches, still no functional
change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:26:39 +02:00
Marco Costalba 2f5012a3eb Fix another conversion warning: Bitboard->int
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:26:31 +02:00
Marco Costalba 94929c36bd Document where we want a uint16_t instead of a uint64_t
This patch removes some conversion warnings and
better describe where we are going to expect a
small integer.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:26:24 +02:00
Marco Costalba a0aa8e760a Use size_t instead of int
Remove some warning.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:26:18 +02:00
Marco Costalba 52487c4f04 MovePicker: simplify move swapping
We don't need a full swap here because once found
and returned the best move will not be used again.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:26:10 +02:00
Marco Costalba 5080e72ea5 Prefer strncpy() to strcpy()
This removes a warning under MSVC++

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:25:55 +02:00
Marco Costalba 295352d04a Fix: "Ponder" option has type bool not int
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-18 12:25:22 +02:00
Marco Costalba 421fd9c3bf Space inflate sp_search_pv
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-09 11:37:27 +02:00
Marco Costalba eacb42092b Space inflate sp_search
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-09 11:15:58 +02:00
Marco Costalba a10c9632a5 Use TT in qsearch
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-09 07:37:46 +02:00
Marco Costalba bc4e937f05 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>
2008-09-07 09:38:19 +02:00
Marco Costalba 6c592955e1 Space inflate qsearch
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-07 08:31:30 +02:00
Marco Costalba d517080ab6 Space inflate search()
Same as previous patch but for search() function.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-06 18:25:58 +02:00
Marco Costalba b7781e8faa 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>
2008-09-06 17:12:39 +02:00
Marco Costalba a230dc1404 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>
2008-09-06 15:53:43 +02:00
Marco Costalba c2c0ba875f 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>
2008-09-06 12:30:07 +02:00
Marco Costalba 61f41a057d 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>
2008-09-06 12:22:10 +02:00
Marco Costalba d786822b92 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>
2008-09-06 12:21:08 +02:00
Marco Costalba 392360e73b 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>
2008-09-06 12:20:28 +02:00
Marco Costalba 7c93b171cb TranspositionTable: spaces inflate
No functional change, just a tidy up in
preparation for next patches.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-06 12:19:29 +02:00
Marco Costalba dad9a1eca7 RootMoveList: inline trivial accessors
Although not performance critical, trivial
accessors can be inlined without any harm.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-06 06:37:00 +02:00
Marco Costalba 731a9f3806 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>
2008-09-05 09:04:45 +02:00
Marco Costalba bd3fd6501b 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>
2008-09-03 23:33:49 +02:00
Marco Costalba 9ec12da028 Better document RootMoveList c'tor
Also some code tidy-up.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-03 23:29:04 +02:00
Marco Costalba 973eb543a4 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>
2008-09-01 22:05:23 +02:00
Marco Costalba e5068c4734 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>
2008-09-01 16:58:02 +02:00
Marco Costalba 35010b4938 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>
2008-09-01 16:03:01 +02:00
Marco Costalba 6c64f68ccf 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>
2008-09-01 14:05:02 +02:00
Marco Costalba 6ef44d4c4e 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>
2008-09-01 08:16:17 +02:00
Marco Costalba d22aeb1cc0 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>
2008-09-01 08:06:34 +02:00
Marco Costalba b8e487ff9c 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>
2008-09-01 08:03:21 +02:00
Marco Costalba bb751d6c89 Initial import of Glaurung 2.1 2008-09-01 07:59:13 +02:00