Chess-Plisco
view release on metacpan or search on metacpan
The engine will therefore not sort root moves if it is likely to be flagged
because of the tablebase probes. But the performance largely depends on the
speed of your storage media.
These two non-standard options control whether the engine will try to order
the root moves with tablebase probes. The default values for T7
(`Syzygy7TimeCushion`) is 5000 (milliseconds) and the default value for T3
(`Syzygy3TimeCushion`) is 500 (milliseconds). If there are 7 pieces on the
board, and the maximum allocated time for the move is less than T7, no
tablebase will be probed. For fewer pieces, the formula is as follows:
min_time_left = max(T3, T7 / 5^(7 - n))
Where n is the number of pieces on the board.
If you see that the engine often loses on time, escpecially, with few pieces
on the board, increase the values accordingly.
#### Option `Move Overhead`
The engine will therefore not sort root moves if it is likely to be
flagged because of the tablebase probes. But the performance largely
depends on the speed of your storage media.
These two non-standard options control whether the engine will try to
order the root moves with tablebase probes. The default values for T7
(C<Syzygy7TimeCushion>) is 5000 (milliseconds) and the default value for
T3 (C<Syzygy3TimeCushion>) is 500 (milliseconds). If there are 7 pieces
on the board, and the maximum allocated time for the move is less than
T7, no tablebase will be probed. For fewer pieces, the formula is as
follows:
min_time_left = max(T3, T7 / 5^(7 - n))
Where n is the number of pieces on the board.
If you see that the engine often loses on time, escpecially, with few
pieces on the board, increase the values accordingly.
=head4 Option C<Move Overhead>
lib/Chess/Plisco/Engine/Position.pm view on Meta::CPAN
my $rooks = $self->[CP_POS_ROOKS];
my $queens = $self->[CP_POS_QUEENS];
my $kings = $self->[CP_POS_KINGS];
# We simply assume that a position without pawns is in general a draw.
# If one side is a minor piece ahead, it is considered a draw, when there
# are no rooks or queens on the board. Important exception is KBB vs KN.
# But in that case the material delta is B + B - N which is greater
# than B. On the other hand KBB vs KB is a draw and the material balance
# in that case is exactly one bishop.
# These simple formulas do not take into account that there may be more
# than two knights or bishops for one side on the board but in the
# exceptional case that this happens, the result would be close enough
# anyway.
#
# FIXME! Just call insufficientMaterial?
if (!$pawns) {
my $delta = (do { my $mask = $material >> CP_INT_SIZE * CP_CHAR_BIT - 1; ($material + $mask) ^ $mask;});
if ($delta < CP_PAWN_VALUE
|| (!$rooks && !$queens
&& (($delta <= CP_BISHOP_VALUE)
lib/Chess/Plisco/Macro.pod view on Meta::CPAN
=back
If performance outweighs these problems in your use case, read on!
The source filter is probably not perfect but is able to translate at least
the source code of L<Chess::Plisco>. If you have trouble like unexpected
syntax errors in your own code, you can use the function C<preprocess()> (see
below), to get a translation of your source file, and find the problem.
Please note that not all translation errors are considered a bug of the
source filter. If the problem can be avoided by re-formulating your code,
a fix will probably be refused.
=head1 MOTIVATION
Chess programming should be really fast, and in this context the unavoidable
overhead of method or subroutine calls contributes enormously to the execution
time of the software.
In the C programming language, you can use preprocessor macros or inline
functions in order to avoid the calling overhead. In Perl, this can only
( run in 0.466 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )