Chess-Plisco
view release on metacpan or search on metacpan
$ perl -Ilib bin/plisco
The engine needs some time to come up because it compiles a number of
lookup tables. If you run it from a git checkout, it will also need time
to parse its own source code and expand the macros contained.
See the section L<#Internals> below, for details about this.
=head3 Graphical User Interfaces
Like almost all chess engines, plisco does not come with a graphical
user interface. Try using one of these:
=over
=item * LLL<https://cutechess.com/> (Linux, MacOS, and Windows)
=item * LLL<https://banksiagui.com/> (Linux, MacOS, and Windows)
=item * LLL<http://www.playwitharena.de/> (Linux, Windows)
=back
=head3 Syzygy Endgame Tablebases
When you want to use Syzygy Endgame Tablebases, make sure that they are
stored on a fast SSD disk. Conventional spinning disks are way too
small.
The DTZ files are optional but improve performance. They can be stored
on a slower storage medium. However, try to make sure that the disk does
not go to sleep while playing. Waking the disk up can take several
seconds and that can cause the engine to lose on time.
=head3 Differences to Other UCI Engines
=head4 Commandline Options
The program understands several commandline options. Try C<plisco --help>
for details.
=head4 Option C<SyzygyPath>
Unlike other engines do, directories are searched recursively for
tablebase files.
=head4 Options C<Syzygy7TimeCushion> and C<Syzygy3TimeCushion>
Probing the table bases in Perl is a lot slower than in C or similar
languages because the records have to be decompressed.
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>
You can use the option name C<Move Overhead> or C<MoveOverhead>, whatever
you prefer.
The default value for the move overhead is displayed as 10 ms. But this
is only the initial value, and in reality, the move overhead is
determined dynamically accurately measured. That has the advantage that
the engine automatically detects network lags or other performance
penalties.
The downside of this is that the engine output is not deterministic,
which can be a problem for debugging. You can avoid that by specifying
the move overhead explicitely:
setoption name Move Overhead value 10
=head2 Internals
Functions and methods (subroutines) are the most fundamental way of
avoiding copy and paste - also known as Don't Repeat Yourself DRY (the
mother of all evil)- in source code, but it often comes at a cost, which
is called call overhead.
Often times, the code runs faster if you copy the same snippets over and
over again to the needed locations instead of invoking a subroutine with
arguments. This is called inlining. But it leads, of course, to really
ugly code, which is a nightmare to maintain.
But there are ways to achieve the same results in a more readable form.
The most prominent examples are the commands C<m4> and the infamous C
preprocessor C<cc -E> (or the equivalent C<cpp>). Both are preprocessors
that basically do a pretty smart search and replace on your source code.
Many purists hate these tools but they are key, when you have to improve
performance.
C++ tried to calm down the haters with the C<inline> keyword. It is
pretty much a politically correct C preprocessor without its quirks.
That turned out to be quite useful, and eventually, the C<inline> keyword
found its way back into C++'s mother language C.
Another such trick is generic programming. Search the internet if you
are interested.
Perl actually allowed you to automatically preprocess your code with the
C preprocessor, but the corresponding option C<-P> was dropped with Perl
5.18 because it had many practical issues. But you can, of course, use
it in your own setup. The same goes for C<m4>. Both options did not
really work well with C<Chess-Plisco>.
The solution was another Perl gimmick, so-called source code filters.
( run in 0.931 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )