1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00
Commit graph

1843 commits

Author SHA1 Message Date
Marco Costalba
21fc66c246 Add file distance condition in move_is_legal()
Found another missed control in move_is_legal() thanks to
brute force testing.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-22 09:49:44 +01:00
Marco Costalba
ff9e49bac9 Remove useless casts in types.h
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-22 08:52:39 +01:00
Marco Costalba
90e83fa879 Promotion piece must be empty if is not a promotion
Add a new check in  move_is_legal()

Avoid useless casting in move.h while there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-22 08:48:19 +01:00
Marco Costalba
3ef4fdeaa0 Introduce MovePicker::isBadCapture() and use in probcut
Small functional change due to the fact that now we skip
probcut on evasions.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-21 10:40:36 +01:00
Marco Costalba
13d8af1852 Correctly handle castle in see()
Suggested by Onno.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-20 06:58:53 +01:00
Marco Costalba
5b7a141065 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>
2011-05-18 07:05:36 +01:00
Marco Costalba
89a06f6651 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>
2011-05-17 23:47:26 +01:00
Marco Costalba
a2e924039b Retire move_is_capture_or_promotion()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-17 23:39:14 +01:00
Marco Costalba
85d1f9c5ec 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>
2011-05-17 23:31:40 +01:00
Marco Costalba
e444e18d2b 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>
2011-05-17 12:25:49 +01:00
Marco Costalba
ad0fdf0da6 Retire Position::see(Square from, Square to) overload
Alomst unuseful.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-17 12:17:57 +01:00
Marco Costalba
fbbc7e421c Prefer an assert to a comment in position.h
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-17 12:17:48 +01:00
Marco Costalba
1cc42ac9e4 Let 'make' with no arguments to show compilation options
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-17 12:17:38 +01:00
Marco Costalba
6624105b5b 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>
2011-05-17 12:17:29 +01:00
Marco Costalba
de58594b0f Use standard naming conventions in book.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-08 11:50:38 +01:00
Marco Costalba
d5f0b91c06 Reintroduce operator>>() in Book class
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-08 09:15:18 +01:00
Marco Costalba
f78488bbdb Restore development version
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-08 09:11:36 +01:00
Marco Costalba
e3b23eb818 Stockfish 2.1.1
stockfish bench signature is: 6487630

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-08 08:46:33 +01:00
Marco Costalba
d494725400 Spell fix in evaluate.cpp
Spotted by Eelco.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-07 10:08:53 +01:00
Marco Costalba
2535dc1340 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>
2011-05-07 09:51:33 +01:00
Marco Costalba
339bf9b7e1 Remove redundant assignment in search()
It is already assigned few lines before.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-05 12:16:26 +01:00
Marco Costalba
bb86691a0d Restore development version
No functional change.
2011-05-05 06:35:42 +01:00
Marco Costalba
f7fee4c616 Fix a warning in debug mode
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-03 19:29:21 +01:00
Marco Costalba
315c58354e Stockfish 2.1
stockfish bench signature is: 6487630

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-03 12:11:19 +01:00
Marco Costalba
5ef2b8c494 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>
2011-05-03 12:11:10 +01:00
Marco Costalba
9c5a53ca45 Update Readme.txt to 32 threads and bsfq on Windows
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-03 12:11:02 +01:00
Marco Costalba
b1929960f9 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>
2011-05-03 12:10:53 +01:00
Marco Costalba
8447248705 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>
2011-05-02 17:50:46 +01:00
Marco Costalba
a10487b074 Rename stuff in evaluate.cpp
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-02 17:50:37 +01:00
Marco Costalba
db31efb8a6 Additional tweaks in evaluate_unstoppable_pawns()
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-01 12:15:40 +01:00
Marco Costalba
75acd52415 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>
2011-05-01 10:31:27 +01:00
Marco Costalba
18c9b5ee86 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>
2011-05-01 09:58:45 +01:00
Marco Costalba
33bd67e052 Update polyglot.ini
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-05-01 07:49:40 +01:00
Marco Costalba
4dc7ba1619 Rename check related functions
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-29 18:56:48 +01:00
Marco Costalba
92d70fb667 Small renaming in thread.cpp
To better self document the code.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-29 13:08:35 +01:00
Marco Costalba
0bf475ec55 Rename Option in UCIOPtion
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-29 13:08:27 +01:00
Marco Costalba
bb7713c8e9 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>
2011-04-28 08:00:34 +01:00
Marco Costalba
e656ddcf18 Perft counts leaf nodes not generated moves.
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-27 23:21:46 +01:00
Marco Costalba
1d0159075e Use probe() as name for looking up into an hash table
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-27 07:31:51 +01:00
Marco Costalba
321320b081 Tidy up uci.cpp and siblings
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-26 13:23:47 +01:00
Marco Costalba
ca9d40c145 Move OpeningBook and RK where are actually used
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-26 13:23:39 +01:00
Marco Costalba
03f4d1e8d6 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>
2011-04-25 22:59:56 +01:00
Marco Costalba
87f2b52ace 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>
2011-04-25 13:35:13 +01:00
Marco Costalba
09d01ee9dc 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>
2011-04-25 12:07:30 +01:00
Marco Costalba
05cfb00f26 Large API rename in ThreadsManager
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-25 10:30:39 +01:00
Marco Costalba
339e1b49f6 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>
2011-04-24 19:23:07 +01:00
Marco Costalba
fecefbb99c 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>
2011-04-24 17:07:22 +01:00
Marco Costalba
c9d7e99de6 Rename MOVES_MAX in MAX_MOVES
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
2011-04-24 08:54:36 +01:00
Marco Costalba
ccd5ccbcdb 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>
2011-04-24 08:52:16 +01:00
Marco Costalba
633c83f648 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>
2011-04-24 08:18:39 +01:00