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>