This project is a fork of the pachi.git project. If you have that one already cloned locally, you can use
git clone --reference /path/to/your/pachi.git/incarnation mirror_URL
to save bandwidth during cloning.
descriptionPachiderm: Pachi Distributed Engine for Rapid Montecarlo
homepage URL
last changeSat, 22 Jan 2011 11:00:43 +0000 (22 12:00 +0100)
content tags
Pachi is two things: a simple modular framework for robots playing
the game of Go/Weiqi/Baduk, and a reasonably strong engine built
within this framework.


By default, Pachi currently uses the UCT engine that combines
monte-carlo approach with tree search; UCB1AMAF tree policy using
the RAVE method is used for tree search, while the Moggy playout
policy using 3x3 patterns and various tactical checks is used for
the random Monte-Carlo playouts.

The default engine plays by Chinese rules and should be about
2d KGS strength on 9x9. On 19x19, it might be about KGS 4k. Of couse,
this assumes reasonable hardware, e.g. four-threaded Core2 machine.

At the same time, various other approaches and tricks are being tried
and minor improvements have been achieved; they are enabled when they
give an universal playing strength boosts.

By default, Pachi will run on a single CPU core, taking up to 3GiB
of memory, not pondering, etc. You can adjust these parameters by
passing it extra command-line options:

	./zzgo -t _1200 threads=8,max_tree_size=500,fast_alloc

This will make Pachi play with time settings 20:00 S.D. (unless it
gets told otherwise over GTP), with 8 threads, taking up to 500MiB
of memory (+ several tens MiB as a constant overhead). 'fast_alloc'
is just a good idea to do in case of memory-sensitive runs (will become
default soon).

For now, there is no comprehensive documentation, but you can get
a pretty good idea by looking at the uct_state_init() function in
uct/uct.c - you will find the list of UCT engine options there, each
with a description.

Pachi can be used as a test opponent for development of other go-playing
programs. For example, to get the "plainest UCT" player, use:

	./zzgo -t =5000 policy=ucb1,playout=light,prior=eqex=0,dynkomi=none

This will fix the number of playouts per move to 5000, switch the node
selection policy from ucb1amaf to ucb1 (i.e. disable RAVE), switch the
playouts from heuristic-heavy moggy to uniformly random light, stop
prioring the node values heuristically, and turn off dynamic komi.

You can of course selectively re-enable various features or tweak this
further. But please note that using Pachi in this mode is not tested
extensively, so check its performance in whatever version you test
before you use it as a reference.

Note that even in this "basic UCT" mode, Pachi optimizes tree search
by considering board symmetries at the beginning. Currently, there's no
easy option to turn that off. The easiest way is to tweak board.c so
that board_symmetry_update() has goto break_symmetry at the beginning
and board_clear has board->symmetry.type = SYM_NONE.

Except UCT, Pachi supports a simple idiotbot-like engine and an example
treeless MonteCarlo-player. The MonteCarlo simulation ("playout")
policies are also pluggable, by default we use one that makes use of
heavy domain knowledge.

Special engines are also provided for development support:
* a simple "replay" engine that will simply play moves according
  to the playout policy suggestions


Pachi can also help you analyze your games, by being able to provide
its opinion on various positions. The user interface is very rudimentary,
but the ability is certainly there.

There are currently two Pachi interfaces for this purpose. One
possibility is to evaluate all moves within a given game and show how
the winrates for both players evolved - i.e. who was winning at which
game stage. This is implemented using the `` script. See
the comment on top of the script about its usage.

Alternatively, Pachi can evaluate all available moves in a given situation
and for each give a value between 0 and 1 representing perceived
likelihood of winning the game if one would play that move. I.e. it can
suggest which moves would be good and bad in a single given situation.

To achieve the latter, follow few simple steps:

1. Take an SGF record of your game and generate a GTP file from it:

	./ <file.sgf >file.gtp

2. Open the file.gtp in your favorite plaintext editor and trim it after
(remove all lines following) the move producing the situation you wish
to analyze.

3. Instead, add the following line at the bottom of file.gtp:

	0 uct_evaluate black

(replace `black` with `white` if it is white to play).

4. Run Pachi as follows:

	./zzgo -t =500 -d 0 <file.gtp | sed -n '/^=0/,${s/^=0 //;p}'

If you want to know more details on what is Pachi thinking about the
various moves, remove the `-d 0` and `| sed -n ...` parts. To improve
the accuracy of values (at the expense of run time), raise the value
of 500 (try 2000 or 10000; 100000 will usually already take couple of
hours). The values will be most useful in the middle game; in fuseki
and most yose situations, expect a lot of noise.


The aim of the framework is to make it easy to plug your engine
to the common infrastructure and implement your ideas while
minimalizing the overhead of implementing the GTP, speed-optimized
board tools, etc.  Also, there are premade random playout and UCT
tree engines, so that you can directly tweak only particular policies.
The infrastructure is pretty fast and it should be quite easy
to extend it to provide more facilities for your engine (but it should
be at the same time kept as simple as possible).


Pachi is distributed under the GPLv2 licence (see the COPYING file for
details and full text of the licence); you are welcome to tweak it as
you wish (contributing back upstream is welcome) and distribute
it freely, but only together with the source code. You are welcome
to make private modifications to the code (e.g. try new algorithms and
approaches), use them internally or even to have your bot play on the
internet and enter competitions, but as soon as you want to release it
to the public, you need to release the source code as well.

One exception is the Autotest framework, which is licenced under the
terms of the MIT licence (close to public domain) - you are free to
use it any way you wish.


To build Pachi, simply type:


Built zzgo binary (named that way from historical reasons) in the current
directory is a GTP client; use your favorite Go client to connect to it
(generally it should be possible to use it in place of GNU Go; the
command-line usage is however different), or use kgsGtp to connect to KGS;
DO NOT make it accessible directly to enemy users since the parser is
not secure - see the HACKING file for details.

The zzgo binary can take many parameters, as well as the particular
engine being used; the defaults should be fine for initial usage,
you will have to consult the sources for fine-tuning the parameters.

To build better optimized binary, type:

	make zzgo-profiled

This will also create binary zzgo, but while the build will take
more time (probably less than a minute anyway), the resulting binary
will be about 1/4 to 1/5 faster.
2011-01-22 Jean-loup GaillyMoggy: Better nlibrate default for 19x19master
2011-01-22 Jean-loup GaillyMerge branch 'master' into derm6
2011-01-22 Jean-loup GaillyBetter defaults for atari_def_no_hopeless, cfgd & local...
2011-01-22 Jean-loup GaillyDistributed engine: Wait more for late slaves at the...
2011-01-21 Jean-loup GaillyN-liberty semeai defensive tactics: Introduce, add...
2011-01-21 Jean-loup Gailly2lib check_group_atari() -> can_atari_group(), export
2011-01-21 Petr BaudisSelfatari three_liberty_suicide(): Fix d5c9b, do not...
2011-01-21 Petr BaudisSelfatari: Try to avoid bad moves of three-liberty...
2011-01-21 Petr BaudisTODO: Playouts - remove two implemented ideas, add...
2011-01-21 Petr Baudischeck_group_atari(): Use lumpiness guard only as prefer...
2011-01-21 Jean-loup GaillyRevert "Moggy ko check: Aside of connecting the ko...
2011-01-16 Jean-loup GaillyTODO: Support for different float types already done
2011-01-16 Jean-loup Gaillygtp_parse(): Do not clear the board on kgs-game_over
2011-01-16 Jean-loup GaillyDistributed engine: Do not forward unsupported gtp...
2011-01-16 Jean-loup GaillyMerge branch 'master' into derm6
2011-01-15 Petr BaudisMoggy defaults: Pattern2 on large board, turn off captu...
8 years ago atari
8 years ago derm7
8 years ago master