]> git.sesse.net Git - stockfish/log
stockfish
15 years agoPosition::is_ok()give more info on failed test
Marco Costalba [Sun, 19 Oct 2008 09:41:24 +0000 (10:41 +0100)]
Position::is_ok()give more info on failed test

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFix an assert due to a missing parentesis
Marco Costalba [Sun, 19 Oct 2008 09:17:17 +0000 (10:17 +0100)]
Fix an assert due to a missing parentesis

Bitwise operators precedence issue here, was
causing an assert.

This is a fallout from recent patches.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFinal semplification of generate_evasions()
Marco Costalba [Sun, 19 Oct 2008 08:33:33 +0000 (09:33 +0100)]
Final semplification of generate_evasions()

Now it's readable!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoIntroduce generate_piece_blocking_evasions()
Marco Costalba [Sun, 19 Oct 2008 07:49:26 +0000 (08:49 +0100)]
Introduce generate_piece_blocking_evasions()

Start to simplify generate_evasions

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate generate_evasions()
Marco Costalba [Sun, 19 Oct 2008 07:27:24 +0000 (08:27 +0100)]
Space inflate generate_evasions()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUpdate copyright info
Marco Costalba [Sun, 19 Oct 2008 16:56:28 +0000 (18:56 +0200)]
Update copyright info

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoLast little touches to movegen
Marco Costalba [Sun, 19 Oct 2008 16:19:16 +0000 (18:19 +0200)]
Last little touches to movegen

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRename PawnOffsets in PawnParams
Marco Costalba [Sun, 19 Oct 2008 16:01:01 +0000 (18:01 +0200)]
Rename PawnOffsets in PawnParams

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoPawn move generator: dispatch at compile time
Marco Costalba [Sun, 19 Oct 2008 15:54:18 +0000 (17:54 +0200)]
Pawn move generator: dispatch at compile time

Instead of function pointers use templates to
dispatch shift operations.

It is more clear and possibly also faster because
branches are removed at compile time.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoStart to templetize pawn move generators
Marco Costalba [Sun, 19 Oct 2008 15:20:21 +0000 (16:20 +0100)]
Start to templetize pawn move generators

Still very soft, we will see if compiler is
enough or we need more aggressive templetization.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRemove Positions::xxx_count() functions
Marco Costalba [Sun, 19 Oct 2008 13:39:29 +0000 (14:39 +0100)]
Remove Positions::xxx_count() functions

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRemove white/black_pawn_attacks_square()
Marco Costalba [Sun, 19 Oct 2008 13:06:06 +0000 (14:06 +0100)]
Remove white/black_pawn_attacks_square()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTempletize Position::xxx_attacks_square()
Marco Costalba [Sun, 19 Oct 2008 12:56:57 +0000 (13:56 +0100)]
Templetize Position::xxx_attacks_square()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRemove Position::xxx_list() functions
Marco Costalba [Sun, 19 Oct 2008 12:44:25 +0000 (13:44 +0100)]
Remove Position::xxx_list() functions

No useful, only obfuscating.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd a generate_piece_checks() specialization for the king
Marco Costalba [Sun, 19 Oct 2008 12:22:03 +0000 (13:22 +0100)]
Add a generate_piece_checks() specialization for the king

Also reshuffle the code a bit.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRemove white/black_pawn_attacks()
Marco Costalba [Sun, 19 Oct 2008 11:53:51 +0000 (12:53 +0100)]
Remove white/black_pawn_attacks()

Unuseful syntactic sugar, obfuscates the
real code.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoPrefer template to name decoration
Marco Costalba [Sun, 19 Oct 2008 11:43:09 +0000 (12:43 +0100)]
Prefer template to name decoration

This also allows faster code although bigger.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFix a missing comma in BenchmarkPositions[]
Marco Costalba [Sun, 19 Oct 2008 10:55:53 +0000 (11:55 +0100)]
Fix a missing comma in BenchmarkPositions[]

An old bug introduced in 3e0dc9ee8477 almost
one month ago.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoPosition::is_ok()give more info on failed test
Marco Costalba [Sun, 19 Oct 2008 09:41:24 +0000 (10:41 +0100)]
Position::is_ok()give more info on failed test

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFix an assert due to a missing parentesis
Marco Costalba [Sun, 19 Oct 2008 09:17:17 +0000 (10:17 +0100)]
Fix an assert due to a missing parentesis

Bitwise operators precedence issue here, was
causing an assert.

This is a fallout from recent patches.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFinal semplification of generate_evasions()
Marco Costalba [Sun, 19 Oct 2008 08:33:33 +0000 (09:33 +0100)]
Final semplification of generate_evasions()

Now it's readable!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoIntroduce generate_piece_blocking_evasions()
Marco Costalba [Sun, 19 Oct 2008 07:49:26 +0000 (08:49 +0100)]
Introduce generate_piece_blocking_evasions()

Start to simplify generate_evasions

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate generate_evasions()
Marco Costalba [Sun, 19 Oct 2008 07:27:24 +0000 (08:27 +0100)]
Space inflate generate_evasions()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agomovegen: Introduce generate_pawn_noncaptures()
Marco Costalba [Sat, 18 Oct 2008 16:39:13 +0000 (18:39 +0200)]
movegen: Introduce generate_pawn_noncaptures()

This is the last of pawn moves generators converted
to new unified form.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agomovegen: Introduce generate_pawn_captures()
Marco Costalba [Sat, 18 Oct 2008 15:37:49 +0000 (17:37 +0200)]
movegen: Introduce generate_pawn_captures()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agomovegen: Fix just introduced move counter bug
Marco Costalba [Sat, 18 Oct 2008 14:30:00 +0000 (16:30 +0200)]
movegen: Fix just introduced move counter bug

This is what happens when you don't tests your patches !!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agomovegen: Introduce generate_pawn_checks()
Marco Costalba [Sat, 18 Oct 2008 13:36:58 +0000 (15:36 +0200)]
movegen: Introduce generate_pawn_checks()

This greatly simplify redundant code.

Perhaps slihtly slower. Test needed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agogenerate_checks: fix a bug in black double pawn push
Marco Costalba [Sat, 18 Oct 2008 11:58:07 +0000 (13:58 +0200)]
generate_checks: fix a bug in black double pawn push

It was written pos.black_pawn_attacks(ksq) instead of
pos.white_pawn_attacks(ksq)

Updated to the undrlying pos.pawn_attacks(WHITE, ksq)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate generate_castle_moves()
Marco Costalba [Sat, 18 Oct 2008 09:07:27 +0000 (11:07 +0200)]
Space inflate generate_castle_moves()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUnify pieces check generation with generate_piece_checks()
Marco Costalba [Sat, 18 Oct 2008 08:57:27 +0000 (10:57 +0200)]
Unify pieces check generation with generate_piece_checks()

Could be slower: test needed!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoDo not special case generate_king_moves()
Marco Costalba [Sat, 18 Oct 2008 07:49:51 +0000 (09:49 +0200)]
Do not special case generate_king_moves()

Teoretically a little slowdown. If after testing we
verify the slowdown has impact on ELO we revert the
change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUse a const pointer-to-member array for attacks
Marco Costalba [Sat, 18 Oct 2008 06:54:18 +0000 (08:54 +0200)]
Use a const pointer-to-member array for attacks

Allow the compiler to optimize member
function access.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUse pointer-to-members to remove a bunch of duplicated code
Marco Costalba [Fri, 17 Oct 2008 21:30:34 +0000 (23:30 +0200)]
Use pointer-to-members to remove a bunch of duplicated code

Remove all generate_XXX_moves() functions, use an array
of pointer to members instead.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agomovegen: revert see ordering in score_captures()
Marco Costalba [Fri, 17 Oct 2008 20:54:23 +0000 (22:54 +0200)]
movegen: revert see ordering in score_captures()

