1
0
Fork 0
Commit Graph

110 Commits (691de79eaab9c5fa131a2cf60628da615203bb3a)

Author SHA1 Message Date
Marco Costalba 691de79eaa Fix a missing comma in BenchmarkPositions[]
An old bug introduced in 3e0dc9ee84 almost
one month ago.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:16 +02:00
Marco Costalba 3f38cca072 Position::is_ok()give more info on failed test
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:16 +02:00
Marco Costalba 6b8a07eccc 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>
2008-10-20 21:47:15 +02:00
Marco Costalba 8e85aa3a65 Final semplification of generate_evasions()
Now it's readable!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:15 +02:00
Marco Costalba 4f18528a1c Introduce generate_piece_blocking_evasions()
Start to simplify generate_evasions

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:15 +02:00
Marco Costalba 4a4d62da13 Space inflate generate_evasions()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-20 21:47:15 +02:00
Marco Costalba 72289fcfab 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>
2008-10-18 21:35:35 +02:00
Marco Costalba 73d0d2c0b2 movegen: Introduce generate_pawn_captures()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:35 +02:00
Marco Costalba c1257d45b2 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>
2008-10-18 21:35:35 +02:00
Marco Costalba 34a515f20b movegen: Introduce generate_pawn_checks()
This greatly simplify redundant code.

Perhaps slihtly slower. Test needed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:35 +02:00
Marco Costalba 5abe8a0816 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>
2008-10-18 21:35:34 +02:00
Marco Costalba 35fd5ce5bc Space inflate generate_castle_moves()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:34 +02:00
Marco Costalba 146bb2dfa7 Unify pieces check generation with generate_piece_checks()
Could be slower: test needed!

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:34 +02:00
Marco Costalba ea16985ea5 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>
2008-10-18 21:35:34 +02:00
Marco Costalba 3b857d1625 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>
2008-10-18 21:35:34 +02:00
Marco Costalba aa7121297d 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>
2008-10-18 21:35:34 +02:00
Marco Costalba 94f1b31484 movegen: revert see ordering in score_captures()
It works better with MVV ordering.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:33 +02:00
Marco Costalba c852a94009 Movegen: further simplify generate_move_if_legal
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:33 +02:00
Marco Costalba 8be2c483a1 Unify black and white code in generate_move_if_legal()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:33 +02:00
Marco Costalba 158911425b Space inflate movegen.cpp
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:33 +02:00
Marco Costalba cf8ee79b76 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>
2008-10-18 21:35:33 +02:00
Marco Costalba 06d6468ce9 Test with see
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:33 +02:00
Marco Costalba 173ecc0acf 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>
2008-10-18 21:35:32 +02:00
Marco Costalba 2943e1ca31 MovePicker: use const reference instead of pointers
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:32 +02:00
Marco Costalba 486ec580f9 Space inflate movepick.cpp
Also added some FIXME to dubious points.

Still no functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:32 +02:00
Marco Costalba a930aafce0 Better comment previous patch
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:32 +02:00
Marco Costalba b3744eb4d0 Always add psqt scoring
When there is also history, history is always
preferred.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-18 21:35:32 +02:00
Marco Costalba a03ab94f44 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>
2008-10-18 21:35:20 +02:00
Marco Costalba 644db060ae 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>
2008-10-15 07:18:05 +01:00
unknown cb76e4a814 Introduce Stockfish
Signed-off-by: unknown <Marco@.(none)>
2008-10-13 22:45:47 +01:00
Marco Costalba d8268024a9 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>
2008-10-13 20:40:48 +02:00
Marco Costalba 4fa5dd4db5 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>
2008-10-13 20:40:47 +02:00
Marco Costalba 58c7a5c477 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>
2008-10-13 20:40:47 +02:00
Marco Costalba 3901affb1d 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>
2008-10-12 14:34:54 +02:00
Marco Costalba a6017aa728 Add mean calculation in debug tools
Another simple performance counter...

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-11 19:25:16 +02:00
Marco Costalba 6a15df1d82 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>
2008-10-11 19:03:59 +02:00
Marco Costalba bbf7a94d76 Better interface to get the current move type
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-06 05:44:23 +02:00
Marco Costalba a3477af2a1 Allow to prune bad captures
Only good capture are preserved from futility pruning
and LMR reducing.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-06 05:44:23 +02:00
Marco Costalba 310e07f292 Teach MovePicker::get_next_move() to return move type
This will be used in future patches.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-06 05:44:22 +02:00
Marco Costalba ea7bebb604 Fix single digit day in engine_name()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-05 10:37:05 +02:00
Marco Costalba 54071312f3 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>
2008-10-04 10:01:54 +02:00
Marco Costalba 849809e97e Space inflate Position::to_fen()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-10-04 09:50:19 +02:00
Marco Costalba e9e51da4b8 position.cpp: fix a typo introduced by recent patch
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-28 10:59:20 +02:00
Marco Costalba f1f887b6d7 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>
2008-09-28 10:59:08 +02:00
Marco Costalba 88bb3c9422 Start to cleanup position.cpp
Still a lot to do. No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-28 10:58:56 +02:00
Marco Costalba 8d76de820f 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>
2008-09-28 10:58:47 +02:00
Marco Costalba b00abed181 Space inflate evaluate_king()
This is the most complex piece of software
so far.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00
Marco Costalba 2e3faae067 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>
2008-09-26 05:54:49 +02:00
Marco Costalba 453e815d4b Tidy up quick_evaluate()
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00
Marco Costalba 3e0dc9ee84 Tidy up middle game specific evaluation
Also add starting position to benchmarks.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2008-09-26 05:54:49 +02:00