]>
git.sesse.net Git - stockfish/log
Marco Costalba [Fri, 20 Aug 2010 07:49:13 +0000 (09:49 +0200)]
Use evaluation margins also in main search
For now keep FutilityMarginsMatrix[] unchanged, in
future we are going to reduce to compensate for extra
margin.
At this moment it is enough we don't have regressions.
After 9694 games on russian cluster
Mod - Orig 1608 - 1578 - 6508 ELO +1 (+- 2.8)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 27 Aug 2010 10:15:07 +0000 (12:15 +0200)]
Split branches in generate_piece_moves()
Instead of one comparison in while() condition use two,
the first to check if the piece is exsistant and the second
to loop across pieces of that type.
This should help branch prediction in cases we have only
one piece of the same type, for instance for queens, the
first branch is always true and the second is almost always
false.
Increased speed of 0.3-0.5 % on Gcc pgo compiles.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 26 Aug 2010 10:13:07 +0000 (12:13 +0200)]
Speed up updateShelter()
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 26 Aug 2010 06:27:57 +0000 (07:27 +0100)]
Assorted code style in evaluation.cpp
Renaming, cleanu up, etc.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 25 Aug 2010 20:01:03 +0000 (21:01 +0100)]
Finally remove value from EvalInfo
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 25 Aug 2010 19:32:25 +0000 (20:32 +0100)]
Remove dependency from ei.value in evaluate functions
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 25 Aug 2010 19:16:27 +0000 (20:16 +0100)]
Remove margin[] from EvalInfo
Directly pass arguments to king evaluation.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 25 Aug 2010 19:05:38 +0000 (20:05 +0100)]
Remove MaterialInfo* from EvalInfo
Use a local variable instead.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 25 Aug 2010 18:56:01 +0000 (19:56 +0100)]
Change evaluate() signature
Hide EvalInfo and return just the score and the margin.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 25 Aug 2010 13:28:08 +0000 (15:28 +0200)]
Retire attackedBy[] access functions
Currently are used by evaluation itself and the
whole EvalInfo will be removed from global visibility
by next patch, so no reason to use them.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 25 Aug 2010 12:13:05 +0000 (14:13 +0200)]
Decrypt some magics in bitboards definitions
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 24 Aug 2010 23:20:53 +0000 (00:20 +0100)]
We don't need EvalInfo c'tor anymore
We know always get complete info from TT, so this
code is obsolete.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 20 Aug 2010 07:47:07 +0000 (09:47 +0200)]
Rename ei.kingDanger in ei.margin
It will be more clear when we will go to add stuff
apart from king danger itself.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 20 Aug 2010 07:16:43 +0000 (09:16 +0200)]
Call apply_weight() only once in passed pawns evaluation
First accumulate the bonus for each pawn, then call the
not very fast apply_weight().
Should be no functional change apart from rounding issues.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 24 Aug 2010 13:59:24 +0000 (15:59 +0200)]
Don't need to memset() EvalInfo
Set manually to zero the few fields that are
optionally populated and that's enough.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 24 Aug 2010 13:35:13 +0000 (15:35 +0200)]
There is no need of storing mobility in EvalInfo
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 24 Aug 2010 12:48:40 +0000 (14:48 +0200)]
Refresh comments in evaluate.cpp
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 24 Aug 2010 10:29:44 +0000 (12:29 +0200)]
Unify single MobilityBonus[] tables in a big single one
Avoid one address lookup in a very critical time path.
Unified also outpost bonus tables for knights and bishops.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 22 Aug 2010 13:18:58 +0000 (14:18 +0100)]
Retire trapped bishop evaluation
Another 100 lines of dubious and ad-hoc code.
After 7644 games on russian cluster:
Mod - Orig 1285 - 1249 - 5110 ELO +1 (+- 3.2)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 22 Aug 2010 13:55:52 +0000 (14:55 +0100)]
Retire UCI_Chess960 option
We don't need that !
We can infere from starting fen string if we are in
a Chess960 game or not. And note that this is a per-position
property, not an application wide one.
A nice trick is to use a custom manipulator (that is an
enum actually) to keep using the handy operator<<() on the
move when sending to std::cout, yes, I have indulged a
bit here ;-)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 21 Aug 2010 17:57:52 +0000 (19:57 +0200)]
Prefetch pawn hash key
Plus a bunch of other minor optimizations.
With this power pack we have an increase
of a whopping 1.4% :-)
...and it took 3 good hours of profiling + hacking to get it out !
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 20 Aug 2010 09:25:34 +0000 (11:25 +0200)]
Retire unstoppable pawns evaluation
One hundred lines of code should be compensated by an
important ELO increase, otherwise are candidate for removal...
...and is not the case. We are well within error margin, so
remove the code even if we lose a couple of elo points, but
semplification is huge.
After 6494 games on russian cluster
Orig vs Mod 1145 - 1107 - 4242 (-2 ELO)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 21 Aug 2010 16:18:56 +0000 (17:18 +0100)]
Remove my address from README
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 20 Aug 2010 17:16:20 +0000 (18:16 +0100)]
Retire beta counters stuff
Is now obsoleted by previous patch.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Thu, 19 Aug 2010 10:29:40 +0000 (13:29 +0300)]
Use MovePicker's move ordering also at root
After testing on our russian cluster: +3 elo after 4200 games
So keep it becuase it allows a good semplification.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 19 Aug 2010 16:55:32 +0000 (17:55 +0100)]
Move StartPositionFEN out of the header
It is not needed to have global visibility.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 19 Aug 2010 16:38:10 +0000 (17:38 +0100)]
Move piece values in piece.h / piece.cpp
Where they belong.
Note that array PieceValueMidgame[] and PieceValueEndgame[]
are now declared extern in the header and moved in piece.cpp
so to avoid allocate the array each time the header is
included !
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 19 Aug 2010 16:25:08 +0000 (17:25 +0100)]
Retire is_upper_bound() and friend
Directly expand in the few places where is called.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 19 Aug 2010 16:00:36 +0000 (17:00 +0100)]
Retire useless piece_value_midgame() overloads
Directly access the table in the few call places.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 19 Aug 2010 15:36:18 +0000 (16:36 +0100)]
Introduce and use SCORE_ZERO
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 19 Aug 2010 13:50:02 +0000 (14:50 +0100)]
Do not score PH_QCHECKS
They are picked unsorted anyway, so score is unuseful.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 19 Aug 2010 06:38:13 +0000 (07:38 +0100)]
Disable templetized operators by default
To avoid nasty bugs due to silently overriding of
common operator we enable the templates on a type
by type base using partial template specialization.
No functional change, zero overhead at runtime.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 16:31:44 +0000 (17:31 +0100)]
Introduce enum VALUE_ZERO instead of Value(0)
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 16:04:38 +0000 (17:04 +0100)]
Use Use templetized operations for Score and Value
Note that in value we leave two specialized functions
to allow adding an integer, we don't want to add this
as a template becasue we want to control implicit
conversions to integer of an enum.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 15:54:59 +0000 (16:54 +0100)]
Use templetized operations for Piece
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 15:40:26 +0000 (16:40 +0100)]
Use templetized operations for Square
This is tricky because there are some special
binary fnctions with SquareDelta that we should
leave as they are.
Also note that we needed to add Unary minus template
to fix a comile error in SERIALIZE_MOVES_D macro that was
triggered because now we don't allow conversion to int.
No fuctional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 15:17:20 +0000 (16:17 +0100)]
Use templetized operations for File and Rank
Doing the conversion the compiler is now able to
spot two possible ambiguity calls that now we can
easily fix.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 14:58:22 +0000 (15:58 +0100)]
Use templetize enum operations for Depth
Instead of hardcoded ones.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 14:20:24 +0000 (15:20 +0100)]
Store in TT with depth == -OnePly instead of -1
When depth < DEPTH_ZERO we store with the same depth all
the positions, use -OnePly instead of -1 for consistency
with depth arithmetic.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 14:13:10 +0000 (15:13 +0100)]
(Re)introduce DEPTH_ZERO to replace Depth(0)
No functional changes.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 13:55:12 +0000 (14:55 +0100)]
Retire some unused Depth operator() functions
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 13:23:19 +0000 (14:23 +0100)]
Rename OnePly in ONE_PLY
Use enum values standard naming policy also for this one.
No fuctional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 12:39:14 +0000 (13:39 +0100)]
Define OnePly as a Depth enum costant
There is no reason to use a variable for this.
Also remove unused DEPTH_ZERO and DEPTH_MAX.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 18 Aug 2010 09:05:28 +0000 (10:05 +0100)]
Revert F_90 and F_92
Regression test found the patches to be harmless,
so revert to keep code simpler.
Test1 at 20+0.1: (2500 - 3000) +0 ELO
Test2 at 1+0: (~1000) +2 ELO
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 9 Aug 2010 10:45:02 +0000 (11:45 +0100)]
Cleanup and optimize Position::has_mate_threat()
There is a functional change because we now skip
more moves and because do_move() / undo_move() is
well known to be not reversible we end up with a
change in node count, although there is actually
no change but a bit speed up.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 8 Aug 2010 11:38:30 +0000 (12:38 +0100)]
Usual material.cpp small touches
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 7 Aug 2010 17:40:04 +0000 (18:40 +0100)]
Rename constants to use *_NONE scheme
To be uniform across the sources. As a nice side effect
I quickly spotted a couple of needed renames:
captured_piece() -> captured_piece_type()
st->capture -> st->capturedType
Proposed by Ralph and done with QtCreator
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 6 Aug 2010 21:30:50 +0000 (22:30 +0100)]
Move depth computation out of fail low loop
In root_search() we can compute depth at the beginning
once and for all.
Spotted by Ralph Stoesser.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 6 Aug 2010 11:01:21 +0000 (12:01 +0100)]
Another push to perft speed
We don't need to generate captures and non
captures in a separate step. This gives another
7% push to perft speed.
yes, I know, it is totally useless :-)
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 6 Aug 2010 09:47:42 +0000 (10:47 +0100)]
Faster perft
Skip moves scoring and sorting: this more then
doubles the speed !
Verified is correct.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 3 Aug 2010 12:06:56 +0000 (13:06 +0100)]
Rename TM in ThreadsMgr
This avoid misunderstandings with new TimeManager
object called TimeMgr.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 3 Aug 2010 09:58:13 +0000 (11:58 +0200)]
TimeManager API rename
We can now set member data as private because is no more
directly accessed.
Should be more clear now.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 3 Aug 2010 09:20:06 +0000 (11:20 +0200)]
Move time related global variables under TimeManager
Move OptimumSearchTime, MaximumSearchTime and
ExtraSearchTime in TimeManager.
Note that we remove an useless initialization to 0 because
these variables are used only with time management.
Also introduce and use TimeManager::available_time()
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 3 Aug 2010 09:10:16 +0000 (11:10 +0200)]
Introduce TimeManager class
Firt step in unifying all time management under
a single umbrella. Just introduced the class without
even member data.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 1 Aug 2010 14:38:00 +0000 (15:38 +0100)]
Small cleanup in search Step.5
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 1 Aug 2010 08:37:07 +0000 (09:37 +0100)]
Reset bestMove before entering main moves loop
After razoring, IID, null verification and singular
extension searches we have could have a dirty ss->bestMove,
restore to MOVE_NONE before to enter moves loop.
This should avoid to store in TT a stale move when
we fail low.
Tested together with previous patch that is the
one that gives ELO.
After 1152 games at 1+0 on my QUAD
Mod vs Orig +233 =716 -203 (+9 ELO)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 31 Jul 2010 07:14:06 +0000 (08:14 +0100)]
Use past SE information also for success cases
If singular extension search was succesful in the past then
skip another the SE search and extend of one ply.
Another way to mitigate the cost of SE at the price of
some more spurious extension, but on 90% of cases info
is correct.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 2 Aug 2010 17:41:25 +0000 (18:41 +0100)]
Rename MaxSearchTime and AbsoluteMaxSearchTime
Renamed in OptimumSearchTime and MaximumSearchTime,
should be more clear now.
Suggested by Joona.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 2 Aug 2010 10:14:27 +0000 (12:14 +0200)]
Templetize xxx_time_for_MTG()
Also fixed some warnings under MSVC.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 2 Aug 2010 09:34:19 +0000 (11:34 +0200)]
Little timeman.cpp massage
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Mon, 26 Jul 2010 13:39:10 +0000 (16:39 +0300)]
Tweak default values for ucioptions
I created three different systems, tested them all separately and
attached one did best:
1/40: Orig - Mod: 841 - 850 (+2 elo)
1+1 : Orig - Mod: 474 - 498 (+9 elo)
1+0 : Orig - Mod: 455 - 495 (+15 elo)
Because such testing system is not statistically reliable, I made a
confirmation test:
1/40: Orig - Mod: 502 - 543 (+14 elo)
1+1: Orig - Mod: 447 - 489 (+16 elo)
1+0: Orig - Mod: 641 - 656 (+4 elo)
All tests show positive score :-)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 11 Jul 2010 16:23:50 +0000 (19:23 +0300)]
New Time management system
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 31 Jul 2010 06:29:29 +0000 (07:29 +0100)]
Always use ss->bestMove to store ply best move
Instead of ss->currentMove. It is more consistent and
clear to understand.
Remark by Ralph Stoesser.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 28 Jul 2010 07:39:28 +0000 (09:39 +0200)]
Lower SingularExtensionDepth to 7 plies for non-pv
To compensate for the extra work skip singular
searches deemed to fail because excluded node
failed high already in the past.
After 1200 games at 1+0
Mod vs Orig +387 =1274 -339 (+8 ELO)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 26 Jul 2010 05:07:34 +0000 (06:07 +0100)]
Two small fixes in passed pawns evaluation
The one in evaluate_passed_pawns() is just a micro
optimization, the other in evaluate_unstoppable_pawns()
is indeed a fix, although almost unmeasurable in real
games.
Bugs report and fixes by Marek Kwiatkowski
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 25 Jul 2010 20:47:54 +0000 (21:47 +0100)]
Fix KBNK endgame
Broken by recent patch. Also better document what's
happening there.
Verified to restore original behaviour.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 25 Jul 2010 11:10:22 +0000 (12:10 +0100)]
Rename EMPTY in NO_PIECE
It is more correct and more in line with enum PieceType
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 25 Jul 2010 10:44:03 +0000 (11:44 +0100)]
Introduce enum SquareColor
Square and piece colors are two different things,
so use different types to avoid misunderstandings.
Suggested by Tord.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 25 Jul 2010 10:05:01 +0000 (11:05 +0100)]
Introduce and use same_color_squares()
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sun, 25 Jul 2010 08:52:06 +0000 (09:52 +0100)]
Cleanup Position::print()
And remove not used OUTSIDE enum Piece.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 25 Jul 2010 06:52:11 +0000 (09:52 +0300)]
Fix build failure on GCC
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 24 Jul 2010 16:59:18 +0000 (17:59 +0100)]
Cleanup Position::to_fen()
Less invasive then previous patches, but still a good
enhancement.
Also some indulge on STL algorithms :-)
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 24 Jul 2010 15:19:46 +0000 (16:19 +0100)]
Last touches to from_fen()
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 23 Jul 2010 08:38:19 +0000 (10:38 +0200)]
Rewrite Position::from_fen()
Complete rewrite the function and extend compatibility
also to X-FEN notation for Chess960.
We are now able to read standard FEN, Shredder-FEN and X-FEN.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Fri, 23 Jul 2010 06:16:33 +0000 (09:16 +0300)]
Don't initialize psqt-tables when 'ucinewgame' is received
After 'Randomness' is retired, this is no longer necessary.
NOTE: Possibly some extra care is needed when tuning branch is synced
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Fri, 23 Jul 2010 06:08:31 +0000 (09:08 +0300)]
Retire 'Randomness' ucioption
Using multiple threads and good opening book is
much better and more reliable source of randomness than
spoiling psqt-tables
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Fri, 23 Jul 2010 05:45:42 +0000 (08:45 +0300)]
Always init pthread locks to NULL
This is the only way to keep Windows and POSIX behaviour in sync,
so better hardcode it.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Fri, 23 Jul 2010 05:26:54 +0000 (08:26 +0300)]
Remove other locking options
Currently broken and we use pthreads in search.cpp
anyway, so I see no reason to keep these around
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 23 Jul 2010 01:42:27 +0000 (02:42 +0100)]
Retire SearchStack init() and initKillers()
Let be explicit about what this functions do, and
we save some code lines too.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Fri, 23 Jul 2010 01:26:10 +0000 (02:26 +0100)]
Fix errouneus reset of ss->threatMove
After we set ss->threatMove we could go under a IID step that
resets SearchStack ss and so also ss->threatMove.
When later we use that field in futility pruning we have this
set to MOVE_NONE !
The fix is to use a local variable and add threatMove to SplitPoint
to pass this move to slaves.
Spotted by Ralph Stoesser, fix suggested by Richard Vida.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Thu, 22 Jul 2010 17:29:36 +0000 (18:29 +0100)]
Revert previous patch
Improvement is easily in error bar and there is
some added complexity making future changes more
difficult.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 19 Jul 2010 06:56:14 +0000 (08:56 +0200)]
Weight backward-ness of a pawn
Because not all backward pawns are the same ;-) if the
blocking enemy pawn is near then our pawn is more backward
than another whose enemy pawn is far away so that can advance
for some sqaures.
After 2925 games at 30"+0 on my QUAD
Mod vs Orig +602 =1745 -578 +3 ELO
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Thu, 22 Jul 2010 13:11:08 +0000 (16:11 +0300)]
ValueType needs only 2 bits to be stored in TT
Also update some more TT documentation
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Thu, 22 Jul 2010 12:52:22 +0000 (15:52 +0300)]
Update TT documentation
Update outdated and even misleading documentation.
Also check #include-directives
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Wed, 21 Jul 2010 06:31:11 +0000 (08:31 +0200)]
Move insert_pv() and extract_pv() out of TT class
These functions have little to do with TranspositionTable
class and more with the search and in particular with the PV
handling. So move them where they belong.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 20 Jul 2010 21:36:38 +0000 (22:36 +0100)]
Store position static score in TT as soon as possible
So to maximize the possibility to avoid to recalculate it
in the future. A small speed-up of 0.8%
Idea by Ralph Stoesser.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Tue, 20 Jul 2010 07:16:16 +0000 (09:16 +0200)]
Introduce DEPTH_NONE and use it
Also better fix previous patch.
Suggestions by Joona and Ralph.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Mon, 19 Jul 2010 15:48:16 +0000 (18:48 +0300)]
Remove pointless tte->static_value() != VALUE_NONE checks
Now in non-check nodes we are guaranteed to always have static value
in TT Entry.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 18 Jul 2010 21:19:09 +0000 (00:19 +0300)]
Store static value and king danger in TT also in TT.insert_pv() method
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 19 Jul 2010 11:28:33 +0000 (12:28 +0100)]
Fix "pass ss->eval to qsearch()" condition
The seocond check is no more needed now and
anyhow is wrong to overwrite a TT entry if
present.
Spotted by Ralph Stoesser.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 19 Jul 2010 07:08:28 +0000 (09:08 +0200)]
Triviality in material.cpp
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Mon, 19 Jul 2010 06:13:50 +0000 (07:13 +0100)]
Small rewrite of backward pawn test
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 18 Jul 2010 21:01:58 +0000 (00:01 +0300)]
Initialize SearchStack only once at RootMoveList c'tor
Just fix current ugly behaviour :-)
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 18 Jul 2010 20:54:40 +0000 (23:54 +0300)]
Every node is responsible for initializing its own SearchStack entry
More logical than doing partly initialization at init_ss_array()
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 18 Jul 2010 20:52:03 +0000 (23:52 +0300)]
Drop KILLER_MAX. Hardcode to 2 instead.
KILLER_MAX in search.h is quite pointless, because
we already hardcode this to 2 in MovePicker anyway.
By hard-coding this to 2 we can keep code simpler.
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 18 Jul 2010 20:35:57 +0000 (23:35 +0300)]
Do not initialize ss->reduction to zero in the beginning of node
It must already be zero because zeroed in SearchStack initialization
No functional change
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Sun, 18 Jul 2010 13:24:07 +0000 (16:24 +0300)]
Do not reset ss->eval in the beginning of the node
This avoids problems with IID clearing ss->eval and
eval not being available when we return
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 17 Jul 2010 16:32:54 +0000 (17:32 +0100)]
Fix isolated and backward pawns scoring
It is more clear and also more correct because we
consider enemy pawns only in fornt of us and not just
on our file.
Very small functional change, almost not measurable, but
keep the patch for documenting purposes.
Spotted by Marek Kwiatkowski.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Marco Costalba [Sat, 17 Jul 2010 13:00:25 +0000 (14:00 +0100)]
Triviality in endgame.cpp
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Joona Kiiski [Fri, 16 Jul 2010 06:12:46 +0000 (09:12 +0300)]
Update Makefile
Signed-off-by: Marco Costalba <mcostalba@gmail.com>