It works better with MVV ordering.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoMovegen: further simplify generate_move_if_legal
Marco Costalba [Fri, 17 Oct 2008 20:52:36 +0000 (22:52 +0200)]
Movegen: further simplify generate_move_if_legal

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUnify black and white code in generate_move_if_legal()
Marco Costalba [Fri, 17 Oct 2008 13:38:00 +0000 (15:38 +0200)]
Unify black and white code in generate_move_if_legal()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate movegen.cpp
Marco Costalba [Fri, 17 Oct 2008 13:11:19 +0000 (15:11 +0200)]
Space inflate movegen.cpp

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoMovepick: add and use find_best_index() helper
Marco Costalba [Fri, 17 Oct 2008 06:25:39 +0000 (08:25 +0200)]
Movepick: add and use find_best_index() helper

This removes a bunch of redundant code.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTest with see
Marco Costalba [Fri, 17 Oct 2008 05:58:36 +0000 (07:58 +0200)]
Test with see

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUse MVV to score captures when see >=0
Marco Costalba [Fri, 17 Oct 2008 04:14:21 +0000 (06:14 +0200)]
Use MVV to score captures when see >=0

This fix a couple of dubious bugs in MVV/LVA
ordering.

Tests seems to confirm now is slightly better.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoMovePicker: use const reference instead of pointers
Marco Costalba [Thu, 16 Oct 2008 14:21:36 +0000 (16:21 +0200)]
MovePicker: use const reference instead of pointers

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate movepick.cpp
Marco Costalba [Thu, 16 Oct 2008 12:25:56 +0000 (14:25 +0200)]
Space inflate movepick.cpp

Also added some FIXME to dubious points.

Still no functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoBetter comment previous patch
Marco Costalba [Thu, 16 Oct 2008 10:53:25 +0000 (12:53 +0200)]
Better comment previous patch

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAlways add psqt scoring
Marco Costalba [Wed, 15 Oct 2008 18:45:29 +0000 (20:45 +0200)]
Always add psqt scoring

When there is also history, history is always
preferred.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoShortcut sorting when no move is in history
Marco Costalba [Wed, 15 Oct 2008 18:39:09 +0000 (20:39 +0200)]
Shortcut sorting when no move is in history

An alternative algorithm to psqt scoring.

Still unclear what is the best, more tests needed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd psqt ordering when there is no history
Marco Costalba [Wed, 15 Oct 2008 06:18:05 +0000 (07:18 +0100)]
Add psqt ordering when there is no history

This seems to increase strenght (about 15 ELO),
still to test some variations on this theme that
could increase ELO even more.

