When a null move fails low due to a capture, try
to detect if without the capture we are above beta,
in this case there is a good possibility this is
a cut-node and the capture is just a null move
artifact due to side to move change. So if we still
don't have a TT move it's a good time to start an IID.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
It happens that more then 70% of cases are HxL, where
we call see() anyway. The mesured saving of calling
see is about 0,5% of total time, but considering the
added burden in score_captures() the saving is only
0,35% locally and due to more difficult inlining of
the function it ends up that we have no advantage at all,
possibly a small slow down!
So revert.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Null move can fail low because of a capture artifact due
to the side to move change. Try to detect this condition
and fail high instead.
This pruning is very powerful, around 7% of nodes, but is
still experimental so is disabled by default.
Set UseNullCapturePruning to true to enable.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Actually square 0 can be dirty, so that move_is_capture(0)
can return any random values.
Add an assert to be sure it is caught.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Use a state machine to parse the input. Fixed
the many broken cases.
Tested on more then 15 milions nodes.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Strength increase was due to an hidden bug introduced
by the patch, namely the time per move to /30 instead
of /40 (see previous patch).
After testing this feature do not add any substantial
increase so is removed.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
After deep test (1000 games) it seems do not improve anything,
actually seems slightly weaker.
So remove it for now.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Make a copy of the position when needed instead
of passing as a reference. It is cleaner and
let us to simplify also Position::print()
A small space inflate while there.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Default argument should be in declaration where it
is visible through header include, not in definition.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Does not seem to improve anything.
Anyhow idea is nice, maybe we still have to find
correct recipe.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Cleanup and document.
The real functional change is that not mate threat
moves are never pruned, as could happen before.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
We can have depth(0) also in problematic cases
according to how extensions are tweaked by the user.
In any case we don't want to prune these moves.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
EvalInfo has missing attack info when a specialized
endgame function is used.
We missed this case and were using an empty attack bitboard
instead so that no captures were generated for endgames.
After testing the EvalInfo optimization gave worst results,
so after a (long) debug session this nasty bug was found.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Add infrastructure to threat killer moves as a vector,
this will allow us to easily parametrize the number of
killer moves, instead of hardcode this value to two as is now.
This patch just add the infrastructure, no functional
change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Teach Position::print() to optionally print a
given move in san notation in addition to
the ASCII representation of the board.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Instead of pospone until picking. No functional
change and probably no performance change but it is
needed for following patch.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
It is erroneusly considered a capture because king
moves on the same square of the rook.
Use the correct function Position::move_is_capture()
instead of the open coded (and buggy) one.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Make the logic work as advertised in the function
description.
Still a fallback from TT cleanup.
This should be less serious then the one in retrieve(),
but it's still a bug.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Killers should not be captures, but checks are not
and are produced also in qsearch.
Use this information, will be useful for move ordering.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Is set during the last iteration.
Sometime also during the second last.
During the last iteration is set in the 95% of cases.
During the second last is set in the 40% of cases.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>