Use a margin to compare with beta so that positions
that after the verifying qsearch have gained a lot of points
are not discarded just becasue not above beta.
Also remove the second condition on depth <= OnePly, it
was too risky and added only a 2% more of pruned nodes.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Fix the logic in search_pv and sp_search_pv
An additional issue to consider is that a castle move
is not a capture but destination square is not empty.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Instead of number of searched nodes use the number of
opponent beta-cutoff occurred under the move subtree.
After 570 games 1+0 we have: +150 =288 -132 (+11 ELO)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Catched counting the nodes searched at
fixed depth. A quick and reliable cross check,
expecially in inflate only patches.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
In this case firstlocates the least valuable attacker, if any,
then proceed as usual.
This will be used by next patch.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
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>