Idea from Rebel (http://members.home.nl/matador/chess840.htm)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoIntroduce Stockfish
unknown [Mon, 13 Oct 2008 21:45:47 +0000 (22:45 +0100)]
Introduce Stockfish

Signed-off-by: unknown <Marco@.(none)>
15 years agoImplement Last Seconds Noise (LSN) filtering
Marco Costalba [Mon, 13 Oct 2008 13:19:17 +0000 (15:19 +0200)]
Implement Last Seconds Noise (LSN) filtering

When an engine is in deep trouble at few
seconds from time limit then giveup without
fighting anymore.

This is used to reduce "lucky draws" and time pressure
blunders noises that can obfuscate results during tests
blitz games (typical one minute games).

Goal of this technique is to reduce number of matches
needed to reliably prove then an engine A is stronger
then an opponent B.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd a second margin to razoring
Marco Costalba [Mon, 13 Oct 2008 05:15:48 +0000 (07:15 +0200)]
Add a second margin to razoring

Razor on ply one if the advantage is more then a pawn,
the only way to gap the advantage is to capture, so
go directly in quiesce.

This seems to have a positive effect.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoWorkaround a static data member bug in MSVC
Marco Costalba [Sun, 12 Oct 2008 21:16:10 +0000 (22:16 +0100)]
Workaround a static data member bug in MSVC

Without this patch MSVC crashes when compiled
in release mode. It survives and works as
expected in debug mode and with gcc and Intel
compilers.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoYet another pop_1st_bit() optimization
Marco Costalba [Sun, 12 Oct 2008 12:34:54 +0000 (14:34 +0200)]
Yet another pop_1st_bit() optimization

Always for 32 bit but withot relying on MSVC intrinsics.

It is very similar to previous ones, but this does not
segfaults due to -fno-strict-aliasing compiler option.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd mean calculation in debug tools
Marco Costalba [Sat, 11 Oct 2008 17:25:16 +0000 (19:25 +0200)]
Add mean calculation in debug tools

Another simple performance counter...

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRevert bad capture pruning
Marco Costalba [Sat, 11 Oct 2008 17:03:59 +0000 (19:03 +0200)]
Revert bad capture pruning

After testing does not seem to increase ELO.

Indeed Glaurung is a little bit weaker, so revert.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoBetter interface to get the current move type
Marco Costalba [Mon, 6 Oct 2008 04:32:09 +0000 (05:32 +0100)]
Better interface to get the current move type

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAllow to prune bad captures
Marco Costalba [Sun, 5 Oct 2008 22:27:41 +0000 (23:27 +0100)]
Allow to prune bad captures

Only good capture are preserved from futility pruning
and LMR reducing.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTeach MovePicker::get_next_move() to return move type
Marco Costalba [Sun, 5 Oct 2008 22:23:58 +0000 (23:23 +0100)]
Teach MovePicker::get_next_move() to return move type

This will be used in future patches.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFix single digit day in engine_name()
Marco Costalba [Sat, 4 Oct 2008 11:21:28 +0000 (12:21 +0100)]
Fix single digit day in engine_name()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd dbg_before() and dbg_after()
Marco Costalba [Sat, 4 Oct 2008 08:01:54 +0000 (10:01 +0200)]
Add dbg_before() and dbg_after()

Other two debug utilities to compute filter rate.

Usage is:

dbg_before(); // counts passages from this point

if(..) // complex code stuff you want to audit
  return/continue
if(...)
  .....

dbg_after(); // counts passages from this point

Then somewhere in the code, normally in poll() add
dbg_print_hit_rate() and you will see the filter rate
of your code under auditing.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate Position::to_fen()
Marco Costalba [Mon, 29 Sep 2008 17:02:48 +0000 (19:02 +0200)]
Space inflate Position::to_fen()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoposition.cpp: fix a typo introduced by recent patch
Marco Costalba [Sun, 28 Sep 2008 09:54:50 +0000 (10:54 +0100)]
position.cpp: fix a typo introduced by recent patch

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUse relative values in piece square tables
Marco Costalba [Sat, 27 Sep 2008 22:13:03 +0000 (23:13 +0100)]
Use relative values in piece square tables

So that will be automatically changed when
pieces values change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoStart to cleanup position.cpp
Marco Costalba [Sat, 27 Sep 2008 11:28:58 +0000 (12:28 +0100)]
Start to cleanup position.cpp

Still a lot to do. No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd dbg_hit_on_c(c, x) tool
Marco Costalba [Sat, 27 Sep 2008 10:12:23 +0000 (11:12 +0100)]
Add dbg_hit_on_c(c, x) tool

Like dbg_hit_on(x) but first filter out events and
only when condition 'c' is true the hit counter
is tested with 'x'.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSpace inflate evaluate_king()
Marco Costalba [Thu, 25 Sep 2008 14:43:37 +0000 (16:43 +0200)]
Space inflate evaluate_king()

This is the most complex piece of software
so far.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoClarify difference between king zone and adjacent zone
Marco Costalba [Thu, 25 Sep 2008 13:08:41 +0000 (15:08 +0200)]
Clarify difference between king zone and adjacent zone

There are subtle differences in the king evaluation
that should be clear to avoid misunderstandings.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTidy up quick_evaluate()
Marco Costalba [Thu, 25 Sep 2008 12:53:24 +0000 (14:53 +0200)]
Tidy up quick_evaluate()

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTidy up middle game specific evaluation
Marco Costalba [Thu, 25 Sep 2008 11:22:14 +0000 (13:22 +0200)]
Tidy up middle game specific evaluation

Also add starting position to benchmarks.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoCode style massage evaluate()
Marco Costalba [Thu, 25 Sep 2008 08:31:41 +0000 (10:31 +0200)]
Code style massage evaluate()

No functional changes.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd auto configuration for 32/64 bits
Marco Costalba [Wed, 24 Sep 2008 21:23:58 +0000 (22:23 +0100)]
Add auto configuration for 32/64 bits

Instead of manually adjust defines in bitboard.h
now proper ones are automatically set.

It is anyhow possible to still set them manually
in case of problems.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoEvaluate: weight_option() is static
Marco Costalba [Wed, 24 Sep 2008 19:17:28 +0000 (21:17 +0200)]
Evaluate: weight_option() is static

Declare function under local namespace. This removes a
warning from the picky Intel compiler.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoCleanup read_weights() in evaluate.cpp
Marco Costalba [Wed, 24 Sep 2008 19:50:53 +0000 (20:50 +0100)]
Cleanup read_weights() in evaluate.cpp

Exception to 80 colums rule here, but result
seems better.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoEvaluate: rename king attack variables
Marco Costalba [Wed, 24 Sep 2008 19:20:08 +0000 (20:20 +0100)]
Evaluate: rename king attack variables

A better naming IMHO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFurther cleanup evaluate()
Marco Costalba [Wed, 24 Sep 2008 18:20:52 +0000 (19:20 +0100)]
Further cleanup evaluate()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoRename pawn_rank() in relative_rank()
Marco Costalba [Wed, 24 Sep 2008 14:45:19 +0000 (16:45 +0200)]
Rename pawn_rank() in relative_rank()

It is more clear, at last for me.

Also cleanup evaluate_rook() and evaluate_queen()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd also outposts evaluation in common code
Marco Costalba [Wed, 24 Sep 2008 08:12:18 +0000 (10:12 +0200)]
Add also outposts evaluation in common code

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoGroup common evaluate code
Marco Costalba [Wed, 24 Sep 2008 07:49:18 +0000 (09:49 +0200)]
Group common evaluate code

This removes code redundancy but perhaps
impact performance due to uninlining.

Testing for regression is needed. For now
aim to best code readibility.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoWarnings termination fest
Marco Costalba [Tue, 23 Sep 2008 22:32:53 +0000 (00:32 +0200)]
Warnings termination fest

A bunch of Intel C++ warnings removed, other silent out.

Still few remaining but need deeper look.

Also usual whitespace crap removal noise.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoDo not use evaluate() for razoring
Marco Costalba [Tue, 23 Sep 2008 11:03:44 +0000 (13:03 +0200)]
Do not use evaluate() for razoring

Because razoring is reached 10% of times and about 50% of time
first two conditions are met we can save 5% of calls to the fairly
costly evaluate().

On the other side statistics have shown 95% of nodes that pass
the first two razoring conditions pass also the evaluate() test.
So the risk of dropping the third condition seems low enough.

Testing seems to validate this.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoinit_eval: small cleanup
Marco Costalba [Mon, 22 Sep 2008 11:22:36 +0000 (13:22 +0200)]
init_eval: small cleanup

Functionality not changed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFix InitKingDanger initialization
Marco Costalba [Mon, 22 Sep 2008 10:10:09 +0000 (12:10 +0200)]
Fix InitKingDanger initialization

Last line was missing.

Also reformat tables constants to be more readable.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoOptimize pop_1st_bit() take 2
Marco Costalba [Sun, 21 Sep 2008 21:13:03 +0000 (22:13 +0100)]
Optimize pop_1st_bit() take 2

This time we use MSVC intrinsics that are
C wrappers for Intel assembler 'bsf' instruction.

The speed up in node count is around 3%, probably
it does not worth the effort. Anyway this patch
can be useful at least for documentation purposes.

This optimization covers 32 bit systems only.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoChange the name to Glaurung clone
Marco Costalba [Sun, 21 Sep 2008 09:51:38 +0000 (11:51 +0200)]
Change the name to Glaurung clone

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoSwitch to developer version numbering
Marco Costalba [Sun, 21 Sep 2008 08:16:50 +0000 (09:16 +0100)]
Switch to developer version numbering

Also clean up code while there.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoUse optimized pop_1st_bit() only under Windows
Marco Costalba [Sat, 20 Sep 2008 20:19:54 +0000 (22:19 +0200)]
Use optimized pop_1st_bit() only under Windows

Under Linux we have a segfault after a random time,
about a couple of minutes while running the benchmark.

This happens both with gcc and icc, and both with O2
and O3 optimizations.

Disable for Linux until we understand what's the deal.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoAdd new superlinear interpolator
Marco Costalba [Sat, 20 Sep 2008 18:55:52 +0000 (19:55 +0100)]
Add new superlinear interpolator

Faster transition and between phases and
more persistent during mid and ending game.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFinally remove last old C style I/O stuff
Marco Costalba [Fri, 19 Sep 2008 19:36:16 +0000 (20:36 +0100)]
Finally remove last old C style I/O stuff

Now I/O is fully done with C++ iostreams.

The only exception is in non-windows version
of Bioskey() in misc.cpp

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoConvert book.cpp to use C++ I/O
Marco Costalba [Fri, 19 Sep 2008 12:37:28 +0000 (13:37 +0100)]
Convert book.cpp to use C++ I/O

Instead of old C stdio.h

Also small code clean up while there.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFinal touches to pop_1st_bit optimization
Marco Costalba [Fri, 19 Sep 2008 03:33:55 +0000 (05:33 +0200)]
Final touches to pop_1st_bit optimization

This final version is a little bit faster then
previous patch and is a bit cleaned up also.

On 32 bit x86 pop_1st_bit is now more then
two times faster then the original one that
is optimized for 64 bit processors.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoOptimize pop_1st_bit() on 32 bits x86
Marco Costalba [Thu, 18 Sep 2008 14:09:19 +0000 (16:09 +0200)]
Optimize pop_1st_bit() on 32 bits x86

Operations on 64 bits Bitboard types are slow
on x86 compiled with gcc, so optimize this case.

BTW profiling shows that pop_1st_bit() is a
veeery performance critical path!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoIgnore non keyboard events in Bioskey()
Marco Costalba [Thu, 18 Sep 2008 10:46:48 +0000 (11:46 +0100)]
Ignore non keyboard events in Bioskey()

Filter out mouse and windows type events.

This fix an issue where Glaurung hangs in console mode
under Windows.

To reproduce simply open a console under Windows (cmd.exe),
run "glaurung.exe bench 50 1", this starts benchmarking.
Then hide the windows and show again or clik the mouse
somewhere on the window, this hangs the benchmark
because Boiskey() returns true and poll() calls std::getline()
that hangs waiting for user pressing a return key.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoCleanup poll()
Marco Costalba [Thu, 18 Sep 2008 09:34:19 +0000 (10:34 +0100)]
Cleanup poll()

Reshape this function in preparation
for future work.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoImprove time managment
Marco Costalba [Thu, 18 Sep 2008 09:32:12 +0000 (10:32 +0100)]
Improve time managment

If we need some more and we are in time
advantage take it.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoPass also opponent time to think()
Marco Costalba [Thu, 18 Sep 2008 09:31:01 +0000 (10:31 +0100)]
Pass also opponent time to think()

This patch modifies think() signature to accept
also opponent time. This is needed for future
changes to time managment.

Still no functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoDisable a stupid and noisy MSVC warning
Marco Costalba [Thu, 18 Sep 2008 09:29:26 +0000 (10:29 +0100)]
Disable a stupid and noisy MSVC warning

Remove the crap from compiler messages.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoTeach Benchmark to read positions from a file
Marco Costalba [Thu, 18 Sep 2008 08:55:35 +0000 (09:55 +0100)]
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>
15 years agoReformat benchmark interface
Marco Costalba [Thu, 18 Sep 2008 08:54:44 +0000 (09:54 +0100)]
Reformat benchmark interface

Prepare to following patches, still no functional
change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoFix another conversion warning: Bitboard->int
Marco Costalba [Thu, 18 Sep 2008 08:53:53 +0000 (09:53 +0100)]
Fix another conversion warning: Bitboard->int

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoDocument where we want a uint16_t instead of a uint64_t
Marco Costalba [Thu, 18 Sep 2008 08:53:14 +0000 (09:53 +0100)]
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>
15 years agoUse size_t instead of int
Marco Costalba [Thu, 18 Sep 2008 08:52:09 +0000 (09:52 +0100)]
Use size_t instead of int

Remove some warning.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
15 years agoMovePicker: simplify move swapping
Marco Costalba [Thu, 18 Sep 2008 08:51:24 +0000 (09:51 +0100)]
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>