├── .gitignore ├── .mingw32_dlls ├── .mingw64_dlls ├── .travis.yml ├── ANDROID.txt ├── COPYING ├── CREDITS ├── HACKING ├── INSTALL.md ├── MORE.md ├── Makefile ├── Makefile.lib ├── Makefile.linux ├── Makefile.mac ├── Makefile.msys2 ├── PERFS ├── README.md ├── TODO ├── board.c ├── board.h ├── board_play.h ├── board_undo.c ├── board_undo.h ├── book.dat.bad ├── book.dat.extra ├── chat.c ├── chat.h ├── dcnn ├── Makefile ├── blunder.c ├── blunderscan.c ├── blunderscan.h ├── caffe.cpp ├── caffe.h ├── dcnn.c ├── dcnn.h ├── dcnn_engine.c └── dcnn_engine.h ├── debug.h ├── distributed ├── Makefile ├── distributed.c ├── distributed.h ├── merge.c ├── merge.h ├── protocol.c └── protocol.h ├── engine.c ├── engine.h ├── engines ├── Makefile ├── external.c ├── external.h ├── montecarlo.c ├── montecarlo.h ├── random.c ├── random.h ├── replay.c └── replay.h ├── fbook.c ├── fbook.h ├── fifo.c ├── fifo.h ├── fixp.h ├── genbuild ├── gogui.c ├── gogui.h ├── gtp.c ├── gtp.h ├── gtp ├── complete-tromptaylor.gtp ├── complete.gtp ├── genmove.gtp ├── genmove9.gtp ├── genmove_both.gtp └── spirit.gtp ├── joseki ├── Makefile ├── README ├── joseki.c ├── joseki.h ├── joseki_33.sgf ├── joseki_34.sgf ├── joseki_44.sgf ├── joseki_54.sgf ├── joseki_engine.c ├── joseki_engine.h ├── josekiload.c ├── josekiload.h └── sgfdump ├── joseki19.gtp ├── josekifix.gtp ├── josekifix ├── Makefile ├── README.md ├── fuseki.c ├── fusekifix.sgf ├── joseki_override.c ├── joseki_override.h ├── josekifix.sgf ├── josekifix_engine.c ├── josekifix_engine.h ├── josekifixload.c ├── josekifixload.h ├── josekifixscan.c ├── josekifixscan.h ├── katago │ ├── README │ ├── katago.cfg │ └── katago_build.patch ├── override.c ├── override.h ├── sgfdump ├── special_checks.c └── update_database ├── kgs └── kgsgtp-pachi.conf ├── media ├── NOTE ├── mini_pachi1.png ├── mini_pachi2.png ├── mini_pachi3.png ├── mini_pachis_by_chid0ri.jpg ├── pachi-med.jpg ├── pachi-small.png ├── pachi-square.png ├── pachi-square2.png ├── pachi-transp.png ├── pachi.jpg ├── screenshot_dcnn_colors.png ├── screenshot_josekifix_patterns.jpg ├── screenshot_josekifix_patterns_small.jpg ├── screenshot_lizzie.jpg ├── screenshot_lizzie_big.jpg ├── screenshot_sabaki.jpg └── screenshot_score_est.png ├── move.c ├── move.h ├── mq.h ├── network.c ├── network.h ├── ownermap.c ├── ownermap.h ├── pachi.c ├── pachi.h ├── pattern ├── Makefile ├── pattern.c ├── pattern.h ├── pattern_engine.c ├── pattern_engine.h ├── patternscan.c ├── patternscan.h ├── prob.c ├── prob.h ├── spatial.c ├── spatial.h └── training │ ├── README │ ├── byplayer │ ├── getdrops │ ├── mm │ ├── Makefile │ ├── README │ ├── example.dat │ └── mm.cpp │ ├── mm_games │ ├── mm_gammas │ ├── pattern3_show │ ├── spatial_gen │ └── spatial_show ├── pattern3.c ├── pattern3.h ├── patterns_mm.gamma ├── patterns_mm.spat ├── playout.c ├── playout.h ├── playout ├── Makefile ├── light.c ├── light.h ├── moggy.c └── moggy.h ├── random.c ├── random.h ├── spudfrog ├── stats.h ├── stone.c ├── stone.h ├── t-play ├── TESTS_OLD └── autotest │ ├── README │ ├── TODO │ ├── bin │ ├── autotest │ ├── autotest-client │ ├── autotest-clients │ ├── autotest-gather │ ├── autotest-lib │ ├── autotest-prune │ ├── autotest-rename │ ├── autotest-show │ ├── autotest-show-diagram │ ├── autotest-worker │ ├── hira │ ├── resum │ ├── runpachi │ └── test_in_context.sh │ └── rc ├── t-predict ├── Makefile ├── README ├── predict ├── predict.c ├── predict.h ├── stats_dcnn ├── stats_moggy └── stats_pattern ├── t-regress ├── .gitignore ├── Makefile ├── fixed │ ├── 4-4_reduce_3-3 │ │ ├── foo.gtp │ │ └── notes │ ├── 4-4_reduce_3-3_2 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_and_cap │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_and_cap2 │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── atari_and_cap3 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_and_cap4 │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── atari_and_cap5 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_and_cap6 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_and_cap7 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_ladder_big │ │ ├── bar.gtp │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_ladder_big2 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_ladder_big3 │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── atari_ladder_big4 │ │ ├── foo.gtp │ │ └── notes │ ├── atari_ladder_big5 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── atari_ladder_big6 │ │ ├── foo.gtp │ │ └── notes │ ├── atari_ladder_big7 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── bad_ko_fight │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── bent_three │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── big_capture │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── cut_dangerous │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── dead_stones │ │ ├── foo.gtp │ │ └── notes │ ├── dead_stones2 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── double_atari │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── double_atari2 │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── double_snapback │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── early_pass │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── eyefill │ │ ├── foo.gtp │ │ ├── game.sgf │ │ ├── game_move.gtp │ │ └── notes │ ├── first_line_blunder │ │ ├── foo.gtp │ │ └── notes │ ├── first_line_connect │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── first_line_connect2 │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── first_line_connect3 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── group_2lib_blunder │ │ ├── foo.gtp │ │ └── notes │ ├── influence_fuseki │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── influence_fuseki2 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── influence_fuseki3 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── influence_fuseki4 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── influence_fuseki5 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── influence_fuseki6 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── influence_fuseki7 │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── japanese_rules │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes │ ├── japanese_rules2 │ │ ├── foo.gtp │ │ └── notes │ ├── kill_3-3_invasion │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ ├── life_and_death_nakade │ │ ├── notes │ │ └── right_group.t │ ├── lost_ladder │ │ ├── foo.gtp │ │ ├── game.sgf │ │ └── notes │ └── wedge_line3 │ │ ├── foo.gtp │ │ ├── foo.sgf │ │ └── notes ├── nodcnn │ └── second_line_cap │ │ ├── foo.gtp │ │ ├── game.sgf │ │ ├── notes │ │ └── pattern.gtp ├── old │ ├── README │ ├── TODO │ ├── by-falseeye │ │ ├── 2011-06-05-Zen19-pachi2.sgf │ │ ├── 2011-06-05-tazaki-pachi30s.sgf │ │ ├── 2011-06-09-botkiller2-pachi30s.sgf │ │ ├── 2011-06-10-pachi30s-samba-2.sgf │ │ ├── 2011-06-18-dorabon-pachi2-4.sgf │ │ ├── 2011-07-28-pachi2-Novicer.sgf │ │ └── 2011-08-12-xiaosugi-pachi2.sgf │ ├── by-ko │ │ └── 2011-06-09-jinen-pachi30s-2.sgf │ ├── by-ladder │ │ ├── 2011-01-11-llopl-pachi2.sgf │ │ ├── 2011-06-06-tyzef-pachi30s.sgf │ │ ├── 2011-06-13-pachi30s-Jep.sgf │ │ ├── 2011-07-28-pachi2-pkunzip-2.sgf │ │ ├── 2011-08-08-Dallas-pachi2-2.sgf │ │ ├── 2011-08-09-pachi2-BlueSpark.sgf │ │ ├── 2011-08-09-somrak-pachi2-2.sgf │ │ ├── 2011-08-24-StoneGrid-pachi2.sgf │ │ ├── 2011-09-04-pachi2-stv.sgf │ │ └── 2012-03-16-IMC-pachi2.sgf │ ├── by-semeai │ │ ├── 2011-01-15-pachi2-rollingon.sgf │ │ ├── 2011-06-05-Zen19-pachi2.sgf │ │ ├── 2011-06-05-tazaki-pachi30s.sgf │ │ ├── 2011-06-18-dorabon-pachi2-4.sgf │ │ └── 2012-03-15-pachi2-Leech.sgf │ ├── dead_stones │ │ ├── board_full.gtp │ │ ├── board_full.sgf │ │ ├── japanese_rules.gtp │ │ ├── japanese_rules.sgf │ │ ├── test1.gtp │ │ ├── test1.sgf │ │ ├── test2.gtp │ │ ├── test2.sgf │ │ ├── unclear_group.gtp │ │ ├── unclear_group.sgf │ │ ├── unclear_group2.gtp │ │ ├── unclear_group2.sgf │ │ ├── unclear_group3.gtp │ │ ├── unclear_group3.sgf │ │ ├── unclear_group4.gtp │ │ ├── unclear_group4.sgf │ │ ├── unclear_group4_2.gtp │ │ ├── unclear_group4_2.sgf │ │ ├── unfinished_game.gtp │ │ ├── unfinished_game.sgf │ │ ├── unreliable.gtp │ │ └── unreliable.sgf │ ├── games │ │ ├── 2010-12-05-pachi-CzechBot.sgf │ │ ├── 2011-01-11-llopl-pachi2.sgf │ │ ├── 2011-01-15-pachi2-rollingon.sgf │ │ ├── 2011-06-05-Zen19-pachi2.sgf │ │ ├── 2011-06-05-tazaki-pachi30s.sgf │ │ ├── 2011-06-06-tyzef-pachi30s.sgf │ │ ├── 2011-06-07-fidibus-pachi30s.sgf │ │ ├── 2011-06-09-botkiller2-pachi30s.sgf │ │ ├── 2011-06-09-jinen-pachi30s-2.sgf │ │ ├── 2011-06-10-pachi30s-samba-2.sgf │ │ ├── 2011-06-13-pachi30s-Jep.sgf │ │ ├── 2011-06-18-dorabon-pachi2-4.sgf │ │ ├── 2011-07-28-pachi2-Novicer.sgf │ │ ├── 2011-07-28-pachi2-pkunzip-2.sgf │ │ ├── 2011-08-08-Dallas-pachi2-2.sgf │ │ ├── 2011-08-09-pachi2-BlueSpark.sgf │ │ ├── 2011-08-09-somrak-pachi2-2.sgf │ │ ├── 2011-08-12-xiaosugi-pachi2.sgf │ │ ├── 2011-08-24-StoneGrid-pachi2.sgf │ │ ├── 2011-09-04-pachi2-stv.sgf │ │ ├── 2012-01-17-pachi2-Soromon-3.sgf │ │ ├── 2012-03-15-pachi2-Leech.sgf │ │ ├── 2012-03-16-IMC-pachi2.sgf │ │ └── 2012-03-21-pachi2-Hujisawa-3.sgf │ └── test-game.sh ├── run_tests └── tofix │ ├── 3lib_capture │ ├── foo.gtp │ ├── game.sgf │ └── notes │ ├── 3lib_capture2 │ ├── foo.gtp │ └── notes │ ├── 3lib_capture3 │ ├── foo.gtp │ ├── foo.sgf │ └── notes │ ├── cut_dangerous2 │ ├── foo.gtp │ ├── foo.sgf │ ├── game.gtp │ └── notes │ ├── cut_dangerous3 │ ├── foo.gtp │ ├── game.sgf │ └── notes │ ├── dcnn_blind_spot │ ├── foo.gtp │ ├── game.sgf │ └── notes │ ├── dcnn_blind_spot2 │ ├── foo.gtp │ ├── game.sgf │ └── notes │ └── short_libs │ ├── foo.gtp │ ├── foo.sgf │ └── notes ├── t-unit ├── Makefile ├── README ├── atari.t ├── bent_four.t ├── blank.t ├── blank.t.gtp ├── board_regtest.c ├── board_undo.t ├── can_countercap.t ├── dcnn_blunder.t ├── external_engine.gtp ├── external_engine.ref ├── false_eye_seki.t ├── first_line_blunder.t ├── gtp_check ├── gtp_test.gtp ├── ladder.t ├── ladder_any.t ├── moggy.ref.bz2 ├── moggy.t ├── moggy_lifedeath.t ├── moggy_regtest.c ├── moggy_semeai.t ├── pass_is_safe.t ├── regtest.gtp ├── regtest.ref.bz2 ├── run_tests ├── runpachi ├── seki.t ├── selfatari.t ├── spatial.gtp ├── spatial.ref.bz2 ├── spatial_regtest.c ├── test.c ├── test.h ├── test_undo.c ├── test_virtual_loss ├── to_new_format ├── two_eyes.t ├── useful_ladder.t ├── wouldbe_ladder.t └── wouldbe_ladder_any.t ├── tactics ├── 1lib.c ├── 1lib.h ├── 2lib.c ├── 2lib.h ├── Makefile ├── dragon.c ├── dragon.h ├── ladder.c ├── ladder.h ├── nakade.c ├── nakade.h ├── nlib.c ├── nlib.h ├── seki.c ├── seki.h ├── selfatari.c ├── selfatari.h ├── util.c └── util.h ├── timeinfo.c ├── timeinfo.h ├── tools ├── autobook │ ├── README │ ├── autobook.sh │ ├── autobook2fbook.sh │ ├── eval.sh │ ├── expand.sh │ └── walk.sh ├── board_print_to_gtp ├── board_print_to_sgf ├── board_print_to_tunit ├── gentbook.sh ├── gtp2board_print ├── gtp2sgf ├── kgslog2gtp.pl ├── moggy_games ├── pachilog2gtp ├── sgf-analyse.pl ├── sgf-ratemove.sh ├── sgf2gtp.pl ├── sgf2gtp.py ├── sgflib │ ├── .gitignore │ ├── __init__.py │ ├── sgflib.py │ └── typelib.py └── twogtp.py ├── uct ├── Makefile ├── dynkomi.c ├── dynkomi.h ├── internal.h ├── plugin.h ├── plugins.c ├── plugins.h ├── plugins │ ├── Makefile │ ├── example.c │ └── wolf.c ├── policy.h ├── policy │ ├── Makefile │ ├── generic.c │ ├── generic.h │ ├── ucb1.c │ └── ucb1amaf.c ├── prior.c ├── prior.h ├── search.c ├── search.h ├── slave.c ├── slave.h ├── tree.c ├── tree.h ├── uct.c ├── uct.h ├── walk.c └── walk.h ├── util.c ├── util.h └── version.h /.gitignore: -------------------------------------------------------------------------------- 1 | gitversion.h 2 | .deps 3 | .*.swp 4 | \#*\# 5 | *~ 6 | *.o 7 | *.a 8 | *.prob 9 | *.spat 10 | *.log 11 | *.dat 12 | *.data 13 | *.prototxt 14 | *.trained 15 | *.caffemodel 16 | *.orig 17 | *.rej 18 | pachi 19 | pachi.??* 20 | tags 21 | TAGS 22 | -------------------------------------------------------------------------------- /.mingw32_dlls: -------------------------------------------------------------------------------- 1 | /mingw32/bin/libboost_system-mt.dll 2 | /mingw32/bin/libboost_thread-mt.dll 3 | /mingw32/bin/libcaffe.dll 4 | /mingw32/bin/libgcc_s_dw2-1.dll 5 | /mingw32/bin/libgflags.dll 6 | /mingw32/bin/libgfortran-4.dll 7 | /mingw32/bin/libglog.dll 8 | /mingw32/bin/libhdf5-0.dll 9 | /mingw32/bin/libhdf5_hl-0.dll 10 | /mingw32/bin/libopenblas.dll 11 | /mingw32/bin/libprotobuf.dll 12 | /mingw32/bin/libquadmath-0.dll 13 | /mingw32/bin/libstdc++-6.dll 14 | /mingw32/bin/libszip.dll 15 | /mingw32/bin/libwinpthread-1.dll 16 | /mingw32/bin/zlib1.dll 17 | -------------------------------------------------------------------------------- /.mingw64_dlls: -------------------------------------------------------------------------------- 1 | /mingw64/bin/libboost_system-mt.dll 2 | /mingw64/bin/libboost_thread-mt.dll 3 | /mingw64/bin/libcaffe.dll 4 | /mingw64/bin/libgcc_s_seh-1.dll 5 | /mingw64/bin/libgflags.dll 6 | /mingw64/bin/libgfortran-4.dll 7 | /mingw64/bin/libglog.dll 8 | /mingw64/bin/libhdf5-0.dll 9 | /mingw64/bin/libhdf5_hl-0.dll 10 | /mingw64/bin/libopenblas.dll 11 | /mingw64/bin/libprotobuf.dll 12 | /mingw64/bin/libquadmath-0.dll 13 | /mingw64/bin/libstdc++-6.dll 14 | /mingw64/bin/libszip.dll 15 | /mingw64/bin/libwinpthread-1.dll 16 | /mingw64/bin/zlib1.dll 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # http://docs.travis-ci.com/user/languages/c/ 2 | # start from https://github.com/rubinius/rubinius/blob/master/.travis.yml 3 | language: c 4 | sudo: required 5 | 6 | compiler: 7 | - clang 8 | - gcc 9 | os: 10 | - linux 11 | # - osx 12 | env: 13 | - DCNN=1 14 | - DCNN=0 15 | 16 | matrix: 17 | exclude: 18 | - os: osx 19 | env: DCNN=1 20 | - os: osx 21 | compiler: gcc 22 | # allow_failures: 23 | # - compiler: clang 24 | 25 | # get caffe from ppa 26 | before_install: 27 | - if [ "$TRAVIS_OS_NAME" = linux ] && [ "$DCNN" = 1 ]; then sudo add-apt-repository ppa:lemonsqueeze/pachi -y ; fi 28 | - if [ "$TRAVIS_OS_NAME" = linux ] && [ "$DCNN" = 1 ]; then sudo apt-get update -q ; fi 29 | - if [ "$TRAVIS_OS_NAME" = linux ] && [ "$DCNN" = 1 ]; then sudo apt-get install -y libcaffe-cpu-dev pachi-go-data; fi 30 | # XXX remove once pachi-data package is updated 31 | - if [ "$TRAVIS_OS_NAME" = linux ] && [ "$DCNN" = 1 ] && ! [ -f /usr/share/pachi-go/detlef54.prototxt ]; then sudo mv /usr/share/pachi-go/golast19.prototxt /usr/share/pachi-go/detlef54.prototxt; fi 32 | - if [ "$TRAVIS_OS_NAME" = linux ] && [ "$DCNN" = 1 ] && ! [ -f /usr/share/pachi-go/detlef54.trained ]; then sudo mv /usr/share/pachi-go/golast.trained /usr/share/pachi-go/detlef54.trained; fi 33 | 34 | # https://blog.lukaspradel.com/continuous-integration-for-cmake-projects-using-travis-ci/ 35 | script: 36 | - make -j2 DCNN=$DCNN BOARD_TESTS=1 DATADIR=/usr/share/pachi-go 37 | - make test 38 | -------------------------------------------------------------------------------- /ANDROID.txt: -------------------------------------------------------------------------------- 1 | #!/bin/false 2 | # To compile pachi for android phone, use the following or similar command: 3 | 4 | make \ 5 | CC=arm-linux-androideabi-gcc \ 6 | SYS_CFLAGS='-march=armv7-a -isysroot/opt/android-ndk/platforms/android-16/arch-arm' \ 7 | LIBS='-lc -ldl -lm' \ 8 | SYS_LDFLAGS='-pthread -B/opt/android-ndk/platforms/android-16/arch-arm/usr/lib/' 9 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | Pachi stands on the research shoulders of giants: 2 | 3 | Move Evaluation in Go using Deep Convolutional Neural Networks 4 | Chris J. Maddison, Aja Huang, Ilya Sutskever & David Silver 5 | 6 | Computing Elo Ratings of Move Patterns in the Game of Go 7 | Rémi Coulom 8 | 9 | Modification of UCT with Patterns in Monte-Carlo Go 10 | Sylvain Gelly, Yizao Wang, Remi Munos & Olivier Teytaud 11 | 12 | Combining Online and Offline Knowledge in UCT 13 | Sylvain Gelly, David Silver 14 | 15 | And many others... 16 | 17 | 18 | 19 | The 54% dcnn was trained by Detlef Schmicker and graciously shared 20 | with the computer-go community. 21 | 22 | 23 | 24 | Pachi contains unpublished methods we claim we have invented 25 | independently: 26 | 27 | * The dynamic komi feature. 28 | * The local tree feature. 29 | 30 | 31 | 32 | These people have made significant contributions to the code: 33 | 34 | Petr Baudis 35 | Pachi the Bot ;-) 36 | 37 | Jean-loup Gaily 38 | Distributed engine 39 | Time allocation algorithm 40 | Efficient UCT memory allocator 41 | 42 | Lemonsqueeze 43 | Seki, dcnn, mm patterns 44 | Raspberry Pi =) 45 | 46 | 47 | -------------------------------------------------------------------------------- /Makefile.mac: -------------------------------------------------------------------------------- 1 | COMMON_FLAGS += -DNO_THREAD_LOCAL 2 | LDFLAGS := -pthread -rdynamic 3 | LIBS := -lm -ldl 4 | DCNN_LIBS := -lcaffe -lopenblas -lboost_system -lglog -lstdc++ $(LIBS) 5 | 6 | 7 | strip: FORCE 8 | cd distribute && strip pachi 9 | -------------------------------------------------------------------------------- /book.dat.bad: -------------------------------------------------------------------------------- 1 | 9 E5 E3 C4 G3 | E7 2 | -------------------------------------------------------------------------------- /book.dat.extra: -------------------------------------------------------------------------------- 1 | 9 E5 E7 G6 | E3 2 | 9 E5 E7 G6 E3 | C6 3 | 9 E5 E7 G6 E3 C6 | C7 4 | 9 E5 E7 G6 E3 C6 C7 | D3 5 | 9 E5 E7 G6 E3 C6 C7 D3 | D2 6 | 9 E5 E7 G6 E3 C6 C7 D3 D2 | D4 7 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 | G4 8 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 D6 | C5 9 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 D6 C5 | G3 10 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 D6 C5 G3 | F8 11 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 D6 C5 G3 F8 | B6 12 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 D6 C5 G3 F8 B6 | C2 13 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 D6 C5 G3 F8 B6 C2 | E2 14 | 9 E5 E7 G6 E3 C6 C7 D3 D2 D4 D6 C5 G3 F8 B6 C2 E2 | E8 15 | 9 E5 E7 G6 E3 C4 | C3 16 | 9 E5 E7 G6 E3 C4 C3 | D4 17 | 9 E5 E7 G6 E3 C4 C3 D4 | D3 18 | 9 E5 E7 G6 E3 C4 C3 D4 D3 | C7 19 | 9 E5 E7 G6 E3 C4 C3 D4 D3 C7 | F6 20 | 9 E5 E7 G6 E3 C4 C3 D4 D3 C7 F6 | F5 21 | 9 E5 E7 G6 E3 C4 C3 D4 D3 C7 F6 F5 | G7 22 | 9 E5 E7 G6 E3 C4 C3 D4 D3 C7 F6 F5 G7 | G3 23 | 9 E5 E7 G5 | E3 24 | 9 E5 E7 G5 E3 | C5 25 | 9 E5 E7 G5 E3 C5 | C7 26 | 9 E5 E7 G5 E3 C5 C7 | C3 27 | 9 E5 E7 G5 E3 C5 C7 C3 | G3 28 | 9 E5 E7 G5 E3 C5 C7 C3 G3 | G7 29 | 9 E5 E7 G6 C6 | C4 30 | 9 E5 G5 | E3 31 | -------------------------------------------------------------------------------- /chat.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_CHAT_H 2 | #define PACHI_CHAT_H 3 | 4 | #include 5 | 6 | #include "stone.h" 7 | #include "move.h" 8 | 9 | void chat_init(char *chat_file); 10 | void chat_done(void); 11 | 12 | char *generic_chat(board_t *b, bool opponent, char *from, char *cmd, enum stone color, coord_t move, 13 | int playouts, int machines, int threads, double winrate, double extra_komi, char *score_est); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /dcnn/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | 3 | OBJS=caffe.o dcnn.o blunder.o dcnn_engine.o 4 | 5 | ifeq ($(EXTRA_ENGINES), 1) 6 | OBJS += blunderscan.o 7 | endif 8 | 9 | all: lib.a 10 | lib.a: $(OBJS) 11 | 12 | -include ../Makefile.lib 13 | -------------------------------------------------------------------------------- /dcnn/blunderscan.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_DCNN_BLUNDERSCAN_H 2 | #define PACHI_DCNN_BLUNDERSCAN_H 3 | 4 | #include "engine.h" 5 | 6 | void blunderscan_engine_init(engine_t *e, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /dcnn/caffe.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PACHI_CAFFE_H 3 | #define PACHI_CAFFE_H 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | bool caffe_ready(void); 11 | void caffe_init(int size, char *model, char *weights, char *name, int default_size); 12 | void caffe_done(void); 13 | void caffe_get_data(float *data, float *result, int size, int planes, int psize); 14 | 15 | #ifdef DCNN 16 | void quiet_caffe(int argc, char *argv[]); 17 | #else 18 | #define quiet_caffe(argc, argv) ((void)0) 19 | #endif 20 | 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif /* PACHI_CAFFE_H */ 27 | -------------------------------------------------------------------------------- /dcnn/dcnn_engine.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_ENGINES_DCNN_H 2 | #define PACHI_ENGINES_DCNN_H 3 | 4 | void dcnn_engine_init(engine_t *e, board_t *b); 5 | 6 | #endif /* PACHI_ENGINES_DCNN_H */ 7 | -------------------------------------------------------------------------------- /debug.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_DEBUG_H 2 | #define PACHI_DEBUG_H 3 | 4 | #include 5 | 6 | #ifdef DEBUG 7 | #define DEBUGL_(l, n) (unlikely((l) > (n))) 8 | #define DEBUG_MODE (true) 9 | #else 10 | #define DEBUGL_(l, n) (false) 11 | #define DEBUG_MODE (false) 12 | #endif 13 | 14 | extern int debug_level; 15 | extern int saved_debug_level; 16 | extern bool debug_boardprint; 17 | 18 | #define DEBUGL(n) DEBUGL_(debug_level, n) 19 | 20 | /* Temporarily turn off debugging */ 21 | #define DEBUG_QUIET() do { \ 22 | saved_debug_level = debug_level; \ 23 | debug_level = 0; \ 24 | } while (0) 25 | 26 | #define DEBUG_QUIET_END() do { \ 27 | debug_level = saved_debug_level; \ 28 | } while (0) 29 | 30 | #define QUIET(code) do { \ 31 | DEBUG_QUIET(); \ 32 | code; \ 33 | DEBUG_QUIET_END(); \ 34 | } while (0) 35 | 36 | 37 | /* The distributed engine can be _very_ verbose so use DEBUGV 38 | * to keep only the first N verbose logs. */ 39 | #ifndef MAX_VERBOSE_LOGS 40 | # define MAX_VERBOSE_LOGS 100000 41 | #endif 42 | extern long verbose_logs; 43 | #define DEBUGV(verbose, n) (DEBUGL(n) && (!(verbose) || ++verbose_logs < MAX_VERBOSE_LOGS)) 44 | #define DEBUGVV(n) DEBUGV(true, (n)) 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /distributed/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | OBJS=distributed.o protocol.o merge.o 3 | 4 | all: lib.a 5 | lib.a: $(OBJS) 6 | 7 | 8 | -include ../Makefile.lib 9 | -------------------------------------------------------------------------------- /distributed/merge.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_DISTRIBUTED_MERGE_H 2 | #define PACHI_DISTRIBUTED_MERGE_H 3 | 4 | #include "distributed/protocol.h" 5 | 6 | void merge_print_stats(int total_hnodes); 7 | void merge_init(slave_state_t *sstate, int shared_nodes, int stats_hbits, int max_slaves); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /engines/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | 3 | OBJS=montecarlo.o random.o replay.o 4 | 5 | ifeq ($(JOSEKIFIX), 1) 6 | OBJS+=external.o 7 | endif 8 | 9 | all: lib.a 10 | lib.a: $(OBJS) 11 | 12 | -include ../Makefile.lib 13 | -------------------------------------------------------------------------------- /engines/external.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_EXTERNAL_ENGINE_H 2 | #define PACHI_EXTERNAL_ENGINE_H 3 | 4 | #include "engine.h" 5 | 6 | void external_engine_init(engine_t *e, board_t *b); 7 | bool external_engine_started(engine_t *e); 8 | 9 | void external_engine_undo(engine_t *e); 10 | void external_engine_play(engine_t *e, coord_t c, enum stone color); 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /engines/montecarlo.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_MONTECARLO_MONTECARLO_H 2 | #define PACHI_MONTECARLO_MONTECARLO_H 3 | 4 | #include "engine.h" 5 | 6 | void montecarlo_engine_init(engine_t *e, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /engines/random.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "board.h" 5 | #include "engine.h" 6 | #include "move.h" 7 | #include "engines/random.h" 8 | 9 | static coord_t 10 | random_genmove(engine_t *e, board_t *b, time_info_t *ti, enum stone color, bool pass_all_alive) 11 | { 12 | /* Play a random coordinate. However, we must also guard 13 | * against suicide moves; repeat playing while it's a suicide 14 | * unless we keep suiciding; in that case, we probably don't 15 | * have any other moves available and we pass. */ 16 | coord_t coord; 17 | int i = 0; bool suicide = false; 18 | 19 | do { 20 | /* board_play_random() actually plays the move too; 21 | * this is desirable for MC simulations but not within 22 | * the genmove. Make a scratch new board for it. */ 23 | board_t b2; 24 | board_copy(&b2, b); 25 | 26 | board_play_random(&b2, color, &coord, NULL, NULL); 27 | 28 | suicide = (coord != pass && !group_at(&b2, coord)); 29 | board_done(&b2); 30 | } while (suicide && i++ < 100); 31 | 32 | return (suicide ? pass : coord); 33 | } 34 | 35 | void 36 | random_engine_init(engine_t *e, board_t *b) 37 | { 38 | e->name = "RandomMove"; 39 | e->comment = "I just make random moves. I won't pass as long as there is a place on the board where I can play. When we both pass, I will consider all the stones on the board alive."; 40 | e->genmove = random_genmove; 41 | 42 | if (e->options.n) 43 | die("Random: I support no engine arguments\n"); 44 | } 45 | -------------------------------------------------------------------------------- /engines/random.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_RANDOM_RANDOM_H 2 | #define PACHI_RANDOM_RANDOM_H 3 | 4 | #include "engine.h" 5 | 6 | void random_engine_init(engine_t *e, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /engines/replay.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_REPLAY_REPLAY_H 2 | #define PACHI_REPLAY_REPLAY_H 3 | 4 | #include "engine.h" 5 | 6 | coord_t replay_sample_moves(engine_t *e, board_t *b, enum stone color, 7 | int *played, int *pmost_played); 8 | void replay_engine_init(engine_t *e, board_t *b); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /fbook.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_FBOOK_H 2 | #define PACHI_FBOOK_H 3 | 4 | #include "move.h" 5 | 6 | /* Opening book (fbook as in "forcing book" since the move is just 7 | * played unconditionally if found, or possibly "fuseki book"). */ 8 | 9 | typedef struct fbook { 10 | int bsize; 11 | int handicap; 12 | 13 | int movecnt; 14 | 15 | #define fbook_hash_bits 20 // 12M w/ 32-bit coord_t 16 | #define fbook_hash_mask ((1 << fbook_hash_bits) - 1) 17 | /* pass == no move in this position */ 18 | coord_t moves[1< 10 | 11 | typedef uint_fast32_t fixp_t; 12 | 13 | /* We should accomodate at least 0..131072 (17bits) in the whole number 14 | * portion; assuming at least 32bit integer, that leaves us with 15-bit 15 | * fractional part. Thankfully, we need only unsigned values. */ 16 | #define FIXP_BITS 15 17 | 18 | #define FIXP_SCALE (1<&1 | grep cc1 | head -1 | tr -d '\\"' ) 21 | 22 | # Target: try -march first 23 | if echo "$cc1" | grep -q "march="; then 24 | target=`echo "$cc1" | sed -e 's/.*-march=\([^ ]*\).*/\1/' ` 25 | else # -mcpu then ? 26 | target=`echo "$cc1" | grep 'mcpu=' | sed -e 's/.*-mcpu=\([^ ]*\).*/\1/' ` 27 | fi 28 | # XXX clang 29 | 30 | CFLAGS=$( echo "$CFLAGS" | tr -d '\\"' ) 31 | 32 | echo "#define PACHI_BUILD_DATE \"$date\"" 33 | echo "#define PACHI_BUILD_TARGET \"$target\"" 34 | echo "#define PACHI_CFLAGS \"$CFLAGS\"" 35 | echo "#define PACHI_COMPILER \"$compiler\"" 36 | echo "#define PACHI_CC1 \"$cc1\"" 37 | -------------------------------------------------------------------------------- /gtp/complete-tromptaylor.gtp: -------------------------------------------------------------------------------- 1 | boardsize 9 2 | komi 7.5 3 | clear_board 4 | play B f5 5 | play W d7 6 | play B e6 7 | play W c5 8 | play B e7 9 | play W d3 10 | play B e8 11 | play W f3 12 | play B e3 13 | play W g4 14 | play B f4 15 | play W e4 16 | play B e2 17 | play W d4 18 | play B g3 19 | play W h4 20 | play B f2 21 | play W g6 22 | play B d8 23 | play W d6 24 | play B e5 25 | play W d5 26 | play B d2 27 | play W g5 28 | play B c8 29 | play W f7 30 | play B c2 31 | play W f8 32 | play B c7 33 | play W e9 34 | play B b6 35 | play W d9 36 | play B b5 37 | play W c9 38 | play B b7 39 | play W h3 40 | play B g2 41 | play W h2 42 | play B a8 43 | play W g1 44 | play B b4 45 | play W f1 46 | play B e1 47 | play W h1 48 | play B a7 49 | play W b9 50 | play B b2 51 | play W a9 52 | play B a4 53 | play W f9 54 | play B a6 55 | play W pass 56 | play B a3 57 | play W pass 58 | play B a5 59 | play W pass 60 | play B a2 61 | play W pass 62 | play B a1 63 | play W pass 64 | play B c3 65 | play W pass 66 | play B pass 67 | -------------------------------------------------------------------------------- /gtp/genmove.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 7.5 4 | play b q16 5 | genmove w 6 | -------------------------------------------------------------------------------- /gtp/genmove9.gtp: -------------------------------------------------------------------------------- 1 | boardsize 9 2 | clear_board 3 | komi 7.5 4 | play b e5 5 | genmove w 6 | -------------------------------------------------------------------------------- /gtp/genmove_both.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 7.5 4 | genmove b 5 | genmove w 6 | -------------------------------------------------------------------------------- /gtp/spirit.gtp: -------------------------------------------------------------------------------- 1 | # Spirit-gman KGS 2007-03-07 19:14 2 | boardsize 9 3 | komi 0.5 4 | clear_board 5 | play b d6 6 | play w d3 7 | play b d4 8 | play w c4 9 | # !! 10 | play b e3 11 | play w e2 12 | # !! 13 | play b c3 14 | play w d2 15 | play b c5 16 | play w b4 17 | # !! 18 | play b e7 19 | play w g5 20 | # !! do you see e4 reply? 21 | play b f2 22 | play w e4 23 | play b f7 24 | play w b5 25 | play b d5 26 | play w f3 27 | play b b6 28 | play w h7 29 | play b b3 30 | play w b2 31 | play b g6 32 | play w h6 33 | # this should be better a4 34 | play b a3 35 | play w a2 36 | # !! are we seeing the a2 atari threat? 37 | play b h5 38 | -------------------------------------------------------------------------------- /joseki/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | 3 | OBJS := joseki.o joseki_engine.o josekiload.o 4 | 5 | SGF = joseki_44.sgf joseki_34.sgf joseki_54.sgf joseki_33.sgf 6 | 7 | # don't build data by default, trips automated build systems 8 | all: lib.a 9 | 10 | data: ../joseki19.gtp 11 | 12 | ../joseki19.gtp: $(SGF) 13 | @echo -n "" > $@.tmp 14 | @for f in $(SGF); do \ 15 | printf "\n$$f\n"; \ 16 | ./sgfdump $$f >> $@.tmp || exit 1 ; \ 17 | done 18 | @mv $@.tmp $@ 19 | @echo wrote $@ 20 | 21 | all: lib.a 22 | lib.a: $(OBJS) 23 | 24 | 25 | -include ../Makefile.lib 26 | -------------------------------------------------------------------------------- /joseki/joseki_33.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Chinese]SZ[19]KM[5.50] 3 | PW[White]PB[Black] 4 | ;B[qc]C[] 5 | (;W[pd] 6 | ;B[qd] 7 | ;W[pe] 8 | ;B[ob] 9 | (;W[md] 10 | ;B[rf] 11 | ;W[ph]) 12 | (;W[qe] 13 | (;B[nd] 14 | ;W[qi]) 15 | (;B[pi] 16 | ;W[md]))) 17 | (;W[nd] 18 | ;B[pf] 19 | ;W[jc] 20 | ;B[qj]) 21 | (;W[oc] 22 | (;B[pe] 23 | (;W[md] 24 | ;B[qi] 25 | ;W[ic]) 26 | (;W[lc] 27 | ;B[qi] 28 | ;W[oe])) 29 | (;B[qf] 30 | ;W[lc]))) 31 | -------------------------------------------------------------------------------- /joseki/joseki_engine.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "board.h" 6 | #include "debug.h" 7 | #include "engine.h" 8 | #include "move.h" 9 | #include "joseki.h" 10 | #include "joseki_engine.h" 11 | 12 | static void 13 | joseki_engine_best_moves(engine_t *e, board_t *b, time_info_t *ti, enum stone color, 14 | coord_t *best_c, float *best_r, int nbest) 15 | { 16 | coord_t coords[BOARD_MAX_COORDS]; 17 | float ratings[BOARD_MAX_COORDS]; 18 | int matches = joseki_list_moves(joseki_dict, b, color, coords, ratings); 19 | 20 | get_joseki_best_moves(b, coords, ratings, matches, best_c, best_r, nbest); 21 | print_joseki_best_moves(b, best_c, best_r, nbest); 22 | } 23 | 24 | static coord_t 25 | joseki_engine_genmove(engine_t *e, board_t *b, time_info_t *ti, enum stone color, bool pass_all_alive) 26 | { 27 | coord_t best_c[20]; 28 | float best_r[20]; 29 | joseki_engine_best_moves(e, b, ti, color, best_c, best_r, 20); 30 | 31 | return best_c[0]; 32 | } 33 | 34 | void 35 | joseki_engine_init(engine_t *e, board_t *b) 36 | { 37 | e->name = "Joseki"; 38 | e->comment = "I select joseki moves blindly, if there are none i just pass."; 39 | e->genmove = joseki_engine_genmove; 40 | e->best_moves = joseki_engine_best_moves; 41 | } 42 | -------------------------------------------------------------------------------- /joseki/joseki_engine.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_JOSEKI_ENGINE_H 2 | #define PACHI_JOSEKI_ENGINE_H 3 | 4 | #include "engine.h" 5 | 6 | void joseki_engine_init(engine_t *e, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /joseki/josekiload.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_JOSEKILOAD_H 2 | #define PACHI_JOSEKILOAD_H 3 | 4 | #include "engine.h" 5 | 6 | void josekiload_engine_init(engine_t *e, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /josekifix/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | 3 | OBJS = override.o 4 | SGF = josekifix.sgf fusekifix.sgf 5 | 6 | ifeq ($(JOSEKIFIX), 1) 7 | OBJS += fuseki.o joseki_override.o josekifix_engine.o josekifixload.o special_checks.o 8 | 9 | ifeq ($(EXTRA_ENGINES), 1) 10 | OBJS += josekifixscan.o 11 | endif 12 | endif 13 | 14 | 15 | # don't build data by default, trips automated build systems 16 | all: lib.a 17 | 18 | data: ../josekifix.gtp 19 | 20 | # update database: get latest josekifix.sgf from github, and regen josekifix.gtp 21 | update: FORCE 22 | ./update_database 23 | @make data 24 | 25 | 26 | # Generate josekifix.gtp from josekifix.sgf 27 | ../josekifix.gtp: $(SGF) 28 | @echo -n "" > $@.tmp 29 | @for f in $(SGF); do \ 30 | echo "$$f"; \ 31 | ./sgfdump $$f >> $@.tmp || exit 1 ; \ 32 | done 33 | @mv $@.tmp $@ 34 | @echo wrote $@ 35 | 36 | lib.a: $(OBJS) 37 | 38 | FORCE: 39 | 40 | 41 | -include ../Makefile.lib 42 | -------------------------------------------------------------------------------- /josekifix/josekifix_engine.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_JOSEKIFIX_ENGINE_H 2 | #define PACHI_JOSEKIFIX_ENGINE_H 3 | 4 | #ifdef JOSEKIFIX 5 | 6 | #include "engine.h" 7 | 8 | extern char *external_joseki_engine_cmd; 9 | extern char *katago_config; 10 | extern char *katago_model; 11 | extern bool modern_joseki; 12 | extern bool external_joseki_engine_genmoved; 13 | 14 | 15 | void josekifix_engine_init(engine_t *e, board_t *b); 16 | 17 | coord_t external_joseki_engine_genmove(board_t *b); 18 | engine_t* josekifix_engine_if_needed(engine_t *uct, board_t *b); 19 | 20 | /* For josekifixscan engine */ 21 | void set_fake_external_joseki_engine(void); 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /josekifix/josekifixload.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_JOSEKIFIXLOAD_H 2 | #define PACHI_JOSEKIFIXLOAD_H 3 | 4 | #ifdef JOSEKIFIX 5 | 6 | #include "engine.h" 7 | #include "josekifix/joseki_override.h" 8 | 9 | extern joseki_override_t *joseki_overrides; 10 | extern joseki_override2_t *joseki_overrides2; 11 | extern joseki_override_t *logged_variations; 12 | extern joseki_override2_t *logged_variations2; 13 | 14 | void josekifixload_engine_init(engine_t *e, board_t *b); 15 | 16 | bool josekifix_load(void); 17 | 18 | 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /josekifix/josekifixscan.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_DCNN_JOSEKIFIXSCAN_H 2 | #define PACHI_DCNN_JOSEKIFIXSCAN_H 3 | 4 | #include "engine.h" 5 | 6 | void josekifixscan_engine_init(engine_t *e, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /josekifix/katago/README: -------------------------------------------------------------------------------- 1 | [ KataGo Setup ] 2 | 3 | Example KataGo setup to use as external joseki engine. 4 | 5 | This is intended for Raspberry Pi (cpu build), so using small network and few visits. 6 | Desktop can use 15 block model and more playouts, especially with AVX support. 7 | Feel free to experiment with other networks / settings. 8 | 9 | - Models: 10 | 11 | Models are from the [extended training](https://github.com/lightvector/KataGo/blob/master/TrainingHistory.md) run: 12 | They are small models which have been trained beyond their normal scope, 13 | they do very well for their size (much better than other models of similar size). 14 | 15 | 10 block model: [g170e-b10c128-s1141046784-d204142634.bin.gz](https://katagoarchive.org/g170/neuralnets/g170e-b10c128-s1141046784-d204142634.bin.gz) 16 | 15 block model: [g170e-b15c192-s1672170752-d466197061.bin.gz](https://katagoarchive.org/g170/neuralnets/g170e-b15c192-s1672170752-d466197061.bin.gz) 17 | 18 | - Config: 19 | 20 | Options you might want to change are numSearchThreads (number of search threads) (not 21 | automatically set to your number of cpu cores) and maxPlayouts for thinking time. 22 | -------------------------------------------------------------------------------- /josekifix/override.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_JOSEKIFIX_OVERRIDE_H 2 | #define PACHI_JOSEKIFIX_OVERRIDE_H 3 | 4 | /* Simple overrides 5 | * 6 | * Allows to match board situation based on spatial pattern around last move to for example, 7 | * detect certain joseki or fuseki sequences no matter in which corner/board orientation/color 8 | * they are played. 9 | * 10 | * joseki_override.h has extra logic for matching joseki sequences (ladder checks etc). 11 | * 12 | * Overrides can either specify next move ("just override this move"), or leave it as "pass" 13 | * to let an external joseki engine take over the following sequence in this quadrant. 14 | */ 15 | 16 | /* Overrides are represented by this struct. 17 | * matching is based on: 18 | * - last move 19 | * - spatial pattern (radius 5) around last move (or a given coord near it) 20 | * 21 | * Coords are just stored as strings: we really don't care about performance here (few 22 | * entries, running once at the end of genmove) and makes it easy to initialize override 23 | * structs in code where special handling / experiment is called for. */ 24 | typedef struct { 25 | /* mandatory fields */ 26 | char* prev; /* last move */ 27 | char* next; /* wanted next move. "pass" = external joseki engine mode (see below) */ 28 | char* name; /* override name (joseki line, fuseki name ...) */ 29 | hash_t hashes[8]; /* spatial hashes for all 8 rotations */ 30 | 31 | /* optional fields */ 32 | char* coord; /* match pattern around this location instead of last move. */ 33 | } override_t; 34 | 35 | #define josekifix_spatial_hash(b, coord, color) spatial_hash_from_board(b, coord, color, MAX_PATTERN_DIST) 36 | #define josekifix_spatial_hash_rot(b, coord, color, rot) spatial_hash_from_board_rot(b, coord, color, rot, MAX_PATTERN_DIST) 37 | 38 | 39 | /* Low level override matching */ 40 | coord_t check_override(struct board *b, override_t *override, int *prot, hash_t lasth, char *title); 41 | coord_t check_overrides(struct board *b, override_t overrides[], hash_t lasth, char *title); 42 | coord_t check_override_rot(struct board *b, override_t *override, int rot, hash_t lasth); 43 | 44 | bool sane_override_move(struct board *b, coord_t c, char *name, char *title); 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /josekifix/special_checks.c: -------------------------------------------------------------------------------- 1 | 2 | #define DEBUG 3 | #include "board.h" 4 | #include "engine.h" 5 | #include "pattern/spatial.h" 6 | #include "josekifix/override.h" 7 | #include "josekifix/joseki_override.h" 8 | 9 | 10 | /* 6 | . . . . . . . 11 | * 5 | . . . . . . . 3-3 invasion 12 | * 4 | . * . O . . . If we own everything around here, try to kill. 13 | * 3 | . . X). . O . 14 | * 2 | . . . . . . . Ex: t-regress/kill_3-3_invasion 15 | * 1 | . . . . . . . 16 | * +--------------- 17 | * A B C D E F G */ 18 | coord_t 19 | josekifix_kill_3_3_invasion(struct board *b, struct ownermap *prev_ownermap, 20 | hash_t lasth) 21 | { 22 | enum stone our_color = stone_other(last_move(b).color); 23 | override_t override = { .coord = "B2", .prev = "C3", "B4", "", { 0xfb50710e59804023, 0x7fefef0db770bf17, 0xef77e916af17fb33, 0x255a0304dbe9fd17, 24 | 0x41fad91638b3a0eb, 0xe04691d5dc8ef2f, 0x8e93b792ac2f9dfb, 0x79549dde6309036f } }; 25 | int rot; 26 | coord_t c = check_override(b, &override, &rot, lasth, "joseki_override"); 27 | if (is_pass(c)) return c; 28 | 29 | /* Corner and side owned by us in prev ownermap ? 30 | * Check ownermap pattern around c = B4 */ 31 | int cx = coord_x(c); int cy = coord_y(c); 32 | for (unsigned int d = 2; d <= MAX_PATTERN_DIST; d++) { 33 | for (unsigned int j = ptind[d]; j < ptind[d + 1]; j++) { 34 | ptcoords_at(x, y, cx, cy, j); 35 | coord_t c2 = coord_xy(x, y); 36 | if (board_at(b, c2) == S_OFFBOARD) continue; 37 | 38 | if (our_color != ownermap_color(prev_ownermap, c2, 0.67)) 39 | return pass; 40 | } 41 | } 42 | 43 | josekifix_log("joseki_override: %s (%s)\n", coord2sstr(c), "kill 3-3 invasion"); 44 | return c; 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /josekifix/update_database: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # get latest joseki fixes database from github. 3 | # most up-to-date version is in 'joseki_fixes' branch. 4 | 5 | if ! [ -f update_database ]; then 6 | echo "update_database: must run in josekifix/ directory" 7 | exit 1 8 | fi 9 | 10 | echo "Getting latest version of josekifix.sgf, fusekifix.sgf ..." 11 | echo " https://github.com/pasky/pachi/tree/joseki_fixes" 12 | echo "" 13 | 14 | for file in josekifix.sgf fusekifix.sgf; do 15 | [ -f $file ] && cp $file $file.bak # backup existing 16 | 17 | if wget -q -O $file "https://github.com/pasky/pachi/raw/joseki_fixes/$file"; then 18 | if [ -f $file.bak ] && cmp -s $file $file.bak; then 19 | echo "$file: already up-to-date" 20 | else 21 | echo "$file: updated to latest version" 22 | fi 23 | else 24 | echo "failed to download $file (network failure ?)" 25 | fi 26 | done 27 | 28 | echo "" 29 | 30 | -------------------------------------------------------------------------------- /kgs/kgsgtp-pachi.conf: -------------------------------------------------------------------------------- 1 | # Run kgsGTP in the directory where Pachi lives. 2 | # On Windows, maybe you will need to replace ./pachi with pachi.exe. 3 | # 4 | # For time settings you can either let Pachi play by kgs time settings 5 | # or pass -t option to override it: for example -t 5 for max 5s per move, 6 | # -t =5000 for fixed number of playouts etc. 7 | # 8 | # If you want kgs-chat command support you need kgsGtp-3.5.11 and pass 9 | # --kgs-chat option to pachi. Later kgsGtp versions don't handle it. 10 | # 11 | # For ranked games you want joseki fixes working, otherwise it will get 12 | # abused with all kinds of trick plays, messing up kgs ratings. 13 | # Game start message should show if they are disabled. 14 | # 15 | 16 | engine=./pachi --kgs --josekifix -t =5000:15000 -o pachi.log resign_threshold=0.25 17 | name=KGSNAME 18 | password=PASSWORD 19 | room=Computer Go 20 | mode=custom 21 | gameNotes=Pachi Pachi Pachi! 22 | talk=Hi, I'm a bot. Have fun ! 23 | rules=japanese 24 | rules.boardSize=19 25 | rules.time=1:00+5x0:30 # japanese byoyomi 26 | # rules.time=1:00+25/5:00 # canadian byoyomi 27 | verbose=t 28 | reconnect=f 29 | undo=f 30 | hint.cleanup=We apparently do not agree about dead stones. Please undo your last pass move and capture all dead stones. It will not cost you points (chinese rules). 31 | hint.noArguing=We apparently do not agree about dead stones. Please undo your last move and clarify the situation or accept the engine's choice. If you think the engine is wrong, please contact its author. 32 | -------------------------------------------------------------------------------- /media/NOTE: -------------------------------------------------------------------------------- 1 | 2 | Pachi artwork by chid0ri: 3 | https://chid0.deviantart.com/art/Pachi-the-bot-98877096 4 | https://chid0.deviantart.com/art/e3a-minis-pachi-edition-180916130 5 | 6 | -------------------------------------------------------------------------------- /media/mini_pachi1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/mini_pachi1.png -------------------------------------------------------------------------------- /media/mini_pachi2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/mini_pachi2.png -------------------------------------------------------------------------------- /media/mini_pachi3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/mini_pachi3.png -------------------------------------------------------------------------------- /media/mini_pachis_by_chid0ri.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/mini_pachis_by_chid0ri.jpg -------------------------------------------------------------------------------- /media/pachi-med.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/pachi-med.jpg -------------------------------------------------------------------------------- /media/pachi-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/pachi-small.png -------------------------------------------------------------------------------- /media/pachi-square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/pachi-square.png -------------------------------------------------------------------------------- /media/pachi-square2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/pachi-square2.png -------------------------------------------------------------------------------- /media/pachi-transp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/pachi-transp.png -------------------------------------------------------------------------------- /media/pachi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/pachi.jpg -------------------------------------------------------------------------------- /media/screenshot_dcnn_colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/screenshot_dcnn_colors.png -------------------------------------------------------------------------------- /media/screenshot_josekifix_patterns.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/screenshot_josekifix_patterns.jpg -------------------------------------------------------------------------------- /media/screenshot_josekifix_patterns_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/screenshot_josekifix_patterns_small.jpg -------------------------------------------------------------------------------- /media/screenshot_lizzie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/screenshot_lizzie.jpg -------------------------------------------------------------------------------- /media/screenshot_lizzie_big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/screenshot_lizzie_big.jpg -------------------------------------------------------------------------------- /media/screenshot_sabaki.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/screenshot_sabaki.jpg -------------------------------------------------------------------------------- /media/screenshot_score_est.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/media/screenshot_score_est.png -------------------------------------------------------------------------------- /move.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_MOVE_H 2 | #define PACHI_MOVE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "util.h" 9 | #include "stone.h" 10 | 11 | typedef int coord_t; 12 | 13 | // XXX board_size() instead of board_statics.size 14 | #define coord_xy(x, y) ((x) + (y) * the_board_stride()) 15 | #define coord_x(c) (board_statics.coord[c][0]) 16 | #define coord_y(c) (board_statics.coord[c][1]) 17 | /* TODO: Smarter way to do this? */ 18 | #define coord_dx(c1, c2) (coord_x(c1) - coord_x(c2)) 19 | #define coord_dy(c1, c2) (coord_y(c1) - coord_y(c2)) 20 | 21 | #define pass -1 22 | #define resign -2 23 | #define is_pass(c) (c == pass) 24 | #define is_resign(c) (c == resign) 25 | 26 | #define coord_is_adjecent(c1, c2) (abs(c1 - c2) == 1 || abs(c1 - c2) == the_board_stride()) 27 | #define coord_is_8adjecent(c1, c2) (abs(c1 - c2) == 1 || abs(abs(c1 - c2) - the_board_stride()) < 2) 28 | 29 | char *coord2bstr(char *buf, coord_t c); 30 | /* Return coordinate string in a dynamically allocated buffer. Thread-safe. */ 31 | char *coord2str(coord_t c); 32 | /* Return coordinate string in a static buffer; multiple buffers are shuffled 33 | * to enable use for multiple printf() parameters, but it is NOT safe for 34 | * anything but debugging - in particular, it is NOT thread-safe! */ 35 | char *coord2sstr(coord_t c); 36 | coord_t str2coord(char *str); 37 | coord_t str2coord_for(char *str, int size); 38 | /* Rotate coordinate according to rot: [0-7] for 8 board symmetries. */ 39 | coord_t rotate_coord(coord_t c, int rot); 40 | /* Check string coord is valid for current board. */ 41 | bool valid_coord(char *s); 42 | 43 | typedef struct { 44 | coord_t coord; 45 | enum stone color; 46 | } move_t; 47 | 48 | #define move(coord, color) { coord, color } 49 | 50 | static inline int 51 | move_cmp(move_t *m1, move_t *m2) 52 | { 53 | if (m1->color != m2->color) 54 | return m1->color - m2->color; 55 | return m1->coord - m2->coord; 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /network.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_NETWORK_H 2 | #define PACHI_NETWORK_H 3 | 4 | #ifdef NETWORK 5 | 6 | #ifdef _WIN32 7 | #include 8 | #else 9 | #include 10 | #endif 11 | 12 | void network_init(char* gtp_port); 13 | int port_listen(char *port, int max_connections); 14 | int open_server_connection(int socket, struct in_addr *client); 15 | void open_log_port(char *port); 16 | void open_gtp_connection(int *socket, char *port); 17 | 18 | #else 19 | 20 | #define network_init(gtp_port) 21 | #define port_listen(port, max_conn) die("network code not compiled in, enable NETWORK in Makefile\n"); 22 | #define open_server_connection(s, c) die("network code not compiled in, enable NETWORK in Makefile\n"); 23 | #define open_log_port(port) die("network code not compiled in, enable NETWORK in Makefile\n"); 24 | #define open_gtp_connection(socket, port) die("network code not compiled in, enable NETWORK in Makefile\n"); 25 | 26 | #endif /* NETWORK */ 27 | 28 | #endif /* PACHI_NETWORK_H */ 29 | -------------------------------------------------------------------------------- /pachi.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_PACHI_H 2 | #define PACHI_PACHI_H 3 | 4 | #include 5 | #include "gtp.h" 6 | 7 | struct board; 8 | struct engine; 9 | 10 | /* Global options */ 11 | typedef struct { 12 | bool kgs; 13 | bool nopassfirst; /* don't pass first when playing chinese */ 14 | bool guess_unclear_groups; /* ok to guess unclear dead groups ? (smart pass) */ 15 | bool tunit_fatal; /* abort on failed t-unit test */ 16 | enum rules forced_rules; 17 | } pachi_options_t; 18 | 19 | /* Get global options */ 20 | const pachi_options_t *pachi_options(); 21 | 22 | /* Get main engine */ 23 | struct engine *pachi_main_engine(void); 24 | 25 | /* Free globals */ 26 | void pachi_done(); 27 | 28 | /* Pachi binary */ 29 | extern char *pachi_exe; 30 | extern char *pachi_dir; 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /pattern/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | 3 | OBJS := pattern.o pattern_engine.o prob.o spatial.o 4 | 5 | ifeq ($(EXTRA_ENGINES), 1) 6 | OBJS += patternscan.o 7 | endif 8 | 9 | all: lib.a 10 | lib.a: $(OBJS) 11 | 12 | -include ../Makefile.lib 13 | -------------------------------------------------------------------------------- /pattern/pattern_engine.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_PATTERN_ENGINE_H 2 | #define PACHI_PATTERN_ENGINE_H 3 | 4 | #include "engine.h" 5 | #include "pattern/pattern.h" 6 | 7 | void pattern_engine_init(engine_t *e, board_t *b); 8 | pattern_config_t *pattern_engine_get_pc(engine_t *e); 9 | bool pattern_engine_matched_locally(engine_t *e); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /pattern/patternscan.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_PATTERNSCAN_H 2 | #define PACHI_PATTERNSCAN_H 3 | 4 | #include "engine.h" 5 | 6 | void patternscan_engine_init(engine_t *e, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /pattern/prob.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_PATTERNPROB_H 2 | #define PACHI_PATTERNPROB_H 3 | 4 | #include 5 | 6 | #include "board.h" 7 | #include "move.h" 8 | #include "pattern/pattern.h" 9 | 10 | /* Find pattern probability by dividing it into individual features 11 | * and using Rémi MM formula. The probability table has one gamma for 12 | * each possible feature. */ 13 | 14 | typedef struct { 15 | floating_t *gamma_table; /* [pattern_gammas()] */ 16 | feature_t *feature_table; /* [pattern_gammas()] */ 17 | } prob_dict_t; 18 | 19 | /* The patterns probability dictionary */ 20 | extern prob_dict_t *prob_dict; 21 | 22 | 23 | /* Initialize the prob_dict data structure from a given file (pass NULL 24 | * to use default filename). */ 25 | void prob_dict_init(char *filename); 26 | 27 | /* Free patterns probability dictionary. */ 28 | void prob_dict_done(); 29 | 30 | /* Get pattern probabilities for all possible moves. 31 | * Store normalized probability of each pattern in probs[b->flen]. 32 | * @pats (optional): save pattern for each move in pats[b->flen]. 33 | * @matched_locally (optional): store whether local match was used or distance features were ignored. */ 34 | void pattern_rate_moves(board_t *b, enum stone color, floating_t *probs, pattern_t *pats, pattern_context_t *ct, bool *matched_locally); 35 | /* For testing purposes: no prioritized features, check every feature. */ 36 | void pattern_rate_moves_vanilla(board_t *b, enum stone color, floating_t *probs, pattern_t *pats, pattern_context_t *ct); 37 | 38 | /* Helper function for pattern_match() callers: returns @locally flag to use for this position. 39 | * For gogui only (super inefficient). */ 40 | bool pattern_matching_locally(board_t *b, enum stone color, pattern_context_t *ct); 41 | 42 | void print_pattern_best_moves(board_t *b, coord_t *best_c, float *best_r, int nbest); 43 | void get_pattern_best_moves(board_t *b, floating_t *probs, coord_t *best_c, float *best_r, int nbest); 44 | 45 | /* Print pattern features' gamma details in @buf */ 46 | void dump_gammas(strbuf_t *buf, pattern_t *p); 47 | 48 | /* Do we have a gamma for that feature ? */ 49 | bool feature_has_gamma(feature_t *f); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /pattern/training/byplayer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # pattern_byplayer - Build a per-player database of used patterns 3 | # 4 | # Invoke this script for each played game, it will add patterns 5 | # to the database incrementally; each file in the database contains 6 | # patterns played by one player. 7 | # 8 | # You must already have a spatial dictionary generated. 9 | 10 | dbdir="$1"; shift 11 | sgf="$1"; shift 12 | # rest of parameters is passed to the patternscan engine 13 | 14 | sgf_attr() { 15 | # TODO: Does not work correctly for attributes containing escaped ] 16 | # e.g. "PB[Tony \[Killer\] Nowak]" gets cropped to "Tony \[Killer" 17 | # Not a big problem, since usually the player name is just 18 | # [a-zA-Z0-9]* 19 | 20 | sed -n 's/^.*'$1'\[\([^]]*\)\].*$/\1/p' "$sgf" 21 | } 22 | 23 | black="$(sgf_attr PB)" 24 | white="$(sgf_attr PW)" 25 | handi="$(sgf_attr HA)" 26 | 27 | if [ -n "$handi" ] && [ "$handi" -gt 0 ]; then 28 | to_play=white 29 | # Comment following out if you want to include handi games. 30 | echo "$sgf: Skipping handicap game" >&2 31 | exit 1 32 | fi 33 | 34 | to_play=black 35 | cat "$sgf" | tools/sgf2gtp.pl | ./pachi -d 0 -e patternscan "$@" | 36 | sed -n -e 's/^= //p' | grep -v '^ *$' | # skip irrelevant replies 37 | while read pattern; do 38 | if [ "$to_play" = black ]; then 39 | player="$black" 40 | to_play=white 41 | else 42 | player="$white" 43 | to_play=black 44 | fi 45 | echo "$pattern" >>"$dbdir/$player" 46 | done 47 | -------------------------------------------------------------------------------- /pattern/training/getdrops: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -n 2 | # 3 | # pattern_getdrops - Find significant value drops in kgslog GTP stream 4 | # and convert them to lead-in game records for pattern learning 5 | # 6 | # Run as pipeline: 7 | # tools/kgslog2gtp.pl | pattern/getdrops | tools/pattern_bayes_gen.sh - 8 | 9 | BEGIN { 10 | use vars qw(@game $lastval $valthres $valfrac); 11 | $valthres = 0.8; 12 | $valfrac = 0.95; 13 | } 14 | 15 | chomp; 16 | @_ = split(/\s+/); 17 | 18 | if ($_[0] eq 'pachi-mygame') { 19 | @game = @_[1..4]; 20 | print STDERR "*** new game [@game]\n"; 21 | $lastval = 0; 22 | @commands = (); 23 | 24 | } elsif ($_[0] eq 'pachi-mymove') { 25 | if ($lastval > 0 and $lastval < $valthres and $_[2] / $lastval < $valfrac) { 26 | print STDERR "large value drop $lastval -> $_[2] [@game :: @_]\n"; 27 | print "$_\n" for @commands; 28 | print "play $game[0] $_[1] 1\n"; 29 | } 30 | $lastval = $_[2]; 31 | my $cmd = "play $game[0] $_[1] 0 $_[2]"; 32 | push @commands, $cmd; 33 | 34 | } elsif ($_[0] eq 'play') { 35 | push @_, 0; 36 | push @commands, "@_"; 37 | 38 | } else { 39 | push @commands, "@_"; 40 | } 41 | -------------------------------------------------------------------------------- /pattern/training/mm/Makefile: -------------------------------------------------------------------------------- 1 | mm: mm.cpp 2 | g++ -O3 -Wall -o mm mm.cpp 3 | 4 | clean: 5 | @rm -f mm 6 | -------------------------------------------------------------------------------- /pattern/training/mm/README: -------------------------------------------------------------------------------- 1 | https://www.remi-coulom.fr/Amsterdam2007/ 2 | 3 | usage: ./mm output.dat 4 | 5 | format of input.dat: 6 | ! 7 | 8 | 9 | ... 10 | ! 11 | # 12 | 13 | 14 | 15 | ... 16 | # 17 | 18 | ... 19 | 20 | A team (either participant or winner) is a list of gamma numbers separated by spaces. 21 | 22 | The total number of gammas should be equal to the sum of the number of gammas over all features. 23 | 24 | There should not be more than one gamma of a feature in a team. 25 | -------------------------------------------------------------------------------- /pattern/training/mm/example.dat: -------------------------------------------------------------------------------- 1 | ! 5 2 | 2 3 | 1 Feature1 4 | 4 Feature2 5 | ! 6 | # 7 | 0 1 8 | 0 1 9 | 0 2 10 | 3 11 | # 12 | 4 13 | 4 14 | 1 15 | -------------------------------------------------------------------------------- /pattern/training/mm_games: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # mm patterns training pipeline: 3 | # Process sgf files to learn from into format suitable for mm 4 | # (needs mm spatial dictionary patterns_mm.spat created in previous step) 5 | set -e 6 | set -o pipefail 7 | 8 | usage() 9 | { 10 | echo "usage: pattern/mm_games [--slow] " 11 | exit 1 12 | } 13 | 14 | 15 | if [ "$1" = "-h" ] || [ $# = 0 ]; then 16 | usage 17 | fi 18 | 19 | options="" 20 | if [ "$1" = "--slow" ]; then 21 | options="mcowner_fast=0" 22 | shift 23 | fi 24 | 25 | ( i=0; n=`echo "$@" | wc -w` 26 | for f in "$@"; do 27 | tools/sgf2gtp.pl < $f; 28 | 29 | # Show progress 30 | printf " \r" >&2 31 | echo $f >&2; 32 | du=`du -sh mm-input.dat | cut -d' ' -f1` 33 | printf "[ %i / %i ] %i%% mm-input.dat: %s\r" $i $n $[$i * 100 / $n] "$du" >&2 34 | i=$[$i+1] 35 | done) | 36 | ./pachi -e patternscan $options 2>pachi.log | 37 | perl -nle 's/^= //; if ($_ ne "") { print $_; }' > mm-input.dat 38 | 39 | echo "" 40 | echo "All Done. Wrote mm-pachi.table, mm-input.dat" 41 | echo "Now run: " 42 | echo " mm < mm-input.dat" 43 | echo "to generate gammas (will create mm-with-freq.dat)" 44 | echo "and create patterns_mm.gamma with:" 45 | echo " pattern/mm_gammas" 46 | -------------------------------------------------------------------------------- /pattern/training/mm_gammas: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | my %gamma_to_feature; 4 | 5 | open(IN, "< mm-pachi.table") || die("can't open mm-pachi.table"); 6 | foreach my $str () 7 | { 8 | my ($gamma, $feature) = split(' ', $str); 9 | $gamma_to_feature{$gamma} = $feature; 10 | } 11 | close(IN); 12 | 13 | 14 | open(IN, "< mm-with-freq.dat") || die("can't open mm-with-freq.dat"); 15 | open(OUT, "> patterns_mm.gamma") || die("can't open patterns_mm.gamma"); 16 | print "Writing patterns_mm.gamma ...\n"; 17 | foreach my $str () 18 | { 19 | my ($number, $gamma, $victories, $participations, $presences) = split(' ', $str); 20 | printf OUT ("%s %s\n", $gamma, $gamma_to_feature{$number}); 21 | } 22 | close(IN); 23 | close(OUT); 24 | -------------------------------------------------------------------------------- /pattern/training/pattern3_show: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # ./pattern3_show.pl PATNUM 3 | 4 | use warnings; 5 | no warnings "qw"; 6 | use strict; 7 | 8 | my $pat = shift @ARGV; 9 | my @s = qw(. X O #); 10 | 11 | my @p = map { ($pat >> (2*$_)) & 3 } (0..7); 12 | splice @p, 4, 0, (0); 13 | for my $y (0..2) { 14 | for my $x (reverse 0..2) { 15 | print $s[$p[$x + $y*3]]; 16 | } 17 | print "\n"; 18 | } 19 | -------------------------------------------------------------------------------- /pattern/training/spatial_show: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # pattern_spatial_show: Show given spatial dictionary entry on board 3 | 4 | my $f = "patterns_mm.spat"; 5 | my $id = $ARGV[0]; 6 | 7 | my @ofs = (); 8 | 9 | open D, "$f" or die "$f: $!"; 10 | while () { 11 | chomp; 12 | if (s/^# Point order: d=(\d+) //) { 13 | my $d = $1; next if ($d < 1); 14 | # XXX: Distances must be in proper order! 15 | s/ *$//; 16 | push @ofs, map { [ split(/,/, $_) ] } split(/ /, $_); 17 | # print "#### $_\n"; 18 | # print "[$d] ($#ofs) " . join(' ', map { $_->[0].",".$_->[1] } @ofs) . "\n"; 19 | next; 20 | } 21 | /^#/ and next; 22 | my ($lid, $d, $pat, @hashes) = split (/\s+/, $_); 23 | if ($id == $lid) { 24 | print "$d $pat\n"; 25 | my @b; 26 | my @pc = split (//, $pat); 27 | for my $i (0 .. $#pc) { 28 | # print "$i: $pc[$i] -> $ofs[$i][1],$ofs[$i][0]\n"; 29 | $b[$d + $ofs[$i][1]][$d + $ofs[$i][0]] = $pc[$i]; 30 | } 31 | $b[$d][$d] = '_'; 32 | for my $y (0 .. 2 * $d) { 33 | for my $x (0 .. 2 * $d) { 34 | print $b[2 * $d - $y][$x] || ' '; 35 | print ' '; 36 | } 37 | print "\n"; 38 | } 39 | last; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /playout/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | OBJS=moggy.o light.o 3 | 4 | all: lib.a 5 | lib.a: $(OBJS) 6 | 7 | 8 | -include ../Makefile.lib 9 | -------------------------------------------------------------------------------- /playout/light.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "board.h" 6 | #include "debug.h" 7 | #include "playout.h" 8 | #include "playout/light.h" 9 | #include "random.h" 10 | 11 | 12 | #define PLDEBUGL(n) DEBUGL_(p->debug_level, n) 13 | 14 | 15 | coord_t 16 | playout_light_choose(playout_policy_t *p, playout_setup_t *s, board_t *b, enum stone to_play) 17 | { 18 | return pass; 19 | } 20 | 21 | 22 | playout_policy_t * 23 | playout_light_init(char *arg, board_t *b) 24 | { 25 | playout_policy_t *p = calloc2(1, playout_policy_t); 26 | p->choose = playout_light_choose; 27 | 28 | if (arg) 29 | fprintf(stderr, "playout-light: This policy does not accept arguments (%s)\n", arg); 30 | 31 | return p; 32 | } 33 | -------------------------------------------------------------------------------- /playout/light.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_PLAYOUT_LIGHT_H 2 | #define PACHI_PLAYOUT_LIGHT_H 3 | 4 | #include "playout.h" 5 | 6 | playout_policy_t *playout_light_init(char *arg, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /playout/moggy.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_PLAYOUT_MOGGY_H 2 | #define PACHI_PLAYOUT_MOGGY_H 3 | 4 | #include "playout.h" 5 | 6 | struct playout_policy *playout_moggy_init(char *arg, board_t *b); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /random.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_RANDOM_H 2 | #define PACHI_RANDOM_H 3 | 4 | #include 5 | 6 | #include "util.h" 7 | 8 | void fast_srandom(unsigned long seed); 9 | unsigned long fast_getseed(void); 10 | 11 | /* Note that only 16bit numbers can be returned. */ 12 | uint16_t fast_random(unsigned int max); 13 | /* Use this one if you want larger numbers. */ 14 | static uint32_t fast_irandom(unsigned int max); 15 | 16 | /* Get random number in [0..1] range. */ 17 | float fast_frandom(); 18 | 19 | 20 | static inline uint32_t 21 | fast_irandom(unsigned int max) 22 | { 23 | if (max <= 65536) 24 | return fast_random(max); 25 | int himax = (max - 1) / 65536; 26 | uint16_t hi = fast_random(himax + 1); 27 | return ((uint32_t)hi << 16) | fast_random(hi < himax ? 65536 : max % 65536); 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /stone.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "stone.h" 7 | 8 | char * 9 | stone2str(enum stone s) 10 | { 11 | switch (s) { 12 | case S_BLACK: return "black"; 13 | case S_WHITE: return "white"; 14 | default: return "none"; 15 | } 16 | } 17 | 18 | enum stone 19 | str2stone(char *str) 20 | { 21 | switch (tolower(*str)) { 22 | case 'b': return S_BLACK; 23 | case 'w': return S_WHITE; 24 | default: assert(0); 25 | } 26 | } 27 | 28 | bool 29 | valid_color(char *str) 30 | { 31 | char c = tolower(*str); 32 | return (c == 'b' || c == 'w'); 33 | } 34 | -------------------------------------------------------------------------------- /stone.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_STONE_H 2 | #define PACHI_STONE_H 3 | 4 | #include 5 | 6 | enum stone { 7 | S_NONE, 8 | S_BLACK, 9 | S_WHITE, 10 | S_OFFBOARD, 11 | S_MAX, 12 | }; 13 | 14 | static char stone2char(enum stone s); 15 | static enum stone char2stone(char s); 16 | bool valid_color(char *s); 17 | char *stone2str(enum stone s); /* static string */ 18 | enum stone str2stone(char *str); 19 | 20 | static enum stone stone_other(enum stone s); 21 | 22 | 23 | static inline char 24 | stone2char(enum stone s) 25 | { 26 | return ".XO#"[s]; 27 | } 28 | 29 | static inline enum stone 30 | char2stone(char s) 31 | { 32 | switch (s) { 33 | case '.': return S_NONE; 34 | case 'X': return S_BLACK; 35 | case 'O': return S_WHITE; 36 | case '#': return S_OFFBOARD; 37 | } 38 | assert(0); 39 | } 40 | 41 | /* Curiously, gcc is reluctant to inline this; I have confirmed 42 | * there is performance benefit. */ 43 | static inline enum stone __attribute__((always_inline)) 44 | stone_other(enum stone s) 45 | { 46 | static const enum stone o[S_MAX] = { S_NONE, S_WHITE, S_BLACK, S_OFFBOARD }; 47 | return o[s]; 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /t-play/autotest/TODO: -------------------------------------------------------------------------------- 1 | 2 | * Support for automatic checking against loss-by-points 3 | (desirable for UCT players) 4 | 5 | * Caching unchanged results - faster ./autotest-show 6 | 7 | * Nicer support for disconnected usage 8 | 9 | * Support for multi-core systems and multi-threaded players 10 | 11 | * Support for using different(ly optimized) binaries based 12 | on host architecture / processor type 13 | -------------------------------------------------------------------------------- /t-play/autotest/bin/autotest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Play autotest games. 3 | # Wrapper for autotest-client, picking an id automatically: 4 | # Will run something like: 5 | # 6 | # nice -n 18 ./autotest-client `hostname`-1 7 | # 8 | # where 1 should be 2, 3, 4, ... for further instances of autotest you would 9 | # run on the same machine (no two instaces with the same id must be run). 10 | # The `nice -n 18` prefix will make sure the client is being run with low 11 | # priority, in case someone wants to use the computer for some real interaction. 12 | 13 | die() { echo "$@"; exit 1; } 14 | bin=`dirname $0` 15 | 16 | # id must be unique 17 | find_id() 18 | { 19 | echo -n "Looking for free id... " 20 | for i in `seq 1 16`; do 21 | id="`hostname`-$i" 22 | if ! ps aux | grep autotest | grep -q " $id\$"; then 23 | echo "Ok" 24 | return 25 | fi 26 | done 27 | die "no free id found" 28 | } 29 | 30 | find_id 31 | cmd="nice -n 18 $bin/autotest-client $id" 32 | echo "$cmd" 33 | echo "" 34 | 35 | exec $cmd 36 | -------------------------------------------------------------------------------- /t-play/autotest/bin/autotest-client: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is autotest Go-testing framework client. It runs on client 3 | # machines and spawns autotest-worker, which picks a random pairing 4 | # among the ones defined in the rc file, and plays a single game. 5 | bin=`dirname $0` 6 | 7 | clientid="$1"; shift 8 | if [ -z "$clientid" ]; then 9 | echo "Usage: $0 " >&2 10 | echo "At any time, only single client with the same client may run!" >&2 11 | echo "You can use e.g. clientid \`hostname\`-1, increment 1 for" >&2 12 | echo "further threads started on the host." >&2 13 | exit 1 14 | fi 15 | . $bin/autotest-lib 16 | 17 | mkdir -p "c/$clientid" 18 | log "started client ($clientid)" 19 | 20 | # Move log to crashes directory 21 | collect_crashlog() 22 | { 23 | log="c/$clientid/game.log" 24 | if [ -f "$log" ]; then 25 | mkdir -p crashes 26 | i=0; while [ -f "crashes/game.log.$i" ]; do i=$[$i+1]; done 27 | mv "$log" "crashes/game.log.$i" 28 | echo "Wrote crashes/game.log.$i" 29 | fi 30 | } 31 | 32 | while true; do 33 | mkdir -p "c/$clientid" 34 | date +%s >"c/$clientid/beacon" 35 | if ! $bin/autotest-worker "$clientid"; then 36 | collect_crashlog 37 | echo "*** WORKER FAILED ***" 38 | log "worker failed with error code $?" 39 | echo "" 40 | sleep 1 41 | fi 42 | done 43 | -------------------------------------------------------------------------------- /t-play/autotest/bin/autotest-clients: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is autotest client lister. 3 | bin=`dirname $0` 4 | 5 | . $bin/autotest-lib 6 | 7 | printf "LAST ACTIVITY\t\t\tWFAIL#\tNAME\n" 8 | for c in c/*; do 9 | client="${c#c/}" 10 | beacon="$(date --rfc-3339=seconds -d "1970-01-01 $(cat "$c/beacon") seconds")" 11 | fails="$(grep -c fail "$c/log" || :)" 12 | printf "$beacon\t$fails\t$client\n" 13 | done 14 | -------------------------------------------------------------------------------- /t-play/autotest/bin/autotest-gather: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is autotest gathering tool, collecting game result info from 3 | # all clients and putting it in single place (which is completely 4 | # wiped otherwise). 5 | bin=`dirname $0` 6 | 7 | . $bin/autotest-lib 8 | 9 | mkdir -p "r/" 10 | rm -f r/* 11 | 12 | # First, gather pairing data: 13 | 14 | for dir in c/*/*/; do 15 | pairing="${dir%/}"; pairing="${pairing#c/*/}" 16 | datfile="r/$pairing.dat" 17 | 18 | if [ ! -s "$datfile" ]; then 19 | # Common datfile header, required for twogtp -analyze 20 | { 21 | echo "#" 22 | printf "#GAME\tRES_B\tRES_W\tRES_R\tALT\tDUP\tLEN\tTIME_B\tTIME_W\tCPU_B\tCPU_W\tERR\tERR_MSG\n" 23 | } >"$datfile" 24 | num=0 25 | else 26 | lastgame="$(tail -n 1 "$datfile")" 27 | num="$((${lastgame%% *} + 1))" 28 | fi 29 | # We cannot simply concatenate all the datfiles because 30 | # twogtp -analyze is pedantic about the games numbering; 31 | # we need to renumber the games to a single sequence. 32 | while read orignum line; do 33 | printf "$num\t$line\n" 34 | num=$((num+1)) 35 | done <"$dir/game.dat" >>"$datfile" 36 | done 37 | 38 | 39 | # Next, fill per-pairing metadata: 40 | 41 | for datfile in r/*.dat; do 42 | pairing="${datfile%.dat}"; pairing="${pairing#r/}" 43 | 44 | # Look at last change in pairing: 45 | stat -c %Z "$(ls --sort=time c/*/"$pairing"/* | head -n 1)" >"r/$pairing.beacon" 46 | 47 | # Check pairing for errors: 48 | tail -n +3 "$datfile" | cut -f 12 | { grep -c -vF 0 >"r/$pairing.error" || :; } 49 | done 50 | -------------------------------------------------------------------------------- /t-play/autotest/bin/autotest-lib: -------------------------------------------------------------------------------- 1 | # Library of common shell functions for the autotest framework. 2 | 3 | set -e # errors are fatal 4 | 5 | 6 | # Client helpers. $clientid must be set. 7 | 8 | log() { 9 | printf "$(date)\t$*\n" >>"c/$clientid/log" 10 | } 11 | 12 | 13 | # Generic functions. 14 | 15 | pairid() { 16 | echo "$*" | tr ' ' '-' 17 | } 18 | -------------------------------------------------------------------------------- /t-play/autotest/bin/autotest-prune: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is autotest pruning tool, removing info about specified old 3 | # pairings. Note that this removes only pairing results, you need 4 | # to adjust the rc file manually if you haven't removed the pairing 5 | # specifiers from there yet. 6 | bin=`dirname $0` 7 | 8 | mask="$1" 9 | if [ -z "$mask" ]; then 10 | echo "Usage: $0 MASK" >&2 11 | echo "MASK can be pairing name, or a glob pattern (*, ?)." >&2 12 | echo "Use \`$0 *\` to remove all pairings." >&2 13 | exit 1 14 | fi 15 | . $bin/autotest-lib 16 | 17 | echo "Removing $(ls r/$mask.dat | wc -l) result pairs..." 18 | rm -f r/$mask.dat r/$mask.summary.dat r/$mask.html r/$mask.beacon r/$mask.error 19 | rm -rf c/*/$mask 20 | -------------------------------------------------------------------------------- /t-play/autotest/bin/autotest-rename: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is autotest rename tool, renames specified pairing to new name. 3 | # Note that this only renames pairing results, you need to adjust the rc file 4 | # manually if you haven't renamed the pairing specifier there yet. 5 | # Rerun autotest-gather afterwards to update results. 6 | bin=`dirname $0` 7 | 8 | from="$1" 9 | to="$2" 10 | if [ -z "$from" ] || [ -z "$to" ]; then 11 | echo "Usage: $0 old_pairing new_pairing" >&2 12 | echo "Rename old_pairing to new_pairing" >&2 13 | exit 1 14 | fi 15 | . $bin/autotest-lib 16 | 17 | # Make sure source exists 18 | if ! find c -type d -name $from | grep -q . ; then 19 | echo "Source pairing not found." >&2 20 | exit 1 21 | fi 22 | 23 | 24 | # Make sure destination doesn't exist 25 | if find c -type d -name $to | grep -q . ; then 26 | echo "Destination already exists." >&2 27 | exit 1 28 | fi 29 | 30 | rm -f r/$from.dat r/$from.summary.dat r/$from.html r/$from.beacon r/$from.error 31 | 32 | for dir in c/*; do 33 | [ -d $dir/$from ] || continue 34 | mv $dir/$from $dir/$to 35 | done 36 | -------------------------------------------------------------------------------- /t-play/autotest/bin/hira: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Hira settings: 4 | # 4d: hira -po 120000 5 | # 3d: hira -po 15000 6 | # 2d: hira -po 6000 7 | # 1d: hira -po 3000 8 | # 1k: hira -po 1500 9 | # 2k: hira -po 800 10 | # 3k: hira -po 400 11 | 12 | cd ~/Hiratuka10_36I 13 | exec wine Hiratuka-19x19_en.exe "$@" 14 | -------------------------------------------------------------------------------- /t-play/autotest/bin/resum: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm *summ* 3 | brm="$1" 4 | [ -n "$brm" ] || brm="*dat" 5 | for i in $(ls $brm); do 6 | printf "%-40s\t" "${i%.dat}.summary.dat"; 7 | ../../gogui-1.1.10/bin/gogui-twogtp -force -analyze $i; 8 | cat ${i%.dat}.summary.dat | cut -f 1,7,8 | tail -n +2 9 | done 10 | -------------------------------------------------------------------------------- /t-play/autotest/bin/runpachi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Simple wrapper that runs pachi from its directory 3 | 4 | die() { echo "$@"; exit 1; } 5 | usage() { die "Usage: runpachi "; } 6 | 7 | path=`eval echo "$1"` # make '~' work 8 | shift 9 | 10 | dir=`dirname $path` 11 | pachi=`basename $path` 12 | 13 | [ -d "$dir" ] || usage 14 | cd $dir || die "cd $dir failed" 15 | 16 | exec ./$pachi $@ 17 | -------------------------------------------------------------------------------- /t-play/autotest/bin/test_in_context.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # $1: path to test results 4 | # $2: board size 5 | 6 | (cd "$1" && ls f$2-*summ*dat) | sed 's/^f'$2'-//; s/[-.].*$//;' | xargs git log --pretty=oneline --no-walk | while read c s; do 7 | echo 8 | echo ================================================ 9 | git log -1 --pretty=medium $c 10 | for t in $(cd "$1" && ls f$2-${c:0:5}*summ*); do 11 | echo 12 | echo $t 13 | cat "$1/$t" | cut -f 1,2,7,8,12,13 14 | done 15 | done 16 | -------------------------------------------------------------------------------- /t-predict/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | OBJS=predict.o 3 | 4 | all: lib.a 5 | lib.a: $(OBJS) 6 | 7 | 8 | -include ../Makefile.lib 9 | -------------------------------------------------------------------------------- /t-predict/README: -------------------------------------------------------------------------------- 1 | [ Test prediction rate of various Pachi components ] 2 | 3 | Choose engine to test with: 4 | 5 | $ predict -e [patternplay|replay|dcnn] [pachi_args] 6 | 7 | and the script will make it try to predict moves from game records. 8 | 9 | Note: To change replay's speed/accuracy, adjust sampling: 10 | 11 | $ predict -e replay runs=n 12 | 13 | 14 | [ Setup ] 15 | 16 | Place sgf files to use in a t-predict/sgf directory (symlink ok too) 17 | and convert them to gtp first (see tools/sgf2gtp*). 18 | (script will be reading t-predict/sgf/*.gtp) 19 | 20 | For game collections see: 21 | http://www.u-go.net/gamerecords/ (KGS 6d+ games) 22 | http://senseis.xmp.net/?GoDatabases 23 | -------------------------------------------------------------------------------- /t-predict/predict: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Test prediction rate of various Pachi components on game records 3 | 4 | die() 5 | { echo "$@"; exit 1; } 6 | 7 | usage() 8 | { die "Usage: predict -e [patternplay|replay|dcnn] [pachi_args]"; } 9 | 10 | cd `dirname $0` 11 | [ "$1" = "-e" ] || usage 12 | [ -d sgf ] || die "Please setup 't-predict/sgf/' directory first" 13 | 14 | # Ensure pachi args are sane 15 | #( cd .. ; ./pachi -d 0 "$@" < /dev/null ) || exit 1 16 | 17 | echo "Prediction rate for $2 (even games):" 18 | for f in sgf/*.gtp; do 19 | if ! grep -q handicap "$f"; then 20 | cat "$f" | sed -e 's/^play /pachi-predict /' 21 | fi 22 | done | 23 | ( cd .. ; ./pachi -d 0 "$@" 2>pachi.log | perl -nle 's/^= //; if ($_ ne "") { print; }') 24 | 25 | -------------------------------------------------------------------------------- /t-predict/predict.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_PREDICT_PREDICT_H 2 | #define PACHI_PREDICT_PREDICT_H 3 | 4 | /* Check if engine guesses move m, and return stats from time to time. */ 5 | char *predict_move(board_t *b, engine_t *e, time_info_t *ti, move_t *m, int games); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /t-regress/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | -------------------------------------------------------------------------------- /t-regress/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Run regression tests 4 | regtest: FORCE 5 | ./run_tests fixed 6 | 7 | FORCE: 8 | -------------------------------------------------------------------------------- /t-regress/fixed/4-4_reduce_3-3/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.5 4 | fixed_handicap 5 5 | play b r18 6 | play b e17 7 | play b p17 8 | play b q17 9 | play b r16 10 | play b d13 11 | play b q13 12 | play b c10 13 | play b r10 14 | play b d7 15 | play b q7 16 | play b c4 17 | play b r4 18 | play b d3 19 | play b e3 20 | play b p3 21 | play b q3 22 | play b c2 23 | play b r2 24 | play w p18 25 | play w q18 26 | play w f17 27 | play w o17 28 | play w r17 29 | play w f16 30 | play w k16 31 | play w o16 32 | play w f4 33 | play w o4 34 | play w c3 35 | play w f3 36 | play w k3 37 | play w o3 38 | play w r3 39 | play w d2 40 | play w e2 41 | play w p2 42 | play w q2 43 | 44 | play w c17 45 | play b c16 46 | play w e18 47 | play b d17 48 | play w d18 49 | play b c18 50 | 51 | tunit genmove w !B17 52 | -------------------------------------------------------------------------------- /t-regress/fixed/4-4_reduce_3-3_2/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 0.50 5 | set_free_handicap d16 q16 k10 d4 q4 6 | play W o17 7 | play B q13 8 | play W f17 9 | play B d13 10 | play W k16 11 | play B e17 12 | play W f16 13 | play B p17 14 | play W o16 15 | play B r10 16 | play W o3 17 | play B p3 18 | play W o4 19 | play B q7 20 | play W k3 21 | play B c10 22 | play W f3 23 | play B e3 24 | play W f4 25 | play B d7 26 | play W c3 27 | play B c4 28 | play W e2 29 | play B d3 30 | play W d2 31 | play B c2 32 | play W c17 33 | play B c16 34 | play W e18 35 | play B d17 36 | play W d18 37 | play B c18 38 | play W r3 39 | play B r4 40 | play W p2 41 | play B q3 42 | play W q2 43 | play B r2 44 | play W r17 45 | play B r16 46 | play W p18 47 | play B q17 48 | play W q18 49 | play B r18 50 | play W o14 51 | play B p11 52 | play W f13 53 | play B e11 54 | play W f11 55 | play B e12 56 | play W f12 57 | play B f9 58 | play W f10 59 | play B e10 60 | play W g9 61 | play B g8 62 | play W f8 63 | play B e9 64 | play W h9 65 | play B m10 66 | play W f7 67 | play B e6 68 | play W f6 69 | play B n12 70 | play W m13 71 | play B n13 72 | play W n14 73 | play B l12 74 | play W l13 75 | play B k12 76 | play W k13 77 | play B j12 78 | play W j13 79 | play B n7 80 | play W o6 81 | play B o7 82 | play W p6 83 | play B q6 84 | play W p7 85 | play B p8 86 | play W q14 87 | play B r14 88 | play W p13 89 | play B q12 90 | play W s18 91 | play B s17 92 | play W r19 93 | play B q15 94 | play W r17 95 | play B p14 96 | play W s16 97 | play B s15 98 | play W t17 99 | play B o13 100 | play W l7 101 | play B n6 102 | play W n5 103 | play B m6 104 | play W k5 105 | play B m5 106 | play W m4 107 | play B k8 108 | play W k7 109 | play B j8 110 | play W m8 111 | play B h8 112 | play W n9 113 | play B o9 114 | play W n10 115 | play B m12 116 | play W h12 117 | play B j10 118 | play W e5 119 | play B d5 120 | play W b3 121 | play B b2 122 | play W b4 123 | play B b5 124 | play W c1 125 | play B a3 126 | play W b1 127 | play B a4 128 | play W h6 129 | play B h11 130 | play W g11 131 | play B h10 132 | play W g10 133 | play B n11 134 | play W o10 135 | play B p10 136 | play W n8 137 | play B o8 138 | tunit genmove w !R1 139 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_and_cap/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 7.50 4 | play B q16 5 | play W d4 6 | play B c16 7 | play W q4 8 | play B c6 9 | play W f3 10 | play B d10 11 | play W f17 12 | play B e16 13 | play W d18 14 | play B h17 15 | play W f16 16 | play B e17 17 | play W e18 18 | play B c17 19 | play W g18 20 | play B f15 21 | play W h16 22 | play B g15 23 | play W j17 24 | play B h15 25 | play W j16 26 | play B j15 27 | play W c8 28 | play B d8 29 | play W c9 30 | play B d9 31 | play W c10 32 | play B c7 33 | play W c12 34 | play B d11 35 | play W b13 36 | play B c14 37 | play W c11 38 | play B r6 39 | play W r8 40 | play B p6 41 | play W o4 42 | play B q9 43 | play W r9 44 | play B q10 45 | play W q8 46 | play B p8 47 | play W r10 48 | play B q11 49 | play W r12 50 | play B p13 51 | play W r13 52 | play B m3 53 | play W n5 54 | play B j3 55 | play W l4 56 | play B l3 57 | play W p7 58 | play B o7 59 | play W q7 60 | play B o8 61 | play W q6 62 | play B c3 63 | play W c4 64 | play B b4 65 | play W b5 66 | play B b3 67 | play W c5 68 | play B e2 69 | play W b7 70 | play B b6 71 | play W a6 72 | play B e6 73 | play W f5 74 | play B f6 75 | play W m7 76 | play B l8 77 | play W f2 78 | play B e3 79 | play W e4 80 | play B d3 81 | play W n2 82 | play B g4 83 | play W f4 84 | play B g5 85 | play W h6 86 | play B g6 87 | play W m8 88 | play B m9 89 | play W k7 90 | play B l7 91 | play W l6 92 | play B k8 93 | play W j7 94 | play B j8 95 | play W h8 96 | play B h9 97 | play W n9 98 | tunit genmove B M10 99 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_and_cap2/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.5 4 | play B q16 5 | play W d4 6 | play B q4 7 | play W d17 8 | play B d15 9 | play W c15 10 | play B c14 11 | play W c16 12 | play B d14 13 | play W f17 14 | play B c10 15 | play W c8 16 | play B q10 17 | play W o3 18 | play B o4 19 | play W n4 20 | play B o5 21 | play W p3 22 | play B q3 23 | play W k3 24 | play B n5 25 | play W m4 26 | play B c6 27 | play W d6 28 | play B c5 29 | play W d5 30 | play B b3 31 | play W c3 32 | play B c7 33 | play W d7 34 | play B b8 35 | play W d8 36 | play B b9 37 | play W o17 38 | play B o16 39 | play W n16 40 | play B n17 41 | play W p18 42 | play B o15 43 | play W m17 44 | play B n18 45 | play W m18 46 | play B n15 47 | play W m16 48 | play B g4 49 | play W l6 50 | play B k4 51 | play W j3 52 | play B l4 53 | play W l3 54 | play B m5 55 | play W l5 56 | play B j4 57 | play W h4 58 | play B h5 59 | play W h3 60 | play B j6 61 | play W j5 62 | play B k5 63 | play W k6 64 | play B j5 65 | play W j7 66 | play B h7 67 | play W g5 68 | play B h6 69 | tunit genmove W !H8 70 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_and_cap2/foo.sgf: -------------------------------------------------------------------------------- 1 | (;FF[4]CA[UTF-8]AP[GoGui:1.4.9] 2 | KM[0.5]PW[Pachi]DT[2017-04-04] 3 | ;B[pd];W[dp];B[pp];W[dc];B[de];W[ce];B[cf];W[cd];B[df];W[fc] 4 | ;B[cj];W[cl];B[pj];W[nq];B[np];W[mp];B[no];W[oq];B[pq];W[jq] 5 | ;B[mo];W[lp];B[cn];W[dn];B[co];W[do];B[bq];W[cq];B[cm];W[dm] 6 | ;B[bl];W[dl];B[bk];W[nc];B[nd];W[md];B[mc];W[ob];B[ne];W[lc] 7 | ;B[mb];W[lb];B[me];W[ld];B[gp];W[kn];B[jp];W[iq];B[kp];W[kq] 8 | ;B[lo];W[ko];B[ip];W[hp];B[ho];W[hq];B[in];W[io];B[jo];W[jn] 9 | ;B[io];W[im];B[hm];W[go];B[hn]) 10 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_and_cap3/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 7.50 4 | play B q16 5 | play W d17 6 | play B q4 7 | play W c4 8 | play B e4 9 | play W e3 10 | play B f3 11 | play W d3 12 | play B f4 13 | play W c6 14 | play B k4 15 | play W r6 16 | play B r8 17 | play W o3 18 | play B q6 19 | play W q7 20 | play B r7 21 | play W q5 22 | play B p6 23 | play W p5 24 | play B r5 25 | play W r4 26 | play B s6 27 | play W s5 28 | play B r6 29 | play W r3 30 | play B o5 31 | play W p4 32 | play B n3 33 | play W n4 34 | play B o4 35 | play W p3 36 | play B m3 37 | play W o17 38 | play B q14 39 | play W k16 40 | play B c14 41 | play W d15 42 | play B b16 43 | play W c12 44 | play B d14 45 | play W c15 46 | play B b15 47 | play W c17 48 | play B e14 49 | play W e12 50 | play B f16 51 | play W e15 52 | play B f15 53 | play W b13 54 | play B b14 55 | play W f14 56 | play B e17 57 | play W b17 58 | play B f13 59 | play W g14 60 | play B e13 61 | play W e18 62 | play B f18 63 | play W d19 64 | play B h15 65 | play W h14 66 | play B j15 67 | play W g15 68 | play B g16 69 | play W h16 70 | play B j16 71 | play W h17 72 | play B j17 73 | play W h18 74 | play B j13 75 | play W f17 76 | play B g17 77 | play W g18 78 | play B j14 79 | play W e16 80 | play B h13 81 | play W f17 82 | play B f12 83 | play W e11 84 | play B g10 85 | play W o15 86 | play B o13 87 | play W e9 88 | play B g8 89 | play W l4 90 | play B l3 91 | play W k5 92 | play B j4 93 | play W o6 94 | play B n5 95 | play W n6 96 | play B m5 97 | play W m6 98 | play B l6 99 | play W l7 100 | play B k6 101 | play W k7 102 | play B j6 103 | play W m8 104 | play B o8 105 | play W n8 106 | play B o9 107 | play W j7 108 | play B h7 109 | play W h8 110 | tunit genmove b !H9 111 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_and_cap3/game.sgf: -------------------------------------------------------------------------------- 1 | (;FF[4]CA[UTF-8]AP[GoGui:1.4.10] 2 | KM[7.5]TM[300]PB[pachipachi]PW[apie]BR[2d]WR[2d]DT[2018-02-18]RU[Chinese] 3 | C[pachipachi [2d\]: GTP Engine for pachipachi (black): version 20180115. Have a good game ! 4 | ] 5 | PC[The KGS Go Server at http://www.gokgs.com/]ST[2];B[pd]BL[295.096];W[dc] 6 | WL[297.973];B[pp]BL[290.346];W[cp]WL[293.025];B[ep]BL[285.565];W[eq] 7 | WL[285.419];B[fq]BL[280.69];W[dq]WL[274.048];B[fp]BL[275.912];W[cn]WL[272.695] 8 | ;B[jp]BL[271.054];W[qn]WL[270.747];B[ql]BL[266.33];W[nq]WL[268.798];B[pn] 9 | BL[261.423];W[pm]WL[265.868];B[qm]BL[256.514];W[po]WL[263.055];B[on] 10 | BL[251.473];W[oo]WL[261.715] 11 | ;B[qo]BL[246.478];W[qp]WL[260.239];B[rn]BL[241.608];W[ro]WL[258.676];B[qn] 12 | BL[236.699];W[qq]WL[256.292];B[no]BL[231.948];W[op]WL[254.901];B[mq] 13 | BL[227.154];W[mp]WL[252.82] 14 | ;B[np]BL[222.382];W[oq]WL[252.18];B[lq]BL[216.989];W[nc]WL[242.056];B[pf] 15 | BL[211.607];W[jd]WL[234.049];B[cf]BL[201.727];W[de]WL[230.619];B[bd] 16 | BL[196.581];W[ch]WL[201.794] 17 | ;B[df]BL[191.262];W[ce]WL[200.066];B[be]BL[186.075];W[cc]WL[198.082];B[ef] 18 | BL[176.201];W[eh]WL[189.271];B[fd]BL[170.942];W[ee]WL[180.601];B[fe] 19 | BL[165.658];W[bg]WL[178.02] 20 | ;B[bf]BL[159.41];W[ff]WL[177.216];B[ec]BL[149.645];W[bc]WL[159.732];B[fg] 21 | BL[144.619];W[gf]WL[157.827];B[eg]BL[139.478];W[eb]WL[151.267];B[fb] 22 | BL[134.356];W[da]WL[149.119] 23 | ;B[he]BL[125.299];W[hf]WL[145.746];B[ie]BL[119.461];W[ge]WL[95.983];B[gd] 24 | BL[114.333];W[hd]WL[94.935];B[id]BL[108.541];W[hc]WL[93.649];B[ic]BL[103.406]; 25 | W[hb]WL[92.203] 26 | ;B[ig]BL[93.851];W[fc]WL[84.061];B[gc]BL[88.677];W[gb]WL[83.135];B[if] 27 | BL[79.417];W[ed]WL[80.674];B[hg]BL[74.224];W[fc]WL[78.413];B[fh]BL[65.117]; 28 | W[ei]WL[72.418] 29 | ;B[gj]BL[59.321];W[ne]WL[61.086];B[ng]BL[54.361];W[ek]WL[48.39];B[gl] 30 | BL[45.076];W[kp]WL[37.729];B[kq]BL[40.054];W[jo]WL[35.799];B[ip]BL[30.956]; 31 | W[nn]WL[33.442] 32 | ;B[mo]BL[26.031];W[mn]WL[31.754];B[lo]BL[20.639];W[ln]WL[31.036];B[kn] 33 | BL[15.053];W[km]WL[11.735];B[jn]BL[9.944];W[jm]WL[7.55];B[in]BL[5.13];W[ll] 34 | WL[5.795] 35 | ;B[nl]BL[30.0]OB[5];W[ml]WL[2.569];B[nk]BL[30.0]OB[5];W[im]WL[30.0]OW[5];B[hm] 36 | BL[30.0]OB[5];W[hl]WL[30.0]OW[5]) 37 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_and_cap7/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B q16 6 | play W d17 7 | play B q4 8 | play W d5 9 | play B d3 10 | play W f4 11 | play B f3 12 | play W g3 13 | play B g4 14 | play W e3 15 | play B f2 16 | play W e4 17 | play B e2 18 | play W h3 19 | play B c4 20 | play W c5 21 | play B g5 22 | play W c3 23 | play B d4 24 | play W b4 25 | play B d2 26 | play W f6 27 | play B b3 28 | play W j4 29 | play B d16 30 | play W c16 31 | play B e17 32 | play W d15 33 | play B e16 34 | play W c17 35 | play B d13 36 | play W e15 37 | play B f15 38 | play W f16 39 | play B f17 40 | play W g16 41 | play B g17 42 | play W h16 43 | play B h17 44 | play W j16 45 | play B j17 46 | play W f14 47 | play B k16 48 | play W b5 49 | play B a3 50 | play W g6 51 | play B c10 52 | play W c8 53 | play B c14 54 | play W c12 55 | play B c15 56 | play W g15 57 | play B d12 58 | play W c11 59 | play B d11 60 | play W b10 61 | play B d10 62 | play W c9 63 | play B e18 64 | play W b15 65 | play B b14 66 | play W a15 67 | play B b18 68 | play W c18 69 | play B c19 70 | play W b19 71 | play B b17 72 | play W b16 73 | play B d19 74 | play W a18 75 | play B a19 76 | play W b2 77 | play B c2 78 | play W b19 79 | play B b9 80 | play W b11 81 | play B a19 82 | play W q17 83 | play B r17 84 | play W b19 85 | play B k15 86 | play W a17 87 | play B g12 88 | play W h13 89 | play B h12 90 | play W k13 91 | play B g13 92 | play W h14 93 | play B j12 94 | play W k14 95 | play B l11 96 | play W p16 97 | play B q15 98 | play W p18 99 | play B r18 100 | play W m14 101 | play B n15 102 | play W m15 103 | play B m16 104 | play W n16 105 | play B n14 106 | play W n13 107 | play B p15 108 | play W l16 109 | play B m17 110 | play W l17 111 | 112 | tunit genmove b !L18 113 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_ladder_big3/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 7.5 4 | play b q16 5 | play b p8 6 | play b r8 7 | play b s8 8 | play b p7 9 | play b q7 10 | play b p6 11 | play b q5 12 | play b k4 13 | play b f3 14 | play b q3 15 | play w d17 16 | play w q9 17 | play w r9 18 | play w s9 19 | play w q8 20 | play w r7 21 | play w c6 22 | play w q6 23 | play w r6 24 | play w d4 25 | play w s4 26 | play b r5 27 | tunit genmove w !S5 28 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_ladder_big3/foo.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[19] 2 | RU[chinese] 3 | KM[7.5] 4 | ;B[pd] 5 | ;B[ol] 6 | ;B[ql] 7 | ;B[rl] 8 | ;B[om] 9 | ;B[pm] 10 | ;B[on] 11 | ;B[po] 12 | ;B[jp] 13 | ;B[fq] 14 | ;B[pq] 15 | ;W[dc] 16 | ;W[pk] 17 | ;W[qk] 18 | ;W[rk] 19 | ;W[pl] 20 | ;W[qm] 21 | ;W[cn] 22 | ;W[pn] 23 | ;W[qn] 24 | ;W[dp] 25 | ;W[rp] 26 | ;B[qo] 27 | ) 28 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_ladder_big5/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B q16 6 | play W q4 7 | play B c16 8 | play W c4 9 | play B j16 10 | play W r14 11 | play B o16 12 | play W r6 13 | play B d10 14 | play W d16 15 | play B d17 16 | play W e17 17 | play B d15 18 | play W e16 19 | play B c17 20 | play W e15 21 | play B d14 22 | play W e14 23 | play B d13 24 | play W e13 25 | play B e12 26 | play W f12 27 | play B e11 28 | play W j18 29 | play B j17 30 | play W k18 31 | play B g17 32 | play W h18 33 | play B g18 34 | play W h17 35 | play B h16 36 | play W g16 37 | play B e18 38 | play W l16 39 | play B g15 40 | play W f16 41 | play B f17 42 | play W h19 43 | tunit genmove b F18 D18 D19 C18 44 | -------------------------------------------------------------------------------- /t-regress/fixed/atari_ladder_big5/game.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[6.50]TM[60]OT[5x30 byo-yomi] 3 | PW[nekomichan]PB[pachipachi]BR[2d]DT[2022-11-21]PC[The KGS Go Server at http://www.gokgs.com/]C[pachipachi [2d\]: GTP Engine for pachipachi (black): Pachi version 12.60. Have a good game ! 4 | ]RE[W+Resign] 5 | ;B[pd]BL[57.001] 6 | ;W[pp]WL[58.675] 7 | ;B[cd]BL[54.017] 8 | ;W[cp]WL[55.947] 9 | ;B[id]BL[51.191] 10 | ;W[qf]WL[50.552] 11 | ;B[nd]BL[48.246] 12 | ;W[qn]WL[46.906] 13 | ;B[dj]BL[45.389] 14 | ;W[dd]WL[42.501] 15 | ;B[dc]BL[42.412] 16 | ;W[ec]WL[40.52] 17 | ;B[de]BL[38.951] 18 | ;W[ed]WL[37.535] 19 | ;B[cc]BL[35.567] 20 | ;W[ee]WL[35.478] 21 | ;B[df]BL[32.192] 22 | ;W[ef]WL[34.584] 23 | ;B[dg]BL[26.826] 24 | ;W[eg]WL[32.888] 25 | ;B[eh]BL[23.341] 26 | ;W[fh]WL[30.933] 27 | ;B[ei]BL[17.747] 28 | ;W[ib]WL[26.706] 29 | ;B[ic]BL[14.153] 30 | ;W[jb]WL[21.348] 31 | ;B[gc]BL[8.717] 32 | ;W[hb]WL[16.783] 33 | ;B[gb]BL[5.413] 34 | ;W[hc]WL[15.827] 35 | ;B[hd]BL[30]OB[5] 36 | ;W[gd]WL[14.353] 37 | ;B[eb]BL[30]OB[5] 38 | ;W[kd]WL[30]OW[5] 39 | ;B[ge]BL[30]OB[5] 40 | ;W[fd]WL[30]OW[5] 41 | ;B[fc]BL[30]OB[5] 42 | ;W[ha]WL[30]OW[5] 43 | ;B[fg]BL[30]OB[5] 44 | ;W[fb]WL[30]OW[5] 45 | ;B[fa]BL[30]OB[5] 46 | ;W[ga]WL[30]OW[5] 47 | ;B[fb]BL[30]OB[5] 48 | ;W[db]WL[30]OW[5] 49 | ;B[cb]BL[30]OB[5] 50 | ;W[ea]WL[30]OW[5] 51 | ;B[ep]BL[30]OB[5] 52 | ;W[cn]WL[30]OW[5] 53 | ;B[cq]BL[30]OB[5] 54 | ;W[dq]WL[30]OW[5] 55 | ;B[dp]BL[30]OB[5] 56 | ;W[cr]WL[30]OW[5] 57 | ;B[bq]BL[30]OB[5] 58 | ;W[do]WL[30]OW[5] 59 | ;B[eq]BL[30]OB[5] 60 | ;W[dr]WL[30]OW[5] 61 | ;B[br]BL[30]OB[5] 62 | ;W[er]WL[30]OW[5] 63 | ;B[fr]BL[30]OB[5] 64 | ;W[fq]WL[30]OW[5] 65 | ;B[gr]BL[30]OB[5] 66 | ;W[gq]WL[30]OW[5] 67 | ;B[es]BL[30]OB[5] 68 | ;W[hr]WL[30]OW[5] 69 | ;B[ds]BL[30]OB[5] 70 | ;W[fo]WL[30]OW[5] 71 | ;B[eo]BL[30]OB[5] 72 | ;W[en]WL[30]OW[5]) 73 | -------------------------------------------------------------------------------- /t-regress/fixed/bent_three/notes: -------------------------------------------------------------------------------- 1 | 2 | Move: 320 Komi: 0.5 Handicap: 6 Captures B: 12 W: 32 Score Est: W+5.5 3 | 4 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 5 | +---------------------------------------+ +---------------------------------------+ 6 | 19 | O O O O X X X . . . . . . X O O O . O | 19 | O O O O X X X X X X X X X X O O O O O | 7 | 18 | O . O O O O X . . . . X X X X O O O . | 18 | O O O O O O X X X X X X X X X O O O O | 8 | 17 | O . . . . O X X X X X X O O X X O . O | 17 | O O O O O O X X X X X X O O X X O O O | 9 | 16 | . O . . O O O X O O O X O . O X X O . | 16 | O O O O O O O X O O O X O O O X X O O | 10 | 15 | O . . . . O O X O . O O . O O X X O . | 15 | O O O O O O O X O O O O O O O X X O O | 11 | 14 | O . . O . O X X X O O X O O X X O O O | 14 | O O O O O O X X X O O X O O X X O O O | 12 | 13 | O O O O O O O X O O X X X O X X X O O | 13 | O O O O O O O X O O X X X O X X X O O | 13 | 12 | O X O O . O O X O O X X O . O O X X O | 12 | O X O O O O O X O O X X O O O O X X O | 14 | 11 | O X X O O X X X X X X X O O . O X O O | 11 | O X X O O X X X X X X X O O O O X O O | 15 | 10 | O X X X O O O X X O O O O O O X X X O | 10 | O X X X O O O X X O O O O O O X X X O | 16 | 9 | X X X . X X O X . X O . O X X . X . X | 9 | X X X X X X O X X X O O O X X X X X X | 17 | 8 | O . X . X . X . X . X O O X . X . X . | 8 | X X X X X X X X X X X O O X X X X X X | 18 | 7 | . . . X X X X . . X X O O X X X X . . | 7 | X X X X X X X X X X X O O X X X X X X | 19 | 6 | X . X . . . O X . X O O . O O O X . . | 6 | X X X X X X X X X X O O O O O O X X X | 20 | 5 | O X . . . . . X X O O O O . O O X X X | 5 | O X X X X X X X X O O O O O O O X X X | 21 | 4 | O O X X . . . . O X O O X O O X X O O | 4 | O O X X X X X X X X O O X O O X X O O | 22 | 3 | . O O O X X X X X X O O X X X O O O . | 3 | O O O O X X X X X X O O X X X O O O O | 23 | 2 | . . O . O O O O X . X O X O O O O)O X | 2 | O O O O O O O O X X X O X O O O O O x | 24 | 1 | . O . O X . O X X X X X X X X O . X . | 1 | O O O O O O O X X X X X X X X O O x x | 25 | +---------------------------------------+ +---------------------------------------+ 26 | 27 | b should win this, but after b T1 playouts don't know to break seki to make bent-four, 28 | so thinks w group lives, and resigns 29 | 30 | fixed (extra bentfour logic) 31 | -------------------------------------------------------------------------------- /t-regress/fixed/big_capture/notes: -------------------------------------------------------------------------------- 1 | 2 | pachi vs VPP79 2016-10-08 3 | 4 | Move: 197 Komi: 0.5 Handicap: 0 Captures B: 1 W: 1 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . X X O . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . O X . O . O . O X O . X O O X | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . O O X X O . X . O X O . X O . X | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . . O . X O X O X . . O O X X . X O O | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . . . . O X X . X X). . O O X X . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . O . O O X X X . O . . O X O X X . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . . O X X X O X . . . . . X O O . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | O O O X X . . O X X O . O O O X O O . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | X X X X X O . . . . . . O X X X . X . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | O X X O O O O O O O O . . . . X X X . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | O O X X X O X X X X X O O O O O O O X | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . O X X O X O . . . X X O X X X X X . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | O O X O O X . X O . O O X . . O O . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . O O O O X . X O . O X . X . . . . . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | X O X O X X . . . . . X . . . X . X . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . X X X O O O . O O . . . . . . . . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . . X X O . . X . O X X O . X . . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . . . . . . . . . O O O X . . . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | 29 | should H8 to capture group ! 30 | dcnn misses it, and 5000 sims little short 31 | (sometimes find it) 32 | -------------------------------------------------------------------------------- /t-regress/fixed/dead_stones/notes: -------------------------------------------------------------------------------- 1 | 2 | pachipachi tetl Feb 14 01:47:18 3 | 4 | Move: 244 Komi: 6.5 Handicap: 0 Captures B: 9 W: 1 Score Est: W+29.5 5 | 6 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 7 | +---------------------------------------+ +---------------------------------------+ 8 | 19 | . . . . . . X . X O O O . . O X . . . | 19 | X X X X X X X X X O O O O O O X X X X | 9 | 18 | . . . X X O O X X X X O X . O X X . . | 18 | X X X X X X X X X X X O O O O X X X X | 10 | 17 | . . . . O X X . O O X O X O . O X X O | 17 | X X X X X X X X X X X O O O O O X X X | 11 | 16 | . . X . . . . . X X O O X O . O X . X | 16 | X X X X X X X X X X O O O O O O X X X | 12 | 15 | X X . . . . . . . X O O O . . . O X . | 15 | X X X X X X X X X X O O O O O O O X X | 13 | 14 | O X X . . . . . . . X O . O O O O X X | 14 | O X X X X X X X X X X O O O O O O X X | 14 | 13 | O O X . . . . . . . . X O O X X O X . | 13 | O O X X X X X X X X X X O O X X O X X | 15 | 12 | . O O X X . X X X X X . X O X O O O X | 12 | O O O X X X X X X X X X X O X O O O X | 16 | 11 | . . O O X X O O X O X X X X X X X O X | 11 | O O O O X X O O X O X X X X X X X O X | 17 | 10 | . . O X X X O . O O O O O O O X . X . | 10 | O O O X X X O O O O O O O O O X X X X | 18 | 9 | . . O X O O O O X . . . . . O O X X X | 9 | O O O X O O O O O O O O O O O O X X X | 19 | 8 | . . O X O O X O X O . . . . . . O O X | 8 | O O O X O O X O O O O O O O O O O O X | 20 | 7 | . . O O O X X X O O . . . . . . O O O | 7 | O O O O O X X X O O O O O O O O O O O | 21 | 6 | . O . X X O X X O X . . . . . . O X O | 6 | O O O O O O X X O O O O O O O O O O O | 22 | 5 | O O O O O O O X X O O . . . . O O X O | 5 | O O O O O O O X X O O O O O O O O O O | 23 | 4 | X O X X O X X X X X O . . . . O X . X | 4 | O O X X O X X X X X O O O O O O O O O | 24 | 3 | . X . X X . . X X O . O O O . O X X X | 3 | O X X X X X X X X O O O O O O O O O O | 25 | 2 | X X . . X X . X O . O O . O O X X . O | 2 | X X X X X X X X O O O O O O O O O O O | 26 | 1 | . . . . . . X X O O O X X X X . X X . | 1 | X X X X X X X X O O O O O O O O O O O | 27 | +---------------------------------------+ +---------------------------------------+ 28 | 29 | A4 seen as dead, but for kgs this means all neighbor b groups at B2 etc are dead ... 30 | 31 | fixed 32 | -------------------------------------------------------------------------------- /t-regress/fixed/double_atari2/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | komi 7.5 3 | clear_board 4 | play B Q16 5 | play W D4 6 | play B Q4 7 | play W D16 8 | play B F17 9 | play W C14 10 | play B K16 11 | play W O3 12 | play B R6 13 | play W K4 14 | play B Q10 15 | play W D10 16 | play B G4 17 | play W G5 18 | play B H5 19 | play W H4 20 | play B G3 21 | play W H3 22 | play B D3 23 | play W C3 24 | play B C2 25 | play W C4 26 | play B E2 27 | play W F5 28 | play B E4 29 | play W E5 30 | play B G2 31 | play W H2 32 | play B J5 33 | play W K5 34 | play B M3 35 | play W M4 36 | play B L4 37 | play W L3 38 | play B N4 39 | play W M5 40 | play B N3 41 | play W L2 42 | play B H7 43 | play W K7 44 | play B Q14 45 | play W F8 46 | play B H9 47 | play W K9 48 | play B C17 49 | play W H11 50 | play B J10 51 | play W K11 52 | play B J11 53 | play W J12 54 | play B K10 55 | play W L10 56 | play B L9 57 | 58 | tunit genmove w L11 59 | -------------------------------------------------------------------------------- /t-regress/fixed/double_atari2/foo.sgf: -------------------------------------------------------------------------------- 1 | (;RU[Chinese]SZ[19] 2 | KM[7.5] 3 | ;B[pd] 4 | ;W[dp] 5 | ;B[pp] 6 | ;W[dd] 7 | ;B[fc] 8 | ;W[cf] 9 | ;B[jd] 10 | ;W[nq] 11 | ;B[qn] 12 | ;W[jp] 13 | ;B[pj] 14 | ;W[dj] 15 | ;B[gp] 16 | ;W[go] 17 | ;B[ho] 18 | ;W[hp] 19 | ;B[gq] 20 | ;W[hq] 21 | ;B[dq] 22 | ;W[cq] 23 | ;B[cr] 24 | ;W[cp] 25 | ;B[er] 26 | ;W[fo] 27 | ;B[ep] 28 | ;W[eo] 29 | ;B[gr] 30 | ;W[hr] 31 | ;B[io] 32 | ;W[jo] 33 | ;B[lq] 34 | ;W[lp] 35 | ;B[kp] 36 | ;W[kq] 37 | ;B[mp] 38 | ;W[lo] 39 | ;B[mq] 40 | ;W[kr] 41 | ;B[hm] 42 | ;W[jm] 43 | ;B[pf] 44 | ;W[fl] 45 | ;B[hk] 46 | ;W[jk] 47 | ;B[cc] 48 | ;W[hi] 49 | ;B[ij] 50 | ;W[ji] 51 | ;B[ii] 52 | ;W[ih] 53 | ;B[jj] 54 | ;W[kj] 55 | ;B[kk] 56 | ) 57 | -------------------------------------------------------------------------------- /t-regress/fixed/early_pass/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.50 4 | set_free_handicap q4 q10 q16 d16 d10 d4 5 | play W o17 6 | play B r14 7 | play W f17 8 | play B c14 9 | play W k16 10 | play B k4 11 | play W c6 12 | play B f3 13 | play W b4 14 | play B c3 15 | play W c8 16 | play B r4 17 | play W m3 18 | play B o3 19 | play W k3 20 | play B l4 21 | play W l3 22 | play B m4 23 | play W h3 24 | play B h5 25 | play W n3 26 | play B n4 27 | play W o2 28 | play B p3 29 | play W r12 30 | play B r10 31 | play W p12 32 | play B o10 33 | play W n12 34 | play B m11 35 | play W r17 36 | play B q17 37 | play W r16 38 | play B q15 39 | play W q18 40 | play B p18 41 | play W r18 42 | play B n16 43 | play W o16 44 | play B o15 45 | play W n15 46 | play B o14 47 | play W n14 48 | play B n17 49 | play W o18 50 | play B q12 51 | play W q13 52 | play B r13 53 | play W q11 54 | play B s12 55 | play W q14 56 | play B r15 57 | play W o13 58 | play B p15 59 | play W p17 60 | play B h16 61 | play W f15 62 | play B h14 63 | play W f13 64 | play B h12 65 | play W f11 66 | play B c11 67 | play W h10 68 | play B j11 69 | play W j10 70 | play B k11 71 | play W e9 72 | play B k9 73 | play W c17 74 | play B c16 75 | play W d17 76 | play B j9 77 | play W b10 78 | play B b11 79 | play W c10 80 | play B d11 81 | play W d9 82 | play B g8 83 | play W b17 84 | play B b16 85 | play W p2 86 | play B r2 87 | play W l15 88 | play B j17 89 | play W k17 90 | play B j18 91 | play W k18 92 | play B b3 93 | play W q2 94 | play B r3 95 | play W r11 96 | play B s11 97 | play W o11 98 | play B n10 99 | play W p10 100 | play B p9 101 | play W p11 102 | play B f6 103 | play W j4 104 | play B j5 105 | play W g2 106 | play B f2 107 | play W f1 108 | play B e1 109 | play W g1 110 | play B e2 111 | play W s15 112 | play B b5 113 | play W c5 114 | play B c4 115 | play W b6 116 | play B a4 117 | play W d13 118 | play B c13 119 | play W a11 120 | play B a12 121 | play W a10 122 | play B b13 123 | play W s14 124 | play B s13 125 | play W l12 126 | play B k10 127 | play W e16 128 | play B j14 129 | play W d15 130 | play B c15 131 | play W r1 132 | play B s1 133 | play W q1 134 | play B s2 135 | play W g18 136 | play B pass 137 | tunit genmove W !pass 138 | -------------------------------------------------------------------------------- /t-regress/fixed/first_line_connect/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | echo Oct 25 11:26:53 2022 3 | boardsize 19 4 | clear_board 5 | komi 0.5 6 | set_free_handicap q16 d4 q4 7 | play w c16 8 | play b e16 9 | play w h16 10 | play b d14 11 | play w e15 12 | play b d15 13 | play w d16 14 | play b e17 15 | play w f15 16 | play b c18 17 | play w b14 18 | play b b17 19 | play w b16 20 | play b g17 21 | play w c12 22 | play b d12 23 | play w d11 24 | play b e12 25 | play w c10 26 | play b e11 27 | play w e10 28 | play b g11 29 | play w f10 30 | play b g13 31 | play w h14 32 | play b j12 33 | play w h17 34 | play b h18 35 | play w j18 36 | play b g18 37 | play w k17 38 | play b d9 39 | play w d10 40 | play b c7 41 | play w o17 42 | play b o16 43 | play w n16 44 | play b o15 45 | play w p17 46 | play b q17 47 | play w r14 48 | play b r15 49 | play w q14 50 | play b p16 51 | play w r10 52 | play b n17 53 | play w n18 54 | play b m17 55 | play w m18 56 | play b m16 57 | play w l17 58 | play b l15 59 | play w r6 60 | play b q6 61 | play w q7 62 | play b p6 63 | play w r5 64 | play b r4 65 | play w k3 66 | play b m3 67 | play w f3 68 | play b h3 69 | play w f5 70 | play b h5 71 | play w k5 72 | play b h7 73 | play w h2 74 | play b j3 75 | play w j2 76 | play b l2 77 | play w k2 78 | play b d3 79 | play w e2 80 | play b d2 81 | play w h9 82 | play b j7 83 | play w m4 84 | play b n3 85 | play w l3 86 | play b e6 87 | play w n4 88 | play b o3 89 | play w o4 90 | play b p4 91 | play w m2 92 | play b n2 93 | play w l1 94 | play b c13 95 | play w b13 96 | play b q18 97 | play w k14 98 | play b l12 99 | play w l14 100 | play b n12 101 | play w m13 102 | play b m12 103 | play w m15 104 | play b n15 105 | play w m14 106 | play b l16 107 | play w k16 108 | play b o18 109 | play w k15 110 | play b p18 111 | play w b8 112 | play b b7 113 | play w c8 114 | play b d8 115 | play w a7 116 | play b a6 117 | 118 | echo play w a8 119 | tunit genmove w !A8 120 | 121 | -------------------------------------------------------------------------------- /t-regress/fixed/first_line_connect/foo.sgf: -------------------------------------------------------------------------------- 1 | (;C[ Oct 25 11:26:53 2022 2 | ] 3 | SZ[19] 4 | RU[japanese] 5 | KM[0.5] 6 | HA[3] 7 | ;B[pd] 8 | ;B[dp] 9 | ;B[pp] 10 | ;W[cd] 11 | ;B[ed] 12 | ;W[hd] 13 | ;B[df] 14 | ;W[ee] 15 | ;B[de] 16 | ;W[dd] 17 | ;B[ec] 18 | ;W[fe] 19 | ;B[cb] 20 | ;W[bf] 21 | ;B[bc] 22 | ;W[bd] 23 | ;B[gc] 24 | ;W[ch] 25 | ;B[dh] 26 | ;W[di] 27 | ;B[eh] 28 | ;W[cj] 29 | ;B[ei] 30 | ;W[ej] 31 | ;B[gi] 32 | ;W[fj] 33 | ;B[gg] 34 | ;W[hf] 35 | ;B[ih] 36 | ;W[hc] 37 | ;B[hb] 38 | ;W[ib] 39 | ;B[gb] 40 | ;W[jc] 41 | ;B[dk] 42 | ;W[dj] 43 | ;B[cm] 44 | ;W[nc] 45 | ;B[nd] 46 | ;W[md] 47 | ;B[ne] 48 | ;W[oc] 49 | ;B[pc] 50 | ;W[qf] 51 | ;B[qe] 52 | ;W[pf] 53 | ;B[od] 54 | ;W[qj] 55 | ;B[mc] 56 | ;W[mb] 57 | ;B[lc] 58 | ;W[lb] 59 | ;B[ld] 60 | ;W[kc] 61 | ;B[ke] 62 | ;W[qn] 63 | ;B[pn] 64 | ;W[pm] 65 | ;B[on] 66 | ;W[qo] 67 | ;B[qp] 68 | ;W[jq] 69 | ;B[lq] 70 | ;W[fq] 71 | ;B[hq] 72 | ;W[fo] 73 | ;B[ho] 74 | ;W[jo] 75 | ;B[hm] 76 | ;W[hr] 77 | ;B[iq] 78 | ;W[ir] 79 | ;B[kr] 80 | ;W[jr] 81 | ;B[dq] 82 | ;W[er] 83 | ;B[dr] 84 | ;W[hk] 85 | ;B[im] 86 | ;W[lp] 87 | ;B[mq] 88 | ;W[kq] 89 | ;B[en] 90 | ;W[mp] 91 | ;B[nq] 92 | ;W[np] 93 | ;B[op] 94 | ;W[lr] 95 | ;B[mr] 96 | ;W[ks] 97 | ;B[cg] 98 | ;W[bg] 99 | ;B[pb] 100 | ;W[jf] 101 | ;B[kh] 102 | ;W[kf] 103 | ;B[mh] 104 | ;W[lg] 105 | ;B[lh] 106 | ;W[le] 107 | ;B[me] 108 | ;W[lf] 109 | ;B[kd] 110 | ;W[jd] 111 | ;B[nb] 112 | ;W[je] 113 | ;B[ob] 114 | ;W[bl] 115 | ;B[bm] 116 | ;W[cl] 117 | ;B[dl] 118 | ;W[am] 119 | ;B[an] 120 | C[ play w a8 121 | ] 122 | ) 123 | -------------------------------------------------------------------------------- /t-regress/fixed/first_line_connect2/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.5 4 | play b c18 5 | play b g18 6 | play b h18 7 | play b o18 8 | play b p18 9 | play b q18 10 | play b b17 11 | play b e17 12 | play b g17 13 | play b m17 14 | play b n17 15 | play b q17 16 | play b e16 17 | play b l16 18 | play b m16 19 | play b o16 20 | play b p16 21 | play b q16 22 | play b d15 23 | play b l15 24 | play b n15 25 | play b o15 26 | play b r15 27 | play b d14 28 | play b c13 29 | play b g13 30 | play b d12 31 | play b e12 32 | play b j12 33 | play b l12 34 | play b m12 35 | play b n12 36 | play b e11 37 | play b g11 38 | play b d9 39 | play b d8 40 | play b b7 41 | play b c7 42 | play b h7 43 | play b j7 44 | play b a6 45 | play b e6 46 | play b p6 47 | play b q6 48 | play b h5 49 | play b r5 50 | play b d4 51 | play b p4 52 | play b q4 53 | play b r4 54 | play b d3 55 | play b h3 56 | play b j3 57 | play b m3 58 | play b n3 59 | play b o3 60 | play b d2 61 | play b n2 62 | play b b5 63 | play w j18 64 | play w m18 65 | play w n18 66 | play w h17 67 | play w k17 68 | play w l17 69 | play w b16 70 | play w c16 71 | play w d16 72 | play w h16 73 | play w k16 74 | play w e15 75 | play w f15 76 | play w k15 77 | play w m15 78 | play w b14 79 | play w h14 80 | play w k14 81 | play w l14 82 | play w m14 83 | play w q14 84 | play w r14 85 | play w b13 86 | play w m13 87 | play w c12 88 | play w d11 89 | play w c10 90 | play w d10 91 | play w e10 92 | play w f10 93 | play w r10 94 | play w c9 95 | play w h9 96 | play w r9 97 | play w a8 98 | play w b8 99 | play w c8 100 | play w r8 101 | play w a7 102 | play w s6 103 | play w f5 104 | play w k5 105 | play w m4 106 | play w n4 107 | play w o4 108 | play w f3 109 | play w k3 110 | play w l3 111 | play w e2 112 | play w h2 113 | play w j2 114 | play w k2 115 | play w m2 116 | play w l1 117 | 118 | play w s5 119 | play b s4 120 | play w t4 121 | play b t3 122 | tunit genmove w !T5 123 | -------------------------------------------------------------------------------- /t-regress/fixed/first_line_connect2/foo.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[19] 2 | RU[chinese] 3 | KM[0.5] 4 | ;B[cb] 5 | ;B[gb] 6 | ;B[hb] 7 | ;B[nb] 8 | ;B[ob] 9 | ;B[pb] 10 | ;B[bc] 11 | ;B[ec] 12 | ;B[gc] 13 | ;B[lc] 14 | ;B[mc] 15 | ;B[pc] 16 | ;B[ed] 17 | ;B[kd] 18 | ;B[ld] 19 | ;B[nd] 20 | ;B[od] 21 | ;B[pd] 22 | ;B[de] 23 | ;B[ke] 24 | ;B[me] 25 | ;B[ne] 26 | ;B[qe] 27 | ;B[df] 28 | ;B[cg] 29 | ;B[gg] 30 | ;B[dh] 31 | ;B[eh] 32 | ;B[ih] 33 | ;B[kh] 34 | ;B[lh] 35 | ;B[mh] 36 | ;B[ei] 37 | ;B[gi] 38 | ;B[dk] 39 | ;B[dl] 40 | ;B[bm] 41 | ;B[cm] 42 | ;B[hm] 43 | ;B[im] 44 | ;B[an] 45 | ;B[en] 46 | ;B[on] 47 | ;B[pn] 48 | ;B[ho] 49 | ;B[qo] 50 | ;B[dp] 51 | ;B[op] 52 | ;B[pp] 53 | ;B[qp] 54 | ;B[rp] 55 | ;B[dq] 56 | ;B[hq] 57 | ;B[iq] 58 | ;B[lq] 59 | ;B[mq] 60 | ;B[nq] 61 | ;B[dr] 62 | ;B[mr] 63 | ;B[bo] 64 | ;W[ib] 65 | ;W[lb] 66 | ;W[mb] 67 | ;W[hc] 68 | ;W[jc] 69 | ;W[kc] 70 | ;W[bd] 71 | ;W[cd] 72 | ;W[dd] 73 | ;W[hd] 74 | ;W[jd] 75 | ;W[ee] 76 | ;W[fe] 77 | ;W[je] 78 | ;W[le] 79 | ;W[bf] 80 | ;W[hf] 81 | ;W[jf] 82 | ;W[kf] 83 | ;W[lf] 84 | ;W[pf] 85 | ;W[qf] 86 | ;W[bg] 87 | ;W[lg] 88 | ;W[ch] 89 | ;W[di] 90 | ;W[cj] 91 | ;W[dj] 92 | ;W[ej] 93 | ;W[fj] 94 | ;W[qj] 95 | ;W[ck] 96 | ;W[hk] 97 | ;W[qk] 98 | ;W[al] 99 | ;W[bl] 100 | ;W[cl] 101 | ;W[ql] 102 | ;W[am] 103 | ;W[rn] 104 | ;W[fo] 105 | ;W[jo] 106 | ;W[ro] 107 | ;W[lp] 108 | ;W[mp] 109 | ;W[np] 110 | ;W[sp] 111 | ;W[fq] 112 | ;W[jq] 113 | ;W[kq] 114 | ;W[er] 115 | ;W[hr] 116 | ;W[ir] 117 | ;W[jr] 118 | ;W[lr] 119 | ;W[ks] 120 | ;B[sq] 121 | ) 122 | -------------------------------------------------------------------------------- /t-regress/fixed/first_line_connect2/notes: -------------------------------------------------------------------------------- 1 | Move: 116 Komi: 0.5 Handicap: 0 Captures B: 0 W: 0 [0 0 0 0] 2 | A B C D E F G H J K L M N O P Q R S T 3 | +---------------------------------------+ 4 | 19 | . . . . . . . . . . . . . . . . . . . | 19 5 | 18 | . . X . . . X X O . . O O X X X . . . | 18 6 | 17 | . X . . X . X O . O O X X . . X . . . | 17 7 | 16 | . O O O X . . O . O X X . X X X . . . | 16 8 | 15 | . . . X O O . . . O X O X X . . X . . | 15 9 | 14 | . O . X . . . O . O O O . . . O O . . | 14 10 | 13 | . O X . . . X . . . . O . . . . . . . | 13 11 | 12 | . . O X X . . . X . X X X . . . . . . | 12 12 | 11 | . . . O X . X . . . . . . . . . . . . | 11 13 | 10 | . . O O O O . . . . . . . . . . O . . | 10 14 | 9 | . . O X . . . O . . . . . . . . O . . | 9 15 | 8 | O O O X . . . . . . . . . . . . O . . | 8 16 | 7 | O X X . . . . X X . . . . . . . . . . | 7 17 | 6 | X . . . X . . . . . . . . . X X . O . | 6 18 | 5 | . X . . . O . X . O . . . . . . X O . | 5 19 | 4 | . . . X . . . . . . . O O O X X X X O | 4 20 | 3 | . . . X . O . X X O O X X X . . . . X)| 3 21 | 2 | . . . X O . . O O O . O X . . . . . . | 2 22 | 1 | . . . . . . . . . . O . . . . . . . . | 1 23 | +---------------------------------------+ 24 | 25 | dcnn = [ T5 S15 N1 S14 D1 S3 K11 P2 J10 T6 P12 F6 P3 K9 C17 E8 O17 D18 E5 F16 ] 26 | [ 85 3 2 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] 27 | 28 | can't defend at T5 otherwise all 4 stones get captured ! 29 | T5 S7 R7 R6 30 | 31 | however T5 dcnn 85%, 32 | takes 40k+ playouts to override ... 33 | 34 | 35 | ------------------------------------------------------------------------------------------ 36 | fixed ! 37 | 38 | dcnn blunder fix 39 | 40 | 41 | -------------------------------------------------------------------------------- /t-regress/fixed/group_2lib_blunder/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.50 4 | play B q16 5 | play W d4 6 | play B q4 7 | play W d17 8 | play B f3 9 | play W c6 10 | play B k4 11 | play W r6 12 | play B r8 13 | play W r3 14 | play B q3 15 | play W r4 16 | play B q5 17 | play W s6 18 | play B p7 19 | play W o17 20 | play B r14 21 | play W k16 22 | play B f5 23 | play W d2 24 | play B d15 25 | play W d12 26 | play B g16 27 | play W e15 28 | play B e14 29 | play W f15 30 | play B f14 31 | play W g15 32 | play B d16 33 | play W e17 34 | play B c17 35 | play W c18 36 | play B b16 37 | play W b17 38 | play B c16 39 | play W b18 40 | play B g14 41 | play W h15 42 | play B d10 43 | play W c13 44 | play B c14 45 | play W f12 46 | play B h13 47 | play W h12 48 | play B j12 49 | play W h11 50 | play B j11 51 | play W j13 52 | play B h10 53 | play W g10 54 | play B g9 55 | play W f10 56 | play B f9 57 | play W e10 58 | play B e9 59 | play W d9 60 | play B b13 61 | play W b12 62 | play B d13 63 | play W c12 64 | play B h14 65 | 66 | play w j14 67 | play b g12 68 | tunit genmove W !G11 69 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 0.50 5 | play B q16 6 | play W d4 7 | play B q4 8 | play W d16 9 | play B q10 10 | play W o3 11 | play B m3 12 | play W o5 13 | play B q6 14 | play W l4 15 | play B m4 16 | play W m5 17 | play B l3 18 | play W k4 19 | play B k3 20 | play W j4 21 | play B h3 22 | play W g5 23 | play B g3 24 | play W o17 25 | play B m17 26 | play W o15 27 | play B q14 28 | play W l16 29 | play B m16 30 | play W m15 31 | play B l17 32 | play W k16 33 | play B k17 34 | play W j16 35 | play B h17 36 | play W g15 37 | play B g17 38 | play W d10 39 | genmove b 40 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki/game.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[0.50]TM[60]OT[5x30 byo-yomi] 3 | PW[poor]PB[pachipachi]WR[4d]BR[3d]DT[2023-04-12]PC[The KGS Go Server at http://www.gokgs.com/]C[pachipachi [3d\]: GTP Engine for pachipachi (black): Pachi version 12.70. Have a good game ! 4 | ]RE[B+Resign] 5 | ;B[pd]BL[56.653] 6 | ;W[dp]WL[58.03] 7 | ;B[pp]BL[53.642] 8 | ;W[dd]WL[56.559] 9 | ;B[pj]BL[50.671] 10 | ;W[nq]WL[54.226] 11 | ;B[lq]BL[47.715] 12 | ;W[no]WL[52.793] 13 | ;B[pn]BL[44.756] 14 | ;W[kp]WL[51.837] 15 | ;B[lp]BL[41.731] 16 | ;W[lo]WL[50.394] 17 | ;B[kq]BL[35.933] 18 | ;W[jp]WL[49.008] 19 | ;B[jq]BL[32.498] 20 | ;W[ip]WL[48.154] 21 | ;B[hq]BL[29.071] 22 | ;W[go]WL[47.311] 23 | ;B[gq]BL[23.513] 24 | ;W[nc]WL[43.845] 25 | ;B[lc]BL[19.538] 26 | ;W[ne]WL[42.404] 27 | ;B[pf]BL[16.16] 28 | ;W[kd]WL[41.445] 29 | ;B[ld]BL[10.776] 30 | ;W[le]WL[40.643] 31 | ;B[kc]BL[5.198] 32 | ;W[jd]WL[39.581] 33 | ;B[jc]BL[1.799] 34 | ;W[id]WL[38.882] 35 | ;B[hc]BL[30]OB[5] 36 | ;W[ge]WL[37.709] 37 | ;B[gc]BL[30]OB[5] 38 | ;W[dj]WL[36.738] 39 | ;B[he]BL[30]OB[5] 40 | ;W[hd]WL[33.666] 41 | ;B[gd]BL[30]OB[5] 42 | ;W[hf]WL[32.739] 43 | ;B[fe]BL[30]OB[5] 44 | ;W[gf]WL[32.087] 45 | ;B[ff]BL[30]OB[5] 46 | ;W[ic]WL[15.916] 47 | ;B[ib]BL[30]OB[5] 48 | ;W[fd]WL[15.177] 49 | ;B[ed]BL[30]OB[5] 50 | ;W[fc]WL[14.051] 51 | ;B[ec]BL[30]OB[5] 52 | ;W[fb]WL[12.723] 53 | ;B[gb]BL[30]OB[5] 54 | ;W[ga]WL[11.719] 55 | ;B[hb]BL[30]OB[5] 56 | ;W[eb]WL[10.998] 57 | ;B[dc]BL[30]OB[5] 58 | ;W[db]WL[10.257] 59 | ;B[cc]BL[30]OB[5] 60 | ;W[cb]WL[9.405] 61 | ;B[bb]BL[30]OB[5] 62 | ;W[ee]WL[7.894] 63 | ;B[bc]BL[30]OB[5] 64 | ;W[df]WL[3.998] 65 | ;B[fg]BL[30]OB[5]) 66 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki/notes: -------------------------------------------------------------------------------- 1 | 2 | poor pachipachi 2023-04-12 3 | 4 | Move: 34 Komi: 0.5 Handicap: 0 Captures B: 0 W: 0 [0 0 0 0] 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . . . . . . . . . . . . . . . . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . . . . X X . X X X . O . . . . . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . . . O . . . . O O O X . . . X . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . . . . . O . . . . O . O . . . . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . . . . . . . . . . . . . . X . . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . . . . . . . . . . . . . . . . . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . . . . . . . . . . . . . . . . . . . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . . . . . . . . . . . . . . . . . . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . . O). . . . . . . . . . . X . . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . . . . . . . . . . . . . . . . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . . . . . . . . . . . . . . . . . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . . . . . . . . . . . . . . . . . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . . . . . . . . . . . . . . . X . . . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . . . . O . . . . O . O . . . . . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . . O . . . . O O O X . . . X . . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . . . . . X X . X X X . O . . . . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . . . . . . . . . . . . . . . . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | 29 | the kind of extreme influence fuseki that should trigger 30 | josekifix influence fuseki countermeasures 31 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki2/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B q16 6 | play W q5 7 | play B r3 8 | play W r4 9 | play B q3 10 | play W o5 11 | play B n3 12 | play W q10 13 | play B r12 14 | play W p12 15 | play B r14 16 | play W d15 17 | play B d17 18 | play W d5 19 | play B c3 20 | play W c4 21 | play B d3 22 | play W f5 23 | play B f3 24 | play W d10 25 | play B c15 26 | play W c14 27 | play B c16 28 | play W d14 29 | play B f17 30 | play W e16 31 | play B g18 32 | play W o3 33 | play B o2 34 | play W n4 35 | play B m3 36 | play W m4 37 | play B c8 38 | play W e8 39 | play B c11 40 | play W c10 41 | play B b12 42 | play W d11 43 | genmove b 44 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki2/notes: -------------------------------------------------------------------------------- 1 | 2 | huff pachipachi 2023-04-16 3 | 4 | Move: 38 Komi: 6.5 Handicap: 0 Captures B: 0 W: 0 [0 0 0 0] 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . . . X . . . . . . . . . . . . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . X . X . . . . . . . . . . . . . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . . X . O . . . . . . . . . . X . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . X O . . . . . . . . . . . . . . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . O O . . . . . . . . . . . . X . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . . . . . . . . . . . . . . . . . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . X . . . . . . . . . . . . O . X . . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . X O). . . . . . . . . . . . . . . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . O O . . . . . . . . . . . O . . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . . . . . . . . . . . . . . . . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . X . O . . . . . . . . . . . . . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . . . . . . . . . . . . . . . . . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . . . . . . . . . . . . . . . . . . . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . O . O . . . . . . . O . O . . . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . O . . . . . . . . O O . . . O . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . X X . X . . . . . X X O . X X . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . . . . . . . . . . . X . . . . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | extreme influence fuseki 29 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki3/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B d4 6 | play W q16 7 | play B r4 8 | play W d16 9 | play B c14 10 | play W f17 11 | play B o3 12 | play W c6 13 | play B c8 14 | play W c3 15 | play B d3 16 | play W c4 17 | play B d5 18 | play W b6 19 | play B e7 20 | play W j3 21 | play B o17 22 | play W r14 23 | play B h16 24 | play W b16 25 | play B q11 26 | play W q18 27 | play B k5 28 | play W m3 29 | play B n4 30 | play W m4 31 | play B m5 32 | play W o2 33 | play B f14 34 | play W p3 35 | play B p4 36 | play W q3 37 | play B l4 38 | play W l3 39 | play B r3 40 | play W q4 41 | play B q5 42 | play W p5 43 | play B o4 44 | play W n3 45 | play B p6 46 | play W r5 47 | play B q6 48 | play W r2 49 | play B s3 50 | play W s2 51 | play B s5 52 | play W t3 53 | play B r6 54 | play W s11 55 | play B p13 56 | play W o15 57 | play B n14 58 | play W n15 59 | play B m14 60 | play W m15 61 | play B l15 62 | play W l16 63 | play B k15 64 | play W k16 65 | play B j16 66 | genmove w 67 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki3/notes: -------------------------------------------------------------------------------- 1 | 2 | pachipachi madalinG 2023-04-16 3 | 4 | Move: 61 Komi: 6.5 Handicap: 0 Captures B: 1 W: 0 [0 0 0 0] 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . . . . . . . . . . . . O . . . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . . . O . . . . . . . X . . . . . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . O . O . . . X X)O O . . . . O . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . . . . . . . . X X O O O . . . . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . X . . X . . . . . X X . . . O . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . . . . . . . . . . . . . X . . . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . . . . . . . . . . . . . . . . . . . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . . . . . . . . . . . . . . X . O . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . . . . . . . . . . . . . . . . . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . . . . . . . . . . . . . . . . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . X . . . . . . . . . . . . . . . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . . . X . . . . . . . . . . . . . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . O O . . . . . . . . . . . X X X . . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . X . . . . . X . X . . O X . X . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . O X . . . . . . X O X X X O X . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . O X . . . . O . O O O X O O X X O | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . . . . . . . . . . . O . . O O . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | extreme influence 29 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki4/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B q16 6 | play W q4 7 | play B c16 8 | play W d4 9 | play B j16 10 | play W d13 11 | play B e16 12 | play W d10 13 | play B f3 14 | play W d6 15 | play B d2 16 | play W h3 17 | play B c3 18 | play W e3 19 | play B e2 20 | play W f4 21 | play B g3 22 | play W g4 23 | play B e5 24 | play W f6 25 | play B h2 26 | play W g2 27 | play B f2 28 | play W j2 29 | play B h4 30 | play W j3 31 | play B r3 32 | play W q3 33 | play B r4 34 | play W r5 35 | play B s5 36 | play W r6 37 | play B s6 38 | play W r7 39 | play B q2 40 | play W p2 41 | play B r2 42 | play W o3 43 | play B r14 44 | play W q13 45 | play B r13 46 | play W q11 47 | play B q12 48 | play W p12 49 | play B r12 50 | play W n11 51 | play B j10 52 | play W d15 53 | play B d16 54 | play W g14 55 | play B j14 56 | play W j12 57 | genmove w 58 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki4/game.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[6.50]TM[60]OT[5x30 byo-yomi] 3 | PW[huff]PB[pachipachi]WR[3d]BR[3d]DT[2023-04-19]PC[The KGS Go Server at http://www.gokgs.com/]C[pachipachi [3d\]: GTP Engine for pachipachi (black): Pachi version 12.70. Have a good game ! 4 | ]RE[B+Resign] 5 | ;B[pd]BL[56.817] 6 | ;W[pp]WL[58.008] 7 | ;B[cd]BL[53.849] 8 | ;W[dp]WL[57.073] 9 | ;B[id]BL[50.882] 10 | ;W[dg]WL[53.917] 11 | ;B[ed]BL[47.777] 12 | ;W[dj]WL[53.059] 13 | ;B[fq]BL[44.814] 14 | ;W[dn]WL[48.485] 15 | ;B[dr]BL[41.606] 16 | ;W[hq]WL[47.248] 17 | ;B[cq]BL[38.082] 18 | ;W[eq]WL[45.482] 19 | ;B[er]BL[34.568] 20 | ;W[fp]WL[44.248] 21 | ;B[gq]BL[28.841] 22 | ;W[gp]WL[42.818] 23 | ;B[eo]BL[17.35] 24 | ;W[fn]WL[19.085] 25 | ;B[hr]BL[7.604] 26 | ;W[gr]WL[16.117] 27 | ;B[fr]BL[30]OB[5] 28 | ;W[ir]WL[15.292] 29 | ;B[hp]BL[30]OB[5] 30 | ;W[iq]WL[13.774] 31 | ;B[qq]BL[30]OB[5] 32 | ;W[pq]WL[11.697] 33 | ;B[qp]BL[30]OB[5] 34 | ;W[qo]WL[10.361] 35 | ;B[ro]BL[30]OB[5] 36 | ;W[qn]WL[8.843] 37 | ;B[rn]BL[30]OB[5] 38 | ;W[qm]WL[7.395] 39 | ;B[pr]BL[30]OB[5] 40 | ;W[or]WL[5.312] 41 | ;B[qr]BL[30]OB[5] 42 | ;W[nq]WL[4.405] 43 | ;B[qf]BL[30]OB[5] 44 | ;W[pg]WL[30]OW[5] 45 | ;B[qg]BL[30]OB[5] 46 | ;W[pi]WL[30]OW[5] 47 | ;B[ph]BL[30]OB[5] 48 | ;W[oh]WL[30]OW[5] 49 | ;B[qh]BL[30]OB[5] 50 | ;W[mi]WL[30]OW[5] 51 | ;B[ij]BL[30]OB[5] 52 | ;W[de]WL[30]OW[5] 53 | ;B[dd]BL[30]OB[5] 54 | ;W[gf]WL[30]OW[5] 55 | ;B[if]BL[30]OB[5] 56 | ;W[ih]WL[30]OW[5] 57 | ;B[jl]BL[30]OB[5] 58 | ;W[kh]WL[30]OW[5] 59 | ;B[in]BL[30]OB[5] 60 | ;W[kn]WL[30]OW[4] 61 | ;B[gm]BL[30]OB[5] 62 | ;W[gn]WL[30]OW[4] 63 | ;B[hn]BL[30]OB[5] 64 | ;W[gk]WL[30]OW[4] 65 | ;B[fm]BL[30]OB[5] 66 | ;W[em]WL[30]OW[4] 67 | ;B[el]BL[30]OB[5] 68 | ;W[ho]WL[30]OW[4] 69 | ;B[fk]BL[30]OB[5] 70 | ;W[gj]WL[30]OW[4] 71 | ;B[dk]BL[30]OB[5] 72 | ;W[ej]WL[30]OW[3] 73 | ;B[ck]BL[30]OB[5] 74 | ;W[cj]WL[30]OW[3] 75 | ;B[hl]BL[30]OB[5] 76 | ;W[cm]WL[30]OW[3] 77 | ;B[en]BL[30]OB[5] 78 | ;W[dm]WL[30]OW[3] 79 | ;B[ep]BL[30]OB[5] 80 | ;W[ip]WL[30]OW[3] 81 | ;B[bl]BL[30]OB[5] 82 | ;W[cp]WL[30]OW[3] 83 | ;B[dq]BL[30]OB[5]) 84 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki4/notes: -------------------------------------------------------------------------------- 1 | 2 | huff pachipachi 2023-04-19 3 | 4 | Move: 52 Komi: 6.5 Handicap: 0 Captures B: 0 W: 0 [0 0 0 0] 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . . . . . . . . . . . . . . . . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . . . . . . . . . . . . . . . . . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . . X X X . . . X . . . . . . X . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . . O . . . . . . . . . . . . . . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . . . . . O . X . . . . . . . X . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . . O . . . . . . . . . . . O X . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . . . . . . . . O). . . . . O X X . . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . . . . . . . . . . . O . . O . . . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . . O . . . . X . . . . . . . . . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . . . . . . . . . . . . . . . . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . . . . . . . . . . . . . . . . . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . . . . . . . . . . . . . . . O . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . . . O . O . . . . . . . . . . O X . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . . X . . . . . . . . . . . O X . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . . O . O O X . . . . . . . O X . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . X . O X X O O . . . . O . O X . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . X X X O X O . . . . . O X X . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | extreme influence 29 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki5/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B q16 6 | play W q5 7 | play B q3 8 | play W r14 9 | play B o17 10 | play W q11 11 | play B r5 12 | play W r6 13 | play B r4 14 | play W q6 15 | play B c16 16 | play W d4 17 | play B o3 18 | play W p4 19 | play B n2 20 | play W q4 21 | play B r3 22 | play W e16 23 | play B g17 24 | play W f15 25 | play B c13 26 | play W h16 27 | play B d17 28 | play W j14 29 | play B f3 30 | play W m5 31 | play B c3 32 | play W d3 33 | play B c4 34 | play W d5 35 | play B d2 36 | play W e2 37 | play B c2 38 | play W e3 39 | play B c6 40 | play W d6 41 | play B c7 42 | play W k4 43 | play B e8 44 | play W h8 45 | genmove b 46 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki5/game.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Japanese]SZ[19]KM[6.50]TM[60]OT[5x30 byo-yomi] 3 | PW[huff]PB[pachipachi]WR[3d]BR[3d]DT[2023-04-21]PC[The KGS Go Server at http://www.gokgs.com/]C[pachipachi [3d\]: GTP Engine for pachipachi (black): Pachi version 12.70. Have a good game ! 4 | ]RE[B+Resign] 5 | ;B[pd]BL[56.795] 6 | ;W[po]WL[57.152] 7 | ;B[pq]BL[47.162] 8 | ;W[qf]WL[54.769] 9 | ;B[nc]BL[44.204] 10 | ;W[pi]WL[53.269] 11 | ;B[qo]BL[41.263] 12 | ;W[qn]WL[51.415] 13 | ;B[qp]BL[31.877] 14 | ;W[pn]WL[50.657] 15 | ;B[cd]BL[22.516] 16 | ;W[dp]WL[34.94] 17 | ;B[nq]BL[19.074] 18 | ;W[op]WL[25.824] 19 | ;B[mr]BL[9.408] 20 | ;W[pp]WL[12.809] 21 | ;B[qq]BL[30]OB[5] 22 | ;W[ed]WL[7.761] 23 | ;B[gc]BL[30]OB[5] 24 | ;W[fe]WL[4.592] 25 | ;B[cg]BL[30]OB[5] 26 | ;W[hd]WL[2.518] 27 | ;B[dc]BL[30]OB[5] 28 | ;W[if]WL[30]OW[5] 29 | ;B[fq]BL[30]OB[5] 30 | ;W[lo]WL[30]OW[5] 31 | ;B[cq]BL[30]OB[5] 32 | ;W[dq]WL[30]OW[5] 33 | ;B[cp]BL[30]OB[5] 34 | ;W[do]WL[30]OW[5] 35 | ;B[dr]BL[30]OB[5] 36 | ;W[er]WL[30]OW[5] 37 | ;B[cr]BL[30]OB[5] 38 | ;W[eq]WL[30]OW[5] 39 | ;B[cn]BL[30]OB[5] 40 | ;W[dn]WL[30]OW[5] 41 | ;B[cm]BL[30]OB[5] 42 | ;W[jp]WL[30]OW[5] 43 | ;B[el]BL[30]OB[5] 44 | ;W[hl]WL[30]OW[5] 45 | ;B[gm]BL[30]OB[5] 46 | ;W[dm]WL[30]OW[5] 47 | ;B[dl]BL[30]OB[5] 48 | ;W[fm]WL[30]OW[5] 49 | ;B[fl]BL[30]OB[5] 50 | ;W[gl]WL[30]OW[5] 51 | ;B[fr]BL[30]OB[5] 52 | ;W[fp]WL[30]OW[5] 53 | ;B[gp]BL[30]OB[5] 54 | ;W[go]WL[30]OW[5] 55 | ;B[hp]BL[30]OB[5] 56 | ;W[ho]WL[30]OW[5] 57 | ;B[gj]BL[30]OB[5] 58 | ;W[ij]WL[30]OW[5] 59 | ;B[ji]BL[30]OB[5] 60 | ;W[hh]WL[30]OW[5] 61 | ;B[oh]BL[30]OB[5] 62 | ;W[of]WL[30]OW[5] 63 | ;B[oi]BL[30]OB[5] 64 | ;W[pj]WL[30]OW[5] 65 | ;B[oj]BL[30]OB[5] 66 | ;W[pg]WL[30]OW[5] 67 | ;B[mj]BL[30]OB[5] 68 | ;W[od]WL[30]OW[5] 69 | ;B[pc]BL[30]OB[5] 70 | ;W[mh]WL[30]OW[5] 71 | ;B[kk]BL[30]OB[5] 72 | ;W[jj]WL[30]OW[5] 73 | ;B[kj]BL[30]OB[5] 74 | ;W[li]WL[30]OW[5] 75 | ;B[pk]BL[30]OB[5] 76 | ;W[rj]WL[30]OW[4] 77 | ;B[nl]BL[30]OB[5] 78 | ;W[ll]WL[30]OW[4] 79 | ;B[ki]BL[30]OB[5] 80 | ;W[ml]WL[30]OW[4] 81 | ;B[mk]BL[30]OB[5] 82 | ;W[lg]WL[30]OW[4] 83 | ;B[ii]BL[30]OB[5] 84 | ;W[hi]WL[30]OW[4] 85 | ;B[hj]BL[30]OB[5] 86 | ;W[jl]WL[30]OW[4] 87 | ;B[kl]BL[30]OB[5] 88 | ;W[mn]WL[30]OW[4] 89 | ;B[il]BL[30]OB[5]) 90 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki5/notes: -------------------------------------------------------------------------------- 1 | 2 | huff pachipachi 2023-04-21 3 | 4 | Move: 40 Komi: 6.5 Handicap: 0 Captures B: 0 W: 0 [0 0 0 0] 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . . . . . . . . . . . . . . . . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . X . . X . . . . . . X . . . . . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . . X . O . . O . . . . . . . X . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . . . . O . . . . . . . . . . . . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . . . . . . . O . . . . . . . O . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . X . . . . . . . . . . . . . . . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . . . . . . . . . . . . . . . . . . . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . . . . . . . . . . . . . . O . . . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . . . . . . . . . . . . . . . . . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . . . . . . . . . . . . . . . . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . . . X . . O). . . . . . . . . . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . X . . . . . . . . . . . . . . . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . . X O . . . . . . . . . . . O O . . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . O . . . . . . . O . . . O X . . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . X O . . . . . O . . . . O O X . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . X O O X . . . . . . . X . X X . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . X X O . . . . . . . X . . . . . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | extreme influence 29 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki6/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B q16 6 | play W q4 7 | play B c16 8 | play W d4 9 | play B j16 10 | play W d13 11 | play B e16 12 | play W d10 13 | play B f3 14 | play W d6 15 | play B d2 16 | play W h3 17 | play B c3 18 | play W e3 19 | play B e2 20 | play W f4 21 | play B g3 22 | play W g4 23 | play B h2 24 | play W j3 25 | play B r3 26 | play W q3 27 | play B r4 28 | play W r5 29 | play B s5 30 | play W r6 31 | play B s6 32 | play W r7 33 | play B q2 34 | play W p2 35 | play B r2 36 | play W o3 37 | play B r14 38 | play W q13 39 | play B r13 40 | play W q11 41 | play B q12 42 | play W p12 43 | play B r12 44 | play W n11 45 | play B j2 46 | play W k3 47 | play B k11 48 | play W j15 49 | play B k16 50 | play W k15 51 | play B l15 52 | play W l14 53 | play B m14 54 | play W l13 55 | play B m15 56 | play W h15 57 | genmove b 58 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki6/notes: -------------------------------------------------------------------------------- 1 | 2 | huff pachipachi 2023-04-21 3 | 4 | Move: 52 Komi: 6.5 Handicap: 0 Captures B: 0 W: 0 [0 0 0 0] 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . . . . . . . . . . . . . . . . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . . . . . . . . . . . . . . . . . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . . X . X . . . X X . . . . . X . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . . . . . . O)O O X X . . . . . . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . . . . . . . . . O X . . . . X . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . . O . . . . . . O . . . . O X . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . . . . . . . . . . . . . . O X X . . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . . . . . . . . X . . O . . O . . . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . . O . . . . . . . . . . . . . . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . . . . . . . . . . . . . . . . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . . . . . . . . . . . . . . . . . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . . . . . . . . . . . . . . . O . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . . . O . . . . . . . . . . . . O X . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . . . . . . . . . . . . . . O X . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . . O . O O . . . . . . . . O X . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . X . O X X O O O . . . O . O X . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . X X . . X X . . . . . O X X . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | extreme influence 29 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki7/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 6.50 5 | play B q16 6 | play W d4 7 | play B q4 8 | play W d16 9 | play B f3 10 | play W c6 11 | play B k4 12 | play W r6 13 | play B o3 14 | play W s4 15 | play B r8 16 | play W r3 17 | play B r5 18 | play W s5 19 | play B q6 20 | play W q7 21 | play B r7 22 | play W s6 23 | play B p7 24 | play W o17 25 | play B q10 26 | play W r14 27 | play B q14 28 | play W q13 29 | play B p14 30 | play W r17 31 | play B r15 32 | play W q17 33 | play B r13 34 | play W k16 35 | play B c14 36 | play W c12 37 | play B e14 38 | play W f16 39 | play B d11 40 | play W d12 41 | play B e12 42 | play W c11 43 | play B d10 44 | play W c10 45 | play B d9 46 | play W c9 47 | play B d8 48 | play W c8 49 | play B d6 50 | genmove w 51 | -------------------------------------------------------------------------------- /t-regress/fixed/influence_fuseki7/notes: -------------------------------------------------------------------------------- 1 | 2 | pachipachi huff 2023-04-23 3 | 4 | Move: 45 Komi: 6.5 Handicap: 0 Captures B: 0 W: 0 [0 0 0 0] 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . . . . . . . . . . . . . . . . . . . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . . . . . . . . . . . . O . O O . . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . . . O . O . . . O . . . . . X . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | . . . . . . . . . . . . . . . . X . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | . . X . X . . . . . . . . . X X O . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | . . . . . . . . . . . . . . . O X . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . . O O X . . . . . . . . . . . . . . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . O X . . . . . . . . . . . . . . . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . O X . . . . . . . . . . . X . . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . O X . . . . . . . . . . . . . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . O X . . . . . . . . . . . . X . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . . . . . . . . . . . . . X O X . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . . O X). . . . . . . . . . . X O O . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . . . . . . . . . . . . . . X O . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . . O . . . . . X . . . . . X . O . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . . . . X . . . . . . . X . . O . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . . . . . . . . . . . . . . . . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . . . . . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | extreme influence 29 | -------------------------------------------------------------------------------- /t-regress/fixed/japanese_rules2/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 0.5 5 | play B D4 6 | play W D16 7 | play B Q16 8 | play W Q4 9 | play B D9 10 | play W D11 11 | play B L16 12 | play W J16 13 | play B Q11 14 | play W Q9 15 | play B J4 16 | play W L4 17 | play B J9 18 | play W L9 19 | play B L11 20 | play W J11 21 | play B L14 22 | play W J14 23 | play B O11 24 | play W O9 25 | play B J6 26 | play W L6 27 | play B F9 28 | play W F11 29 | play B L18 30 | play W J18 31 | play B B9 32 | play W B11 33 | play B J2 34 | play W L2 35 | play B S11 36 | play W S9 37 | play B H9 38 | play W M9 39 | play B L12 40 | play W J12 41 | play B J7 42 | play W G11 43 | play B N11 44 | play W L7 45 | play B A9 46 | play W A11 47 | play B L19 48 | play W J19 49 | play B J1 50 | play W L1 51 | play B T11 52 | play W T9 53 | play B C3 54 | play W R3 55 | play B R17 56 | play W C17 57 | play B L17 58 | play W J17 59 | play B L15 60 | play W J15 61 | play B L13 62 | play W J13 63 | play B C9 64 | play W C11 65 | play B E9 66 | play W E11 67 | play B G9 68 | play W H11 69 | play B J8 70 | play W L8 71 | play B J5 72 | play W L5 73 | play B J3 74 | play W L3 75 | play B M11 76 | play W N9 77 | play B P11 78 | play W P9 79 | play B R11 80 | play W R9 81 | play B E5 82 | play W E15 83 | play B P15 84 | play W P5 85 | play B T10 86 | play W A10 87 | play B S10 88 | play W B10 89 | play B R10 90 | play W C10 91 | play B Q10 92 | play W D10 93 | play B P10 94 | play W E10 95 | play B O10 96 | play W F10 97 | play B N10 98 | play W G10 99 | play B M10 100 | play W H10 101 | play B L10 102 | play W J10 103 | play B K19 104 | play W K1 105 | play B K18 106 | play W K2 107 | play B K17 108 | play W K3 109 | play B K16 110 | play W K4 111 | play B K15 112 | play W K5 113 | play B K14 114 | play W K6 115 | play B K13 116 | play W K7 117 | play B K12 118 | play W K8 119 | play B K11 120 | play W K9 121 | play B K10 122 | play W S2 123 | play B B2 124 | play W B18 125 | play B S18 126 | play W F14 127 | play B F6 128 | play W O6 129 | play B O14 130 | play W G13 131 | play B G7 132 | play W N7 133 | play B N13 134 | play W H12 135 | play B H8 136 | play W M8 137 | play B M12 138 | tunit genmove w pass 139 | -------------------------------------------------------------------------------- /t-regress/fixed/japanese_rules2/notes: -------------------------------------------------------------------------------- 1 | 2 | 3 | Move: 133 Komi: 0.5 Handicap: 0 Captures B: 0 W: 0 Score Est: B+0.5 4 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 5 | +---------------------------------------+ +---------------------------------------+ 6 | 19 | . . . . . . . . O X X . . . . . . . . | 19 | O O O O O O O O O X X X X X X X X X X | 7 | 18 | . O . . . . . . O X X . . . . . . X . | 18 | O O O O O O O O O X X X X X X X X X X | 8 | 17 | . . O . . . . . O X X . . . . . X . . | 17 | O O O O O O O O O X X X X X X X X X X | 9 | 16 | . . . O . . . . O X X . . . . X . . . | 16 | O O O O O O O O O X X X X X X X X X X | 10 | 15 | . . . . O . . . O X X . . . X . . . . | 15 | O O O O O O O O O X X X X X X X X X X | 11 | 14 | . . . . . O . . O X X . . X . . . . . | 14 | O O O O O O O O O X X X X X X X X X X | 12 | 13 | . . . . . . O . O X X . X . . . . . . | 13 | O O O O O O O O O X X X X X X X X X X | 13 | 12 | . . . . . . . O O X X X). . . . . . . | 12 | O O O O O O O O O X X X X X X X X X X | 14 | 11 | O O O O O O O O O X X X X X X X X X X | 11 | O O O O O O O O O X X X X X X X X X X | 15 | 10 | O O O O O O O O O X X X X X X X X X X | 10 | O O O O O O O O O X X X X X X X X X X | 16 | 9 | X X X X X X X X X O O O O O O O O O O | 9 | X X X X X X X X X O O O O O O O O O O | 17 | 8 | . . . . . . . X X O O O . . . . . . . | 8 | X X X X X X X X X O O O O O O O O O O | 18 | 7 | . . . . . . X . X O O . O . . . . . . | 7 | X X X X X X X X X O O O O O O O O O O | 19 | 6 | . . . . . X . . X O O . . O . . . . . | 6 | X X X X X X X X X O O O O O O O O O O | 20 | 5 | . . . . X . . . X O O . . . O . . . . | 5 | X X X X X X X X X O O O O O O O O O O | 21 | 4 | . . . X . . . . X O O . . . . O . . . | 4 | X X X X X X X X X O O O O O O O O O O | 22 | 3 | . . X . . . . . X O O . . . . . O . . | 3 | X X X X X X X X X O O O O O O O O O O | 23 | 2 | . X . . . . . . X O O . . . . . . O . | 2 | X X X X X X X X X O O O O O O O O O O | 24 | 1 | . . . . . . . . X O O . . . . . . . . | 1 | X X X X X X X X X O O O O O O O O O O | 25 | +---------------------------------------+ +---------------------------------------+ 26 | 27 | japanese rules, w to play: pass only move to win the game. 28 | uct won't consider it if pass_limit is 19*19/2 = 180 29 | 30 | -> pass_limit = board_earliest_pass(b) fixes it. -------------------------------------------------------------------------------- /t-regress/fixed/kill_3-3_invasion/notes: -------------------------------------------------------------------------------- 1 | 2 | pachipachi hidek 2018-03-15 3 | 4 | Move: 169 Komi: 0.5 Handicap: 0 Captures B: 4 W: 4 [0 0 0 0] d=5 5 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ +---------------------------------------+ 7 | 19 | . X . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 8 | 18 | . X O O . . . . . . . . . . . O O X . | 18 | : : : : : : : : : : : : : : : : : : : | 9 | 17 | . . X O . . . . . . . . . O . O X X . | 17 | : : : : : : : : : : : : : : : : : : : | 10 | 16 | . X X O . . . . . O . . . . O X . . . | 16 | : : : : : : : : : : : : : : : : : : : | 11 | 15 | X X O O . . . . . . . . O O . X . . . | 15 | : : : : : : : : : : : : : : : : : : : | 12 | 14 | O X X . . . . . . . . . . X . X . . . | 14 | : : : : : : : : : : : : : : : : : : : | 13 | 13 | O O X . O . . . . . . O O X X X X . . | 13 | : : : : : : : : : : : : : : : : : : : | 14 | 12 | . O O O . . . . . O O X X X O O O X . | 12 | : : : : : : : : : : : : : : : : : : : | 15 | 11 | . . O X O O O O . O X X X O O X X . . | 11 | : : : : : : : : : : : : : : : : : : : | 16 | 10 | . . O X X X X O X X O X . X O O X . . | 10 | : : : : : : : : : : : : : : : : : : : | 17 | 9 | . . . O O O X X X O O X X O O X . . . | 9 | : : : : : : : : : : : : : : : : : : : | 18 | 8 | . . . . . O O O X X O O X X O X . . . | 8 | : : : : : : : : : : : : : : : : : : : | 19 | 7 | . . . . . . . O X X O O O O O X . . . | 7 | : : : : : : : : : : : : : : : : : : : | 20 | 6 | . . . . . . . O X X X O X X X . . . . | 6 | : : : : : : : : : : : : : : : : : : : | 21 | 5 | . . . . . . O X X O O O X . . X . . . | 5 | : : : : : : : : : : : : : : : : : : : | 22 | 4 | . . . O . . . . X X O O X X . . . . . | 4 | : : : : : : : : : : : : : : : : : : : | 23 | 3 | . . X). . O . O . X X O O O X X . . . | 3 | : : : : : : : : : : : : : : : : : : : | 24 | 2 | . . . . . . . . O X O O O X X X . . . | 2 | : : : : : : : : : : : : : : : : : : : | 25 | 1 | . . . . . . . . . X X O . O X X . . . | 1 | : : : : : : : : : : : : : : : : : : : | 26 | +---------------------------------------+ +---------------------------------------+ 27 | 28 | can play B4 to kill corner since we own everything around here 29 | 30 | fixed with josekifix override (special check, need prev ownermap) 31 | -------------------------------------------------------------------------------- /t-regress/fixed/life_and_death_nakade/right_group.t: -------------------------------------------------------------------------------- 1 | % 5 stones nakade (closed area) 2 | boardsize 19 3 | . . . . . . . X O O . . . . . X . O . 4 | . O X . . . X . X O X . O X X O O X O 5 | O X . X . . . . X O . O O O X X O . . 6 | . O X . X X . . X O O X O . . X O O . 7 | . O . . . O . . X O X . X O . X X O . 8 | . . O . . . . . . . . X X X . X O O X 9 | . . . O . . . . . X X . X . X O X X X 10 | . . O . O . . . O X O . X O O O X . O 11 | . O X O O O . X O O X X O O . X X O O 12 | . O X X O . O X X O O X X O O O X X O 13 | . X . X X O X . . X O O . O O . O X . 14 | . O X X . . O). . X X O . . . O O X X 15 | O X . X . . . . . . . . O O O O X X O 16 | . . X . X . . . . . X X X . . X X O O 17 | . . . X . . X X X . O . . O O X . O . 18 | . . X . . . O O O . O X X . X O O O X 19 | . . X O . . . . . . O O X . X . O . O 20 | X X O . O . . . . . . . . . . X X O . 21 | . O . . . . . . . . . . . . . . . O O 22 | 23 | moggy status r11 o 24 | -------------------------------------------------------------------------------- /t-regress/fixed/lost_ladder/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.50 4 | fixed_handicap 4 5 | play B d16 6 | play B q16 7 | play B q4 8 | play B d4 9 | play W r14 10 | play B r15 11 | play W q14 12 | play B o16 13 | play W r10 14 | play B s14 15 | play W s13 16 | play B s16 17 | play W r6 18 | play B r5 19 | play W q6 20 | play B o4 21 | play W m3 22 | play B n3 23 | play W m4 24 | play B m2 25 | play W l2 26 | play B o2 27 | play W m1 28 | play B n2 29 | play W f3 30 | play B e3 31 | play W f4 32 | play B j5 33 | play W d5 34 | play B c5 35 | play W d6 36 | play B c6 37 | play W c3 38 | play B b4 39 | play W e2 40 | play B c4 41 | play W d7 42 | play B b3 43 | play W e4 44 | play B d3 45 | play W j3 46 | play B r13 47 | play W t14 48 | play B s15 49 | play W r12 50 | play B q13 51 | 52 | play w p13 53 | play b q12 54 | play w q11 55 | play b p12 56 | 57 | tunit genmove w !O12 -------------------------------------------------------------------------------- /t-regress/fixed/lost_ladder/game.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Chinese]SZ[19]HA[4]KM[0.50]TM[300]OT[5x30 byo-yomi] 3 | PW[pachipachi]PB[av5111]WR[1d]BR[5k]DT[2016-08-08]PC[The KGS Go Server at http://www.gokgs.com/]C[pachipachi [1d\]: GTP Engine for pachipachi (white): version 20160806 4 | ]RE[B+Resign] 5 | ;B[dd]BL[297.895] 6 | ;B[pd]BL[296.415] 7 | ;B[pp]BL[291.296] 8 | ;B[dp]BL[289.343] 9 | ;W[qf]WL[294.336] 10 | ;B[qe]BL[286.174] 11 | ;W[pf]WL[288.585] 12 | ;B[nd]BL[284.028] 13 | ;W[qj]WL[282.947] 14 | ;B[rf]BL[280.817] 15 | ;W[rg]WL[277.18] 16 | ;B[rd]BL[279.311] 17 | ;W[qn]WL[271.661] 18 | ;B[qo]BL[275.82] 19 | ;W[pn]WL[266.019] 20 | ;B[np]BL[273.422] 21 | ;W[lq]WL[260.352] 22 | ;B[mq]BL[271.366] 23 | ;W[lp]WL[254.768] 24 | ;B[lr]BL[268.341] 25 | ;W[kr]WL[248.973] 26 | ;B[nr]BL[266.306] 27 | ;W[ls]WL[243.421] 28 | ;B[mr]BL[264.633] 29 | ;W[fq]WL[237.823] 30 | ;B[eq]BL[261.29] 31 | ;W[fp]WL[232.175] 32 | ;B[io]BL[252.237] 33 | ;W[do]WL[226.654] 34 | ;B[co]BL[250.154] 35 | ;W[dn]WL[221.031] 36 | ;B[cn]BL[248.644] 37 | ;W[cq]WL[215.612] 38 | ;B[bp]BL[241.27] 39 | ;W[er]WL[210.084] 40 | ;B[cp]BL[234.989] 41 | ;W[dm]WL[204.597] 42 | ;B[bq]BL[232.642] 43 | ;W[ep]WL[199.223] 44 | ;B[dq]BL[229.453] 45 | ;W[iq]WL[193.912] 46 | ;B[qg]BL[222.391] 47 | ;W[sf]WL[188.35] 48 | ;B[re]BL[218.653] 49 | ;W[qh]WL[182.844] 50 | ;B[pg]BL[214.786]) 51 | -------------------------------------------------------------------------------- /t-regress/fixed/wedge_line3/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 7.5 4 | play b p16 5 | play b q16 6 | play b s16 7 | play b r15 8 | play b t15 9 | play b q14 10 | play b s14 11 | play b q13 12 | play b p12 13 | play b p11 14 | play b m10 15 | play b q10 16 | play b j9 17 | play b l9 18 | play b m9 19 | play b r9 20 | play b j8 21 | play b k8 22 | play b j7 23 | play b l7 24 | play b n7 25 | play b q7 26 | play b r7 27 | play b s7 28 | play b t7 29 | play b j6 30 | play b q6 31 | play b e5 32 | play b k5 33 | play b l5 34 | play b o5 35 | play b p5 36 | play b b4 37 | play b f4 38 | play b j4 39 | play b l4 40 | play b m4 41 | play b o4 42 | play b p4 43 | play b q4 44 | play b r4 45 | play b t4 46 | play b c3 47 | play b f3 48 | play b m3 49 | play b n3 50 | play b p3 51 | play b q3 52 | play b r3 53 | play b s3 54 | play b t3 55 | play b b2 56 | play b c2 57 | play b d2 58 | play b f2 59 | play b l2 60 | play b n2 61 | play b m1 62 | play w d17 63 | play w o17 64 | play w q17 65 | play w r17 66 | play w s17 67 | play w r16 68 | play w c15 69 | play w h15 70 | play w r13 71 | play w s13 72 | play w q12 73 | play w l11 74 | play w q11 75 | play w j10 76 | play w k10 77 | play w l10 78 | play w r10 79 | play w h9 80 | play w k9 81 | play w h8 82 | play w h7 83 | play w c6 84 | play w e6 85 | play w h6 86 | play w m6 87 | play w n6 88 | play w o6 89 | play w p6 90 | play w r6 91 | play w s6 92 | play w t6 93 | play w c5 94 | play w d5 95 | play w h5 96 | play w j5 97 | play w n5 98 | play w q5 99 | play w r5 100 | play w t5 101 | play w c4 102 | play w e4 103 | play w g4 104 | play w k4 105 | play w n4 106 | play w s4 107 | play w b3 108 | play w d3 109 | play w g3 110 | play w k3 111 | play w l3 112 | play w o3 113 | play w k2 114 | play w o2 115 | play w p2 116 | play w q2 117 | play w r2 118 | play w k1 119 | 120 | play b o16 121 | tunit genmove w N17 122 | -------------------------------------------------------------------------------- /t-regress/fixed/wedge_line3/foo.sgf: -------------------------------------------------------------------------------- 1 | (;RU[Chinese]SZ[19] 2 | KM[7.5] 3 | ;B[od] 4 | ;B[pd] 5 | ;B[rd] 6 | ;B[qe] 7 | ;B[se] 8 | ;B[pf] 9 | ;B[rf] 10 | ;B[pg] 11 | ;B[oh] 12 | ;B[oi] 13 | ;B[lj] 14 | ;B[pj] 15 | ;B[ik] 16 | ;B[kk] 17 | ;B[lk] 18 | ;B[qk] 19 | ;B[il] 20 | ;B[jl] 21 | ;B[im] 22 | ;B[km] 23 | ;B[mm] 24 | ;B[pm] 25 | ;B[qm] 26 | ;B[rm] 27 | ;B[sm] 28 | ;B[in] 29 | ;B[pn] 30 | ;B[eo] 31 | ;B[jo] 32 | ;B[ko] 33 | ;B[no] 34 | ;B[oo] 35 | ;B[bp] 36 | ;B[fp] 37 | ;B[ip] 38 | ;B[kp] 39 | ;B[lp] 40 | ;B[np] 41 | ;B[op] 42 | ;B[pp] 43 | ;B[qp] 44 | ;B[sp] 45 | ;B[cq] 46 | ;B[fq] 47 | ;B[lq] 48 | ;B[mq] 49 | ;B[oq] 50 | ;B[pq] 51 | ;B[qq] 52 | ;B[rq] 53 | ;B[sq] 54 | ;B[br] 55 | ;B[cr] 56 | ;B[dr] 57 | ;B[fr] 58 | ;B[kr] 59 | ;B[mr] 60 | ;B[ls] 61 | ;W[dc] 62 | ;W[nc] 63 | ;W[pc] 64 | ;W[qc] 65 | ;W[rc] 66 | ;W[qd] 67 | ;W[ce] 68 | ;W[he] 69 | ;W[qg] 70 | ;W[rg] 71 | ;W[ph] 72 | ;W[ki] 73 | ;W[pi] 74 | ;W[ij] 75 | ;W[jj] 76 | ;W[kj] 77 | ;W[qj] 78 | ;W[hk] 79 | ;W[jk] 80 | ;W[hl] 81 | ;W[hm] 82 | ;W[cn] 83 | ;W[en] 84 | ;W[hn] 85 | ;W[ln] 86 | ;W[mn] 87 | ;W[nn] 88 | ;W[on] 89 | ;W[qn] 90 | ;W[rn] 91 | ;W[sn] 92 | ;W[co] 93 | ;W[do] 94 | ;W[ho] 95 | ;W[io] 96 | ;W[mo] 97 | ;W[po] 98 | ;W[qo] 99 | ;W[so] 100 | ;W[cp] 101 | ;W[ep] 102 | ;W[gp] 103 | ;W[jp] 104 | ;W[mp] 105 | ;W[rp] 106 | ;W[bq] 107 | ;W[dq] 108 | ;W[gq] 109 | ;W[jq] 110 | ;W[kq] 111 | ;W[nq] 112 | ;W[jr] 113 | ;W[nr] 114 | ;W[or] 115 | ;W[pr] 116 | ;W[qr] 117 | ;W[js] 118 | ;B[nd] 119 | ) 120 | -------------------------------------------------------------------------------- /t-regress/fixed/wedge_line3/notes: -------------------------------------------------------------------------------- 1 | Move: 116 Komi: 7.5 Handicap: 0 Captures B: 0 W: 0 2 | A B C D E F G H J K L M N O P Q R S T A B C D E F G H J K L M N O P Q R S T 3 | +---------------------------------------+ +---------------------------------------+ 4 | 19 | . . . . . . . . . . . . . . . . . . . | 19 | : : : : : : : : : : : : : : : : : : : | 5 | 18 | . . . . . . . . . . . . . . . . . . . | 18 | : : : : : : : : : : : : : : : : : : : | 6 | 17 | . . . O . . . . . . . . . O . O O O . | 17 | : : : : : : : : : : : : : : : : : : : | 7 | 16 | . . . . . . . . . . . . . X)X X O X . | 16 | : : : : : : : : : : : : : : : : : : : | 8 | 15 | . . O . . . . O . . . . . . . . X . X | 15 | : : : : : : : : : : : : : : : : : : : | 9 | 14 | . . . . . . . . . . . . . . . X . X . | 14 | : : : : : : : : : : : : : : : : : : : | 10 | 13 | . . . . . . . . . . . . . . . X O O . | 13 | : : : : : : : : : : : : : : : : : : : | 11 | 12 | . . . . . . . . . . . . . . X O . . . | 12 | : : : : : : : : : : : : : : : : : : : | 12 | 11 | . . . . . . . . . . O . . . X O . . . | 11 | : : : : : : : : : : : : : : : : : : : | 13 | 10 | . . . . . . . . O O O X . . . X O . . | 10 | : : : : : : : : : : : : : : : : : : : | 14 | 9 | . . . . . . . O X O X X . . . . X . . | 9 | : : : : : : : : : : : : : : : : : : : | 15 | 8 | . . . . . . . O X X . . . . . . . . . | 8 | : : : : : : : : : : : : : : : : : : : | 16 | 7 | . . . . . . . O X . X . X . . X X X X | 7 | : : : : : : : : : : : : : : : : : : : | 17 | 6 | . . O . O . . O X . . O O O O X O O O | 6 | : : : : : : : : : : : : : : : : : : : | 18 | 5 | . . O O X . . O O X X . O X X O O . O | 5 | : : : : : : : : : : : : : : : : : : : | 19 | 4 | . X O . O X O . X O X X O X X X X O X | 4 | : : : : : : : : : : : : : : : : : : : | 20 | 3 | . O X O . X O . . O O X X O X X X X X | 3 | : : : : : : : : : : : : : : : : : : : | 21 | 2 | . X X X . X . . . O X . X O O O O . . | 2 | : : : : : : : : : : : : : : : : : : : | 22 | 1 | . . . . . . . . . O . X . . . . . . . | 1 | : : : : : : : : : : : : : : : : : : : | 23 | +---------------------------------------+ +---------------------------------------+ 24 | 25 | don't hane ... 26 | -------------------------------------------------------------------------------- /t-regress/nodcnn/second_line_cap/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules chinese 2 | boardsize 19 3 | clear_board 4 | komi 6.5 5 | play B q4 6 | play W q16 7 | play B d4 8 | play W f3 9 | play B c6 10 | play W d2 11 | play B c3 12 | play W j3 13 | play B d16 14 | play W f17 15 | play B c13 16 | play W c17 17 | play B c16 18 | play W d17 19 | play B e16 20 | play W b16 21 | play B b15 22 | play W b17 23 | play B e17 24 | play W e18 25 | play B f16 26 | genmove w 27 | -------------------------------------------------------------------------------- /t-regress/nodcnn/second_line_cap/pattern.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules chinese 2 | boardsize 19 3 | clear_board 4 | komi 6.5 5 | play B q4 6 | play W q16 7 | play B d4 8 | play W f3 9 | play B c6 10 | play W d2 11 | play B c3 12 | play W j3 13 | play B d16 14 | play W f17 15 | play B c13 16 | play W c17 17 | play B c16 18 | play W d17 19 | play B e16 20 | play W b16 21 | play B b15 22 | play W b17 23 | play B e17 24 | play W e18 25 | play B f16 26 | play w o3 27 | play b f18 28 | play w g17 29 | genmove b 30 | -------------------------------------------------------------------------------- /t-regress/old/README: -------------------------------------------------------------------------------- 1 | This is Pachi's regression suite. It contains SGF game records that can 2 | be automatically probed with current Pachi version for particular 3 | behavior (usually observed in older Pachi versions). We do not anticipate 4 | that Pachi would pass all of the tests - when it will, it will be probably 5 | pro strength. ;-) The goal is simply to steadily reduce these and verify 6 | that modifications do not reintroduce bad behavior. 7 | 8 | The game SGF records are in the games/ subdirectory, and also cross-linked 9 | in by-*/ subdirectories based on categories. Each SGF record must contain 10 | a GC[] tag ("game comment") describing the test-case in a manner that is 11 | both human-readable and machine-readable. The description lists specific 12 | moves and how they should be tested, one move per line, using this syntax: 13 | 14 | :[,:,...] 15 | 16 | movenumber: Number of the tested move 17 | movepos: A move coordinate (just for consistency) 18 | classification: Comma-separated list of move classifications, 19 | no whitespaces 20 | comment: Ignored by the testsuite. 21 | 22 | These classifications are available for now: 23 | 24 | bad This move should not be chosen as the next move. 25 | bad! This move is so useless that it should not be in the top 26 | considered moves. (This is a bit feeble class.) 27 | must This move is essential and must be made immediately. 28 | alive This group should be considered alive. 29 | dead This group should be considered dead. 30 | 31 | Classifications may be prefixed by various letters: 32 | 33 | + An issue that is already supposed to be fixed. 34 | / An intermittent issue that happens only in case of some 35 | (mis)fortune in the search. 36 | 37 | Classifications may be postfixed by category name in {curly brackets}. 38 | 39 | Example: 40 | 41 | 40 C3:bad non-working invasion 42 | 41 B2:bad{tsumego},+A1:bad{tsumego} makes C3 alive 43 | -------------------------------------------------------------------------------- /t-regress/old/by-falseeye/2011-06-05-Zen19-pachi2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-05-Zen19-pachi2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-falseeye/2011-06-05-tazaki-pachi30s.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-05-tazaki-pachi30s.sgf -------------------------------------------------------------------------------- /t-regress/old/by-falseeye/2011-06-09-botkiller2-pachi30s.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-09-botkiller2-pachi30s.sgf -------------------------------------------------------------------------------- /t-regress/old/by-falseeye/2011-06-10-pachi30s-samba-2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-10-pachi30s-samba-2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-falseeye/2011-06-18-dorabon-pachi2-4.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-18-dorabon-pachi2-4.sgf -------------------------------------------------------------------------------- /t-regress/old/by-falseeye/2011-07-28-pachi2-Novicer.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-07-28-pachi2-Novicer.sgf -------------------------------------------------------------------------------- /t-regress/old/by-falseeye/2011-08-12-xiaosugi-pachi2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-08-12-xiaosugi-pachi2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ko/2011-06-09-jinen-pachi30s-2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-09-jinen-pachi30s-2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-01-11-llopl-pachi2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-01-11-llopl-pachi2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-06-06-tyzef-pachi30s.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-06-tyzef-pachi30s.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-06-13-pachi30s-Jep.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-13-pachi30s-Jep.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-07-28-pachi2-pkunzip-2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-07-28-pachi2-pkunzip-2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-08-08-Dallas-pachi2-2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-08-08-Dallas-pachi2-2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-08-09-pachi2-BlueSpark.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-08-09-pachi2-BlueSpark.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-08-09-somrak-pachi2-2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-08-09-somrak-pachi2-2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-08-24-StoneGrid-pachi2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-08-24-StoneGrid-pachi2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2011-09-04-pachi2-stv.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-09-04-pachi2-stv.sgf -------------------------------------------------------------------------------- /t-regress/old/by-ladder/2012-03-16-IMC-pachi2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2012-03-16-IMC-pachi2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-semeai/2011-01-15-pachi2-rollingon.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-01-15-pachi2-rollingon.sgf -------------------------------------------------------------------------------- /t-regress/old/by-semeai/2011-06-05-Zen19-pachi2.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-05-Zen19-pachi2.sgf -------------------------------------------------------------------------------- /t-regress/old/by-semeai/2011-06-05-tazaki-pachi30s.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-05-tazaki-pachi30s.sgf -------------------------------------------------------------------------------- /t-regress/old/by-semeai/2011-06-18-dorabon-pachi2-4.sgf: -------------------------------------------------------------------------------- 1 | ../games/2011-06-18-dorabon-pachi2-4.sgf -------------------------------------------------------------------------------- /t-regress/old/by-semeai/2012-03-15-pachi2-Leech.sgf: -------------------------------------------------------------------------------- 1 | ../games/2012-03-15-pachi2-Leech.sgf -------------------------------------------------------------------------------- /t-regress/old/games/2011-01-11-llopl-pachi2.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Chinese]SZ[19]KM[7.50]TM[1200]OT[3x10 byo-yomi] 3 | PW[llopl]PB[pachi2]DT[2011-01-11]GC[21 +F12:bad!{ladder} terrible ladder bug]PC[The KGS Go Server at http://www.gokgs.com/]C[pachi2 [-\]: GTP Engine for pachi2 (black): Pachi Distributed Engine version 6.99 (Chihaku-devel): I'm playing the distributed engine. When I'm losing, I will resign, if I think I win, I play until you pass. Anyone can send me 'winrate' in private chat to get my assessment of the position. 4 | ]RE[W+Resign] 5 | ;B[pc]BL[1196.953] 6 | ;W[dp]WL[1195.448] 7 | ;B[nf]BL[1187.946] 8 | ;W[dd]WL[1188.944] 9 | ;B[gc]BL[1161.126] 10 | ;W[cg]WL[1178.729] 11 | ;B[df]BL[1135.039] 12 | ;W[cf]WL[1173.539] 13 | ;B[dg]BL[1109.301] 14 | ;W[de]WL[1156.347] 15 | ;B[ch]BL[1101.869] 16 | ;W[dh]WL[1152.82] 17 | ;B[fg]BL[1087.076] 18 | ;W[eh]WL[1139.049] 19 | ;B[ci]BL[1078.444] 20 | ;W[eg]WL[1133.554] 21 | ;B[ef]BL[1070.848] 22 | ;W[ff]WL[1131.04] 23 | ;B[ee]BL[1063.028] 24 | ;W[gg]WL[1117.854] 25 | ;B[fh]BL[1054.881] 26 | ;W[fi]WL[1114.888] 27 | ;B[gh]BL[1046.912] 28 | ;W[hh]WL[1111.394] 29 | ;B[gi]BL[1038.999] 30 | ;W[gj]WL[1108.06] 31 | ;B[hi]BL[1031.402] 32 | ;W[ii]WL[1105.107] 33 | ;B[hj]BL[1023.405] 34 | ;W[hk]WL[1102.009] 35 | ;B[ij]BL[1015.538] 36 | ;W[jj]WL[1099.39] 37 | ;B[ik]BL[1008.158] 38 | ;W[il]WL[1096.626] 39 | ;B[jk]BL[1000.192] 40 | ;W[kk]WL[1094.338] 41 | ;B[jl]BL[992.241] 42 | ;W[jm]WL[1092.01] 43 | ;B[kl]BL[973.574] 44 | ;W[ll]WL[1090.049] 45 | ;B[km]BL[955.539] 46 | ;W[kn]WL[1088.308] 47 | ;B[lm]BL[936.382] 48 | ;W[mm]WL[1085.42] 49 | ;B[ln]BL[918.77] 50 | ;W[lo]WL[1082.54] 51 | ;B[mn]BL[896.152] 52 | ;W[nn]WL[1079.496] 53 | ;B[mo]BL[870.485] 54 | ;W[mp]WL[1076.543]) 55 | -------------------------------------------------------------------------------- /t-regress/old/games/2011-06-06-tyzef-pachi30s.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Chinese]SZ[19]KM[7.50]TM[1800]OT[5x30 byo-yomi] 3 | PW[tyzef]PB[pachi30s]WR[7k]DT[2011-06-06]GC[17 +D6:bad!{ladder} plays out ladder]PC[The KGS Go Server at http://www.gokgs.com/]C[pachi30s [-\]: GTP Engine for pachi30s (black): Pachi Distributed Engine version 8.99 (Hakugen-devel): I'm playing the distributed engine. When I'm losing, I will resign, if I think I win, I play until you pass. Anyone can send me 'winrate' in private chat to get my assessment of the position. 4 | ]RE[B+Resign] 5 | ;B[qc]BL[1796.606] 6 | ;W[ep]WL[1796.485] 7 | ;B[pq]BL[1718.228] 8 | ;W[po]WL[1763.099] 9 | ;B[mq]BL[1643.515] 10 | ;W[pl]WL[1750.088] 11 | ;B[cp]BL[1562.141] 12 | ;W[do]WL[1521.137] 13 | ;B[cn]BL[1512.02] 14 | ;W[co]WL[1448.438] 15 | ;B[bo]BL[1484.653] 16 | ;W[bp]WL[1403.785] 17 | ;B[bq]BL[1456.25] 18 | ;W[bn]WL[1398.747] 19 | ;B[ap]BL[1427.902] 20 | ;W[cm]WL[1359.821] 21 | ;B[dn]BL[1399.52] 22 | ;W[en]WL[1316.795] 23 | ;B[dm]BL[1371.136] 24 | ;W[dl]WL[1292.431] 25 | ;B[em]BL[1342.671] 26 | ;W[fm]WL[1240.348] 27 | ;B[el]BL[1314.255] 28 | ;W[ek]WL[1237.356] 29 | ;B[fl]BL[1285.74] 30 | ;W[]WL[1237.355] 31 | ;B[fn]BL[1257.253]) 32 | -------------------------------------------------------------------------------- /t-regress/old/test-game.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # test-game: Run testcases within a single game 4 | # 5 | # Usage: test-game.sh FILENAME 6 | # 7 | # Examine a game record and run testcases for all moves described 8 | # in the "game comment". 9 | # 10 | # Pass any extra Pachi parameters in PACHIARGS. E.g. 11 | # PACHIARGS='-t =100000 -d 2 threads=2' testgame.sh ... 12 | 13 | sgf="$1" 14 | 15 | sed -ne '/GC\[[0-9][0-9]* .*\]/{s/.*GC\[\([^]]*\)\].*/\1/p; q;}; /GC\[/,/\]/{ s/.*GC\[//; s/\].*//; /^[0-9][0-9]* /p; }' <"$sgf" | 16 | while read moven cases desc; do 17 | echo "Examining move $moven"; sleep 1 18 | tools/sgf2gtp.pl -g -n $((moven-1)) <"$sgf" | ./pachi -t =20000 $PACHIARGS 19 | echo "Testcases: $cases ($desc)" 20 | echo "Confirm and press enter..."; read xx "; } 9 | log() { tee -a short.log; } 10 | log_full() { cat >> full.log; } 11 | lgrep() { grep --line-buffered "$@"; } 12 | 13 | 14 | pachi_options="--dcnn --patterns -t =5000:10000 --tunit-fatal " 15 | 16 | base_dir=`dirname "$( realpath "$0" )"` 17 | cd "$base_dir" || die "cd $base_dir failed" 18 | 19 | [ $# = 1 ] || usage 20 | 21 | dir="$1" 22 | [ -d "$dir" ] || die "$dir: no such directory" 23 | 24 | echo "see t-regress/full.log for full output" 25 | echo "" 26 | 27 | rm short.log full.log >/dev/null 2>&1 28 | passed=0 29 | total=0 30 | for f in $dir/*/*.gtp; do 31 | if ! grep -q tunit $f; then 32 | echo "$f: unit test missing, skipping" | log 33 | continue 34 | fi 35 | 36 | echo "" | log_full 37 | echo "-------------------------------------------" | log_full 38 | echo "$f" | log_full 39 | echo "" | log_full 40 | 41 | echo -n "$f: " | log 42 | if ../pachi $pachi_options < $f 2>&1 >/dev/null | 43 | lgrep -v "^IN:" | log_full ; then 44 | echo "OK" | log; passed=$[$passed + 1] 45 | else 46 | echo "FAILED" | log 47 | fi 48 | total=$[$total + 1] 49 | 50 | done 51 | 52 | echo "" | log 53 | echo "$passed / $total tests passed" | log 54 | 55 | exit $[$passed != $total] 56 | -------------------------------------------------------------------------------- /t-regress/tofix/3lib_capture/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.50 4 | play B r4 5 | play W d16 6 | play B q17 7 | play W d3 8 | play B p3 9 | play W q15 10 | play B r15 11 | play W r14 12 | play B r16 13 | play W q14 14 | play B o17 15 | play W r10 16 | play B r8 17 | play W k3 18 | play B d10 19 | play W c8 20 | play B c14 21 | play W f17 22 | play B b16 23 | play W c17 24 | play B m3 25 | play W c12 26 | play B d12 27 | play W c11 28 | play B c10 29 | play W d11 30 | play B e11 31 | play W d13 32 | play B e12 33 | play W c13 34 | play B e9 35 | play W f10 36 | play B e10 37 | play W c5 38 | play B b17 39 | play W b18 40 | play B c16 41 | play W d17 42 | play B d15 43 | play W e15 44 | play B h3 45 | play W k5 46 | play B d2 47 | play W e3 48 | play B k2 49 | play W j2 50 | play B j3 51 | play W l2 52 | play B k4 53 | play W l3 54 | play B l4 55 | play W h2 56 | play B m2 57 | play W k1 58 | play B m1 59 | play W j4 60 | play B l1 61 | play W k2 62 | play B h4 63 | tunit genmove W G3 64 | -------------------------------------------------------------------------------- /t-regress/tofix/3lib_capture/game.sgf: -------------------------------------------------------------------------------- 1 | (;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] 2 | RU[Chinese]SZ[19]KM[0.50]TM[300]OT[5x30 byo-yomi] 3 | PW[pachipachi]PB[raro]WR[1d]BR[1k]DT[2017-04-18]PC[The KGS Go Server at http://www.gokgs.com/]C[pachipachi [1d\]: GTP Engine for pachipachi (white): version 20170404 4 | ] 5 | ;B[qp]BL[295.919] 6 | ;W[dd]WL[294.538] 7 | ;B[pc]BL[293.031] 8 | ;W[dq]WL[289.031] 9 | ;B[oq]BL[288.315] 10 | ;W[pe]WL[283.525] 11 | ;B[qe]BL[279.811] 12 | ;W[qf]WL[277.705] 13 | ;B[qd]BL[277.85] 14 | ;W[pf]WL[272.171] 15 | ;B[nc]BL[275.742] 16 | ;W[qj]WL[266.611] 17 | ;B[ql]BL[273.288] 18 | ;W[jq]WL[261.164] 19 | ;B[dj]BL[262.861] 20 | ;W[cl]WL[255.959] 21 | ;B[cf]BL[258.804] 22 | ;W[fc]WL[250.44] 23 | ;B[bd]BL[250.653] 24 | ;W[cc]WL[245.015] 25 | ;B[lq]BL[243.585] 26 | ;W[ch]WL[239.672] 27 | ;B[dh]BL[230.768] 28 | ;W[ci]WL[234.137] 29 | ;B[cj]BL[224.711] 30 | ;W[di]WL[228.399] 31 | ;B[ei]BL[223.235] 32 | ;W[dg]WL[222.969] 33 | ;B[eh]BL[210.906] 34 | ;W[cg]WL[217.409] 35 | ;B[ek]BL[204.686] 36 | ;W[fj]WL[211.447] 37 | ;B[ej]BL[201.906] 38 | ;W[co]WL[197.424] 39 | ;B[bc]BL[197.497] 40 | ;W[bb]WL[192.112] 41 | ;B[cd]BL[195.859] 42 | ;W[dc]WL[185.863] 43 | ;B[de]BL[187.075] 44 | ;W[ee]WL[180.559] 45 | ;B[hq]BL[173.162] 46 | ;W[jo]WL[166.496] 47 | ;B[dr]BL[167.377] 48 | ;W[eq]WL[152.292] 49 | ;B[jr]BL[160.428] 50 | ;W[ir]WL[138.388] 51 | ;B[iq]BL[157.851] 52 | ;W[kr]WL[132.773] 53 | ;B[jp]BL[156.362] 54 | ;W[kq]WL[127.446] 55 | ;B[kp]BL[154.546] 56 | ;W[hr]WL[113.349] 57 | ;B[lr]BL[135.779] 58 | ;W[js]WL[108.105] 59 | ;B[ls]BL[126.313] 60 | ;W[ip]WL[94.347] 61 | ;B[ks]BL[115.465] 62 | ;W[jr]WL[87.764] 63 | ;B[hp]BL[47.349]) 64 | -------------------------------------------------------------------------------- /t-regress/tofix/3lib_capture/notes: -------------------------------------------------------------------------------- 1 | 2 | pachipachi raro 2017-04-18 3 | 4 | Move: 59 Komi: 0.5 Handicap: 0 Captures B: 0 W: 1 5 | A B C D E F G H J K L M N O P Q R S T 6 | +---------------------------------------+ 7 | 19 | . . . . . . . . . . . . . . . . . . . | 8 | 18 | . O . . . . . . . . . . . . . . . . . | 9 | 17 | . X O O . O . . . . . . . X . X . . . | 10 | 16 | . X X O . . . . . . . . . . . . X . . | 11 | 15 | . . . X O . . . . . . . . . . O X . . | 12 | 14 | . . X . . . . . . . . . . . . O O . . | 13 | 13 | . . O O . . . . . . . . . . . . . . . | 14 | 12 | . . O X X . . . . . . . . . . . . . . | 15 | 11 | . . O O X . . . . . . . . . . . . . . | 16 | 10 | . . X X X O . . . . . . . . . . O . . | 17 | 9 | . . . . X . . . . . . . . . . . . . . | 18 | 8 | . . O . . . . . . . . . . . . . X . . | 19 | 7 | . . . . . . . . . . . . . . . . . . . | 20 | 6 | . . . . . . . . . . . . . . . . . . . | 21 | 5 | . . O . . . . . . O . . . . . . . . . | 22 | 4 | . . . . . . . X)O X X . . . . . X . . | 23 | 3 | . . . O O . . X X O O X . . X . . . . | 24 | 2 | . . . X . . . O O O O X . . . . . . . | 25 | 1 | . . . . . . . . . O X X . . . . . . . | 26 | +---------------------------------------+ 27 | 28 | dcnn = [ J5 M4 G3 G2 L5 E2 H5 F2 S4 O3 R6 Q3 D14 E13 R3 Q16 Q4 M17 Q8 R5 ] 29 | [ 89 6 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] 30 | 31 | G3 please, otherwise bottom group gets captured -------------------------------------------------------------------------------- /t-regress/tofix/3lib_capture3/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.50 4 | play B s16 5 | play W d16 6 | play B c4 7 | play W q4 8 | play B p17 9 | play W e4 10 | play B h4 11 | play W d7 12 | play B d4 13 | play W e5 14 | play B e3 15 | play W f3 16 | play B f4 17 | play W e2 18 | play B d3 19 | play W g4 20 | play B f5 21 | play W g5 22 | play B f6 23 | play W g3 24 | play B e6 25 | play W d2 26 | play B c2 27 | play W c10 28 | play B r6 29 | play W o4 30 | play B q10 31 | play W k17 32 | play B c17 33 | play W d17 34 | play B c16 35 | play W c15 36 | play B b15 37 | play W c14 38 | play B b14 39 | play W c13 40 | play B d18 41 | play W e18 42 | play B c18 43 | play W f17 44 | play B m17 45 | play W k15 46 | play B r3 47 | play W r4 48 | play B s4 49 | play W s5 50 | play B s3 51 | play W r5 52 | play B p2 53 | play W o2 54 | play B p3 55 | play W o3 56 | play B s6 57 | play W t6 58 | play B p4 59 | play W p5 60 | play B q6 61 | play W q5 62 | play B q3 63 | play W p6 64 | play B t7 65 | play W t5 66 | play B s8 67 | play W r9 68 | play B r8 69 | play W q9 70 | play B q8 71 | play W p9 72 | play B s9 73 | play W r10 74 | play B p8 75 | play W o8 76 | play B o7 77 | play W p7 78 | play B o9 79 | play W n8 80 | play B o10 81 | play W s10 82 | play B t9 83 | play W p10 84 | play B o11 85 | play W p12 86 | play B o12 87 | play W p13 88 | play B n7 89 | play W m8 90 | play B m7 91 | play W l7 92 | play B l6 93 | play W l8 94 | play B m5 95 | play W n5 96 | play B j6 97 | play W h7 98 | play B h6 99 | play W g6 100 | play B j7 101 | play W j8 102 | play B h8 103 | play W g7 104 | play B k8 105 | play W j9 106 | play B k7 107 | tunit genmove W !K9 108 | -------------------------------------------------------------------------------- /t-regress/tofix/cut_dangerous2/foo.gtp: -------------------------------------------------------------------------------- 1 | kgs-rules japanese 2 | boardsize 19 3 | clear_board 4 | komi 0.5 5 | set_free_handicap d16 q16 d10 q10 d4 q4 6 | play w o17 7 | play b q13 8 | play w f17 9 | play b d13 10 | play w k16 11 | play b q7 12 | play w f3 13 | play b d7 14 | play w j3 15 | play b n3 16 | play w r3 17 | play b r4 18 | play w q3 19 | play b p4 20 | play w p3 21 | play b o4 22 | play w s4 23 | play b s5 24 | play w s3 25 | play b r6 26 | play w r17 27 | play b r16 28 | play w q17 29 | play b p16 30 | play w o16 31 | play b p17 32 | play w p18 33 | play b o18 34 | play w n18 35 | play b o15 36 | play w n15 37 | play b o14 38 | play w n14 39 | play b o13 40 | play w c3 41 | play b c4 42 | play w d3 43 | play b e4 44 | play w e3 45 | play b f4 46 | play w g4 47 | play b g5 48 | play w h4 49 | play b h6 50 | play w c17 51 | play b c16 52 | play w d17 53 | play b e16 54 | play w f16 55 | play b e17 56 | play w e18 57 | play b f18 58 | play w g18 59 | play b f15 60 | play w g15 61 | play b f14 62 | play w g14 63 | play b f13 64 | play w g13 65 | play b f12 66 | play w h11 67 | play b g10 68 | play w h10 69 | play b g9 70 | play w m12 71 | play b o11 72 | play w m10 73 | play b o9 74 | play w b16 75 | play b b15 76 | play w b17 77 | play b c14 78 | play w s17 79 | play b s16 80 | play w t16 81 | play b t15 82 | play w t17 83 | play b s15 84 | play w b4 85 | play b b5 86 | play w b3 87 | play b c6 88 | play w o2 89 | play b n2 90 | play w j8 91 | play b h8 92 | play w j7 93 | play b h7 94 | play w m8 95 | play b n7 96 | play w m7 97 | play b n6 98 | play w l2 99 | play b l3 100 | play w k3 101 | play b l4 102 | play w n8 103 | play b n4 104 | play w o8 105 | play b p8 106 | play w o7 107 | play b o6 108 | play w p7 109 | play b p6 110 | play w p9 111 | play b q8 112 | play w o10 113 | play b p10 114 | play w n9 115 | play b q9 116 | 117 | tunit genmove w Q18 R18 O19 Q19 118 | -------------------------------------------------------------------------------- /t-regress/tofix/cut_dangerous2/foo.sgf: -------------------------------------------------------------------------------- 1 | (;SZ[19] 2 | RU[japanese] 3 | KM[0.5] 4 | HA[6] 5 | ;B[dd] 6 | ;B[pd] 7 | ;B[dj] 8 | ;B[pj] 9 | ;B[dp] 10 | ;B[pp] 11 | ;W[nc] 12 | ;B[pg] 13 | ;W[fc] 14 | ;B[dg] 15 | ;W[jd] 16 | ;B[pm] 17 | ;W[fq] 18 | ;B[dm] 19 | ;W[iq] 20 | ;B[mq] 21 | ;W[qq] 22 | ;B[qp] 23 | ;W[pq] 24 | ;B[op] 25 | ;W[oq] 26 | ;B[np] 27 | ;W[rp] 28 | ;B[ro] 29 | ;W[rq] 30 | ;B[qn] 31 | ;W[qc] 32 | ;B[qd] 33 | ;W[pc] 34 | ;B[od] 35 | ;W[nd] 36 | ;B[oc] 37 | ;W[ob] 38 | ;B[nb] 39 | ;W[mb] 40 | ;B[ne] 41 | ;W[me] 42 | ;B[nf] 43 | ;W[mf] 44 | ;B[ng] 45 | ;W[cq] 46 | ;B[cp] 47 | ;W[dq] 48 | ;B[ep] 49 | ;W[eq] 50 | ;B[fp] 51 | ;W[gp] 52 | ;B[go] 53 | ;W[hp] 54 | ;B[hn] 55 | ;W[cc] 56 | ;B[cd] 57 | ;W[dc] 58 | ;B[ed] 59 | ;W[fd] 60 | ;B[ec] 61 | ;W[eb] 62 | ;B[fb] 63 | ;W[gb] 64 | ;B[fe] 65 | ;W[ge] 66 | ;B[ff] 67 | ;W[gf] 68 | ;B[fg] 69 | ;W[gg] 70 | ;B[fh] 71 | ;W[hi] 72 | ;B[gj] 73 | ;W[hj] 74 | ;B[gk] 75 | ;W[lh] 76 | ;B[ni] 77 | ;W[lj] 78 | ;B[nk] 79 | ;W[bd] 80 | ;B[be] 81 | ;W[bc] 82 | ;B[cf] 83 | ;W[rc] 84 | ;B[rd] 85 | ;W[sd] 86 | ;B[se] 87 | ;W[sc] 88 | ;B[re] 89 | ;W[bp] 90 | ;B[bo] 91 | ;W[bq] 92 | ;B[cn] 93 | ;W[nr] 94 | ;B[mr] 95 | ;W[il] 96 | ;B[hl] 97 | ;W[im] 98 | ;B[hm] 99 | ;W[ll] 100 | ;B[mm] 101 | ;W[lm] 102 | ;B[mn] 103 | ;W[kr] 104 | ;B[kq] 105 | ;W[jq] 106 | ;B[kp] 107 | ;W[ml] 108 | ;B[mp] 109 | ;W[nl] 110 | ;B[ol] 111 | ;W[nm] 112 | ;B[nn] 113 | ;W[om] 114 | ;B[on] 115 | ;W[ok] 116 | ;B[pl] 117 | ;W[nj] 118 | ;B[oj] 119 | ;W[mk] 120 | ;B[pk] 121 | ) 122 | -------------------------------------------------------------------------------- /t-regress/tofix/dcnn_blind_spot/foo.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 0.5 4 | set_free_handicap d16 d4 q16 q4 5 | play W o17 6 | play B l17 7 | play W r14 8 | play B p15 9 | play W r17 10 | play B r16 11 | play W q17 12 | play B s16 13 | play W p16 14 | play B q14 15 | play W o15 16 | play B o14 17 | play W n15 18 | play B j16 19 | play W q13 20 | play B r13 21 | play W r12 22 | play B s13 23 | play W p13 24 | play B p14 25 | play W s12 26 | play B s14 27 | play W r6 28 | play B o3 29 | play W s4 30 | play B r3 31 | play W q8 32 | play B f17 33 | play W c10 34 | play B c12 35 | play W c6 36 | play B c8 37 | play W e6 38 | play B f4 39 | play W d9 40 | play B c5 41 | play W b6 42 | play B c15 43 | play W h3 44 | play B g3 45 | play W h4 46 | play B f6 47 | play W e7 48 | play B b5 49 | play W m3 50 | play B k3 51 | play W k4 52 | play B l3 53 | play W l4 54 | play B m2 55 | play W m4 56 | play B n3 57 | play W e5 58 | play B f5 59 | tunit genmove w E3 60 | -------------------------------------------------------------------------------- /t-unit/README: -------------------------------------------------------------------------------- 1 | This is a simple unit-testing framework where specific Pachi routines 2 | can be checked for proper result on given testcases (board pieces). 3 | Run the unit tests like: 4 | 5 | ./pachi -u t-unit/sar.t 6 | ./pachi -u t-unit/ladder.t 7 | ./pachi -u t-unit/moggy.t 8 | ... 9 | 10 | -------------------------------------------------------------------------------- /t-unit/blank.t: -------------------------------------------------------------------------------- 1 | # auto-run off 2 | 3 | % Moggy raw playout speed benchmark 4 | boardsize 19 5 | . . . . . . . . . . . . . . . . . . . 6 | . . . . . . . . . . . . . . . . . . . 7 | . . . . . . . . . . . . . . . . . . . 8 | . . . X). . . . . . . . . . . . . . . 9 | . . . . . . . . . . . . . . . . . . . 10 | . . . . . . . . . . . . . . . . . . . 11 | . . . . . . . . . . . . . . . . . . . 12 | . . . . . . . . . . . . . . . . . . . 13 | . . . . . . . . . . . . . . . . . . . 14 | . . . . . . . . . . . . . . . . . . . 15 | . . . . . . . . . . . . . . . . . . . 16 | . . . . . . . . . . . . . . . . . . . 17 | . . . . . . . . . . . . . . . . . . . 18 | . . . . . . . . . . . . . . . . . . . 19 | . . . . . . . . . . . . . . . . . . . 20 | . . . . . . . . . . . . . . . . . . . 21 | . . . . . . . . . . . . . . . . . . . 22 | . . . . . . . . . . . . . . . . . . . 23 | . . . . . . . . . . . . . . . . . . . 24 | 25 | moggy status 26 | -------------------------------------------------------------------------------- /t-unit/blank.t.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 7.5 4 | play b d16 5 | tunit moggy status c17 6 | -------------------------------------------------------------------------------- /t-unit/board_undo.t: -------------------------------------------------------------------------------- 1 | # auto-run off 2 | 3 | % Test board undo 4 | boardsize 19 5 | . . . . . . . . . . . . . . . . . . . 6 | . . . . . . . . . . . . . . . . . . . 7 | . . . . . . . . . . . . . . . . . . . 8 | . . . . . . . . . . . . . . . . . . . 9 | . . . . . . . . . . . . . . . . . . . 10 | . . . . . . . . . . . . . . . . . . . 11 | . . . . . . . . . . . . . . . . . . . 12 | . . . . . . . . . . . . . . . . . . . 13 | . . . . . . . . . . . . . . . . . . . 14 | . . . . . . . . . . . . . . . . . . . 15 | . . . . . . . . . . . . . . . . . . . 16 | . . . . . . . . . . . . . . . . . . . 17 | . . . . . . . . . . . . . . . . . . . 18 | . . . . . . . . . . . . . . . . . . . 19 | . . . . . . . . . . . . . . . . . . . 20 | . . . . . . . . . . . . . . . . . . . 21 | . . . . . . . . . . . . . . . . . . . 22 | . . . . . . . . . . . . . . . . . . . 23 | . . . . . . . . . . . . . . . . . . . 24 | 25 | board_undo_stress_test 26 | -------------------------------------------------------------------------------- /t-unit/can_countercap.t: -------------------------------------------------------------------------------- 1 | boardsize 9 2 | . O X . . O X . . 3 | . . . . . O X . . 4 | . O O . . O X . . 5 | X X O O . O X . . 6 | . X X O O X X . . 7 | . . X X O O X O . 8 | . . . . X X O O . 9 | . . . X . X X O . 10 | . . X . O . O . . 11 | 12 | can_countercap f2 0 13 | 14 | boardsize 9 15 | . O X . . O X . . 16 | . . . . . O X . . 17 | . O O . . O X . . 18 | X X O O . O X . . 19 | . X X O O X X . . 20 | . . X X O O X O . 21 | . . . O X X O O . 22 | . . . X . X X O . 23 | . . X . O . O . . 24 | 25 | can_countercap f2 1 26 | 27 | boardsize 9 28 | . O X . . O X . . 29 | . . . . . O X . . 30 | . O O . . O X . . 31 | X X O O . O X . . 32 | . X X O O X X . . 33 | . . X X O O X O . 34 | . . . O X X O O . 35 | . . . X O X X O . 36 | . . X . O . O . . 37 | 38 | can_countercap f2 1 39 | 40 | 41 | % Snapback 42 | boardsize 9 43 | . O X . . O X . . 44 | . . . . . O X . . 45 | . O O . . O X . . 46 | X X O O . O X . . 47 | . X X O O X X . . 48 | . . X X O O X O . 49 | . . . O X X O O . 50 | . . . O O X X O . 51 | . . X . O . O X . 52 | 53 | can_countercap f2 0 54 | 55 | % Snapback 56 | boardsize 9 57 | . O X . . O X . . 58 | . . . . . O X . . 59 | . O O . . O X . . 60 | X X O O . O X . . 61 | . X X O O X X . . 62 | . . X X O O X O . 63 | . . . O O X O O . 64 | . . . O O X X O . 65 | . . X . O . O X . 66 | 67 | can_countercap f2 0 68 | 69 | % Snapback 70 | boardsize 9 71 | . O X . . O X . . 72 | . . . . . O X . . 73 | . O O . . O X . . 74 | X X O O . O X . . 75 | . X X O O X X X X 76 | . . X X O O X O X 77 | . . . O O O O O X 78 | . . . O X X X O X 79 | . . X O X . O X X 80 | 81 | can_countercap f2 0 82 | can_countercap g5 0 83 | 84 | 85 | % Simple snapback 86 | boardsize 9 87 | . O X . . O X . . 88 | . . . . . O X . . 89 | . O O . . O X . . 90 | X X O O . O X . . 91 | . X X O O X X . . 92 | . . X X O X X O . 93 | . . . O X X O O . 94 | . . . O X O X O . 95 | . . X O O . X O . 96 | 97 | can_countercap g1 0 98 | -------------------------------------------------------------------------------- /t-unit/external_engine.gtp: -------------------------------------------------------------------------------- 1 | boardsize 19 2 | clear_board 3 | komi 1.5 4 | fixed_handicap 4 5 | play W r14 6 | play B r15 7 | play W q14 8 | play B o16 9 | play W r10 10 | play B s14 11 | play W s13 12 | play B s16 13 | play W r6 14 | play B r5 15 | play W q6 16 | play B o4 17 | play W m3 18 | play B n3 19 | play W m4 20 | play B m2 21 | 22 | play w j10 23 | play b k10 24 | play w k11 25 | play b j11 26 | showboard 27 | 28 | undo 29 | undo 30 | undo 31 | undo 32 | showboard 33 | 34 | play W l2 35 | play B o2 36 | play W m1 37 | play B n2 38 | play W f3 39 | showboard 40 | 41 | -------------------------------------------------------------------------------- /t-unit/false_eye_seki.t: -------------------------------------------------------------------------------- 1 | % False eye seki 2 | boardsize 7 3 | X . X O . . . 4 | . X X O O . . 5 | X X O . . O O 6 | X O . O O X X 7 | O . O X X X . 8 | . O)O X O O X 9 | . . O X . O . 10 | 11 | false_eye_seki b g3 1 12 | false_eye_seki b b7 0 13 | moggy status f3 X 14 | -------------------------------------------------------------------------------- /t-unit/first_line_blunder.t: -------------------------------------------------------------------------------- 1 | 2 | % First line blunder (silly) 3 | boardsize 7 4 | . . . . . O . 5 | . . O O O . . 6 | . O X . X O . 7 | . O X . X O . 8 | O X X . X X O 9 | X). . . . . X 10 | . . . . . . . 11 | 12 | first_line_blunder w a4 1 13 | first_line_blunder w g4 0 14 | 15 | 16 | % First line blunder (case 1) 17 | boardsize 7 18 | . . O . . . . 19 | . . O . . . . 20 | . . . X . . . 21 | . O O X . . . 22 | O X X X . . . 23 | X). . . . . . 24 | . . . . . . . 25 | 26 | first_line_blunder w a4 1 27 | 28 | 29 | % First line blunder (not case 1) 30 | boardsize 9 31 | . . . . . . . . . 32 | . . . . . . . . . 33 | . . O . . . . . . 34 | . . O . . . O . . 35 | . . . O . . . . . 36 | . . . O . . . . . 37 | . . O X X X O . . 38 | . O O X . X O O . 39 | X)X X X . X X X X 40 | 41 | first_line_blunder w a2 0 # not case 1) 42 | first_line_blunder w j2 1 # case 1) 43 | 44 | 45 | % First line blunder (case 2) 46 | boardsize 7 47 | . . . . X . . 48 | . . . . . . . 49 | . . O O . X . 50 | . . . . O X . 51 | . . . . O O X 52 | . . . . . . O) 53 | . . . . . O . 54 | 55 | first_line_blunder b g4 1 56 | 57 | -------------------------------------------------------------------------------- /t-unit/gtp_check: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # check gtp answers are sane 3 | 4 | use IPC::Open2; 5 | 6 | $| = 1; 7 | 8 | $SIG{CHLD} = handler; 9 | sub handler { exit 1; } 10 | 11 | # Start Pachi instance 12 | my $pachi_cmd = join(" ", @ARGV); 13 | 14 | my $pachi_pid = open2(PACHI_OUT, PACHI_IN, "$pachi_cmd"); 15 | PACHI_IN->autoflush(1); 16 | 17 | my $prev_cmd; 18 | 19 | sub check_reply 20 | { 21 | my $reply = ; 22 | if ($reply eq "\n") { die "malformed answer to '$prev_cmd': extra newline\n"; } 23 | if ($reply =~ m/^[?] /) { die "command failed: '$reply'\n"; } 24 | if ($reply !~ m/^[=?][0-9]* /) { die "malformed answer: '$reply'\n"; } 25 | 26 | my $s = $reply; 27 | for ($reply = ""; ($s ne "\n") && ($s ne "\r\n"); $s = ) { 28 | $reply .= $s; 29 | } 30 | #print "'$reply'"; 31 | } 32 | 33 | sub pachi_command 34 | { 35 | my ($cmd) = @_; 36 | print PACHI_IN "$cmd\n"; # Forward command to pachi 37 | 38 | # lz-analyze is special, doesn't finish until next command comes in... 39 | if ($cmd =~ m/lz-analyze/) { 40 | sleep(1); 41 | print PACHI_IN "name\n"; 42 | check_reply(); 43 | } 44 | 45 | check_reply(); 46 | } 47 | 48 | 49 | # Process gtp commands 50 | foreach my $s () 51 | { 52 | if ($s =~ m/^ *$/) { next; } 53 | if ($s =~ m/^#/) { next; } 54 | chomp($s); 55 | 56 | printf(" %-30s ", $s); 57 | pachi_command("$s"); 58 | $prev_cmd = $s; 59 | print "ok\n"; 60 | } 61 | -------------------------------------------------------------------------------- /t-unit/moggy.ref.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/t-unit/moggy.ref.bz2 -------------------------------------------------------------------------------- /t-unit/moggy.t: -------------------------------------------------------------------------------- 1 | % Moggy testing 2 | 3 | 4 | % Moggy moves: Sample moves in a given situation 5 | boardsize 6 6 | X X O X O O 7 | X . O X . O 8 | X . O X . O 9 | . X X)O O . 10 | . . . . . . 11 | . . . . . . 12 | 13 | moggy moves # Sample white moves after black c3 14 | 15 | 16 | % Moggy status: Check outcome after some moggy games 17 | boardsize 9 18 | O . O . . O . X . 19 | . O . O . O O X . 20 | . O . . O O X X O 21 | . . O)O O X O O O 22 | . X O X X X X X . 23 | . X O O O X X X X 24 | . X O X X X . . X 25 | X X X O . . X X X 26 | X O . . O . . . O 27 | 28 | moggy status h8 ? 29 | moggy status h8 x b5 X a9 O # Check h8, b5 and a9 status 30 | 31 | 32 | % Two-headed dragon, false eyes should be b 33 | boardsize 9 34 | . . . . . . . . . 35 | . O O O O O . . . 36 | . O X X X O O O O 37 | . O X . X X X X O 38 | . O O X O O O X O 39 | . . O X O . O X X 40 | . . O X X O . O X 41 | . . O O X O O O X 42 | . . . O)X X X X . 43 | 44 | moggy status d6 X 45 | 46 | 47 | % Raw playout speed benchmark 48 | boardsize 19 49 | . . . . . . . . . . . . . . . . . . . 50 | . . . . . . . . . . . . . . . . . . . 51 | . . . . . . . . . . . . . . . . . . . 52 | . . . X). . . . . . . . . . . . . . . 53 | . . . . . . . . . . . . . . . . . . . 54 | . . . . . . . . . . . . . . . . . . . 55 | . . . . . . . . . . . . . . . . . . . 56 | . . . . . . . . . . . . . . . . . . . 57 | . . . . . . . . . . . . . . . . . . . 58 | . . . . . . . . . . . . . . . . . . . 59 | . . . . . . . . . . . . . . . . . . . 60 | . . . . . . . . . . . . . . . . . . . 61 | . . . . . . . . . . . . . . . . . . . 62 | . . . . . . . . . . . . . . . . . . . 63 | . . . . . . . . . . . . . . . . . . . 64 | . . . . . . . . . . . . . . . . . . . 65 | . . . . . . . . . . . . . . . . . . . 66 | . . . . . . . . . . . . . . . . . . . 67 | . . . . . . . . . . . . . . . . . . . 68 | 69 | # moggy status 70 | 71 | -------------------------------------------------------------------------------- /t-unit/moggy_regtest.c: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "board.h" 9 | #include "debug.h" 10 | #include "playout.h" 11 | #include "playout/moggy.h" 12 | 13 | static void 14 | play_game(playout_setup_t *setup, 15 | board_t *b, enum stone color, 16 | playout_policy_t *policy) 17 | { 18 | if (policy->setboard) policy->setboard(policy, b); 19 | 20 | int passes = 0; 21 | for (int gamelen = setup->gamelen; gamelen-- > 0 && passes < 2; ) { 22 | coord_t coord = playout_play_move(setup, b, color, policy); 23 | fprintf(stderr, "move %-3i %1.1s %s\n", b->moves, stone2str(color), coord2sstr(coord)); 24 | if (is_pass(coord)) passes++; else passes = 0; 25 | color = stone_other(color); 26 | } 27 | } 28 | 29 | /* Play some predictable moggy games dumping every move. */ 30 | bool 31 | moggy_regression_test(board_t *board, char *arg) 32 | { 33 | int games = 10; 34 | fast_srandom(0x12345); 35 | 36 | if (DEBUGL(2)) board_print(board, stderr); 37 | if (DEBUGL(1)) printf("moggy regression test. Playing %i games\n", games); 38 | 39 | playout_policy_t *policy = playout_moggy_init(NULL, board); 40 | playout_setup_t setup = { .gamelen = MAX_GAMELEN }; 41 | 42 | /* Play some games */ 43 | for (int i = 0; i < games; i++) { 44 | enum stone color = S_BLACK; 45 | board_t b; 46 | board_copy(&b, board); 47 | fprintf(stderr, "game %i:\n", i+1); 48 | play_game(&setup, &b, color, policy); 49 | board_done(&b); 50 | } 51 | 52 | printf("All good.\n\n"); 53 | return true; 54 | } 55 | -------------------------------------------------------------------------------- /t-unit/moggy_semeai.t: -------------------------------------------------------------------------------- 1 | # auto-run off 2 | 3 | % Simple semeai, 2 libs, last move nearby 4 | boardsize 6 5 | X X O X O O 6 | X . O X . O 7 | X . O X . O 8 | . X X)O O . 9 | X . X O . . 10 | . X . . . . 11 | moggy moves 12 | moggy status d6 o 13 | 14 | % Simple semeai, 2 libs 15 | boardsize 6 16 | X X O X O O 17 | X . O X . O 18 | X . O X . O 19 | . X X O O . 20 | . X . X O . 21 | . . X X)O . 22 | 23 | moggy status d6 o 24 | 25 | 26 | % Semeai 2 libs, last move nearby 27 | boardsize 6 28 | . . . . . . 29 | X)O O X X O 30 | X X X O O O 31 | . . X O . . 32 | X X X O O O 33 | . . X O . . 34 | 35 | moggy moves 36 | moggy status d5 o 37 | 38 | 39 | % Semeai 2 libs 40 | boardsize 6 41 | . . . . . . 42 | X O O X X O 43 | X X X O O O 44 | X). X O . . 45 | X X X O O O 46 | . . X O . . 47 | 48 | moggy status d5 o 49 | 50 | 51 | % Simple semeai, 3 libs 52 | boardsize 6 53 | X . O X . O 54 | X . O X . O 55 | X . O X . O 56 | . X X)O O . 57 | X . X O . O 58 | . X . . O . 59 | moggy moves 60 | moggy status d5 o 61 | 62 | 63 | % Semeai 3 libs 64 | boardsize 6 65 | . . . . . . 66 | O O O X X X 67 | X)X X O O O 68 | . . X O . . 69 | X X X O O O 70 | . . X O . . 71 | 72 | moggy moves 73 | moggy status d5 o 74 | 75 | 76 | % Simple semeai, 4 libs 77 | boardsize 7 78 | X . O X . O . 79 | X . O X . O . 80 | X . O X . O . 81 | X . O X . O . 82 | . X X)O O . . 83 | X . X O . O . 84 | . X . . O . . 85 | moggy moves 86 | moggy status d5 o 87 | 88 | 89 | -------------------------------------------------------------------------------- /t-unit/regtest.ref.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/t-unit/regtest.ref.bz2 -------------------------------------------------------------------------------- /t-unit/run_tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run unit tests 3 | 4 | die() { echo "$@"; exit 1; } 5 | 6 | dir=`dirname $0` 7 | cd $dir 8 | 9 | for f in `git ls-files *.t | tac`; do 10 | grep -q 'auto-run off' $f && continue 11 | 12 | cmd="$PACHI --kgs -d2 -u t-unit/$f" # --kgs: needed by pass_is_safe.t 13 | echo ""; echo "*******************************************************************"; 14 | echo "$cmd" 15 | $cmd || die "Failed" 16 | done 17 | 18 | $PACHI -u t-unit/blank.t 19 | -------------------------------------------------------------------------------- /t-unit/runpachi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run Pachi at root of build tree 3 | cd .. 4 | exec ./pachi "$@" 5 | -------------------------------------------------------------------------------- /t-unit/spatial.ref.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pasky/pachi/a38d8740a3f0192fa262cd57123d82f152059a80/t-unit/spatial.ref.bz2 -------------------------------------------------------------------------------- /t-unit/test.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_T_UNIT_TEST_H 2 | #define PACHI_T_UNIT_TEST_H 3 | 4 | /* run single unit test */ 5 | int unit_test_cmd(struct board *b, char *line); 6 | 7 | /* run all unit tests in file */ 8 | int unit_test(char *filename); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /t-unit/test_virtual_loss: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Test uct virtual loss works 3 | # usage: test_virtual_loss 4 | 5 | playouts=2000 6 | 7 | abs() { echo $[ $1 < 0 ? -$1 : $1 ]; } 8 | 9 | get_expanded_nodes() 10 | { 11 | color=$1 12 | echo "genmove $color" | $PACHI -d4 -t =$playouts expand_p=0 virtual_loss=10 2>&1 | 13 | grep "expanded nodes" | cut -d: -f2 14 | } 15 | 16 | [ -n "$1" ] || exit 1 17 | 18 | nodes=`get_expanded_nodes $1` 19 | #echo "expanded nodes: $nodes" 20 | 21 | diff=`abs $[ $playouts - $nodes ]` 22 | pc=$[ $diff * 100 / $playouts ] 23 | #echo "percentage away from $playouts: $pc%" 24 | 25 | # Should get less than 5% difference 26 | exit $[ ($pc >= 5) ] 27 | -------------------------------------------------------------------------------- /t-unit/to_new_format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Usage: to_new_format < sar.t 3 | # convert sar.t from old format to new format (spaces between stones) 4 | 5 | foreach my $str () 6 | { 7 | if ($str =~ m/^[.XO]+$/) 8 | { $str =~ s/([.XO])/$1 /g; 9 | $str =~ s/ $//; 10 | } 11 | print $str; 12 | } 13 | -------------------------------------------------------------------------------- /t-unit/wouldbe_ladder.t: -------------------------------------------------------------------------------- 1 | 2 | % Ladder 3 | boardsize 7 4 | . . . . . . . 5 | . . . . . . . 6 | . . . . . . . 7 | . . O . . . . 8 | . O X X . . . 9 | . . O O . . . 10 | . . . . . . . 11 | 12 | wouldbe_ladder w e3 1 13 | wouldbe_ladder w d4 0 14 | 15 | 16 | % Blocked ladder 17 | boardsize 7 18 | . . . . . . . 19 | . . . . . X . 20 | . . . . . . . 21 | . . O . . . . 22 | . O X X . . . 23 | . . O O . . . 24 | . . . . . . . 25 | 26 | wouldbe_ladder w e3 0 27 | 28 | 29 | % Trivial ladder 30 | boardsize 7 31 | . . . . . . . 32 | . . . . . . . 33 | . . . O . . . 34 | . . O . . . . 35 | . O X X . . . 36 | . . O O . . . 37 | . . . . . . . 38 | 39 | wouldbe_ladder w e3 0 # Ok, wouldbe_ladder() looks for non-trivial ladders only atm ... 40 | 41 | 42 | % Unusual ladder (non adjacent libs) 43 | boardsize 7 44 | . . . . . . . 45 | . . . . . . . 46 | . . . . . . . 47 | . . O O O . . 48 | . O X X X . . 49 | . . O . O O . 50 | . . . . . . . 51 | 52 | wouldbe_ladder w d2 1 53 | 54 | -------------------------------------------------------------------------------- /t-unit/wouldbe_ladder_any.t: -------------------------------------------------------------------------------- 1 | 2 | % Ladder 3 | boardsize 7 4 | . . . . . . . 5 | . . . . . . . 6 | . . . . . . . 7 | . . O . . . . 8 | . O X X . . . 9 | . . O O . . . 10 | . . . . . . . 11 | 12 | wouldbe_ladder_any w e3 1 13 | wouldbe_ladder_any w d4 0 14 | 15 | 16 | % Blocked ladder 17 | boardsize 7 18 | . . . . . . . 19 | . . . . . X . 20 | . . . . . . . 21 | . . O . . . . 22 | . O X X . . . 23 | . . O O . . . 24 | . . . . . . . 25 | 26 | wouldbe_ladder_any w e3 0 27 | 28 | 29 | % Trivial ladder 30 | boardsize 7 31 | . . . . . . . 32 | . . . . . . . 33 | . . . O . . . 34 | . . O . . . . 35 | . O X X . . . 36 | . . O O . . . 37 | . . . . . . . 38 | 39 | wouldbe_ladder_any w e3 1 # unlike wouldbe_ladder() ... 40 | 41 | 42 | % Unusual ladder (non adjacent libs) 43 | boardsize 7 44 | . . . . . . . 45 | . . . . . . . 46 | . . . . . . . 47 | . . O O O . . 48 | . O X X X . . 49 | . . O . O O . 50 | . . . . . . . 51 | 52 | wouldbe_ladder_any w d2 1 53 | 54 | % Snapback 55 | boardsize 7 56 | . . . . . . . 57 | . . . . . . . 58 | . . X O . . . 59 | . X . . O . . 60 | . O X X X O . 61 | . O O O O O . 62 | . . . . . . . 63 | 64 | wouldbe_ladder_any w c4 1 65 | -------------------------------------------------------------------------------- /tactics/2lib.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_TACTICS_2LIB_H 2 | #define PACHI_TACTICS_2LIB_H 3 | 4 | /* Two-liberty tactical checks (i.e. dealing with two-step capturing races, 5 | * preventing atari). */ 6 | 7 | #include "board.h" 8 | #include "debug.h" 9 | 10 | void can_atari_group(board_t *b, group_t group, enum stone owner, enum stone to_play, move_queue_t *q, int tag, bool use_def_no_hopeless); 11 | void group_2lib_check(board_t *b, group_t group, enum stone to_play, move_queue_t *q, int tag, bool use_miaisafe, bool use_def_no_hopeless); 12 | 13 | bool can_capture_2lib_group(board_t *b, group_t g, move_queue_t *q, int tag); 14 | void group_2lib_capture_check(board_t *b, group_t group, enum stone to_play, move_queue_t *q, int tag, bool use_miaisafe, bool use_def_no_hopeless); 15 | 16 | /* Returns 0 or ID of neighboring group with 2 libs. */ 17 | static group_t board_get_2lib_neighbor(board_t *b, coord_t c, enum stone color); 18 | 19 | /* Get all neighboring groups with 2 libs. Returns number of groups found. */ 20 | static void board_get_2lib_neighbors(board_t *b, coord_t c, enum stone color, move_queue_t *q); 21 | 22 | 23 | static inline group_t 24 | board_get_2lib_neighbor(board_t *b, coord_t c, enum stone color) 25 | { 26 | foreach_neighbor(b, c, { 27 | group_t g = group_at(b, c); 28 | if (board_at(b, c) == color && board_group_info(b, g).libs == 2) 29 | return g; 30 | }); 31 | return 0; 32 | } 33 | 34 | static inline void 35 | board_get_2lib_neighbors(board_t *b, coord_t c, enum stone color, move_queue_t *q) 36 | { 37 | q->moves = 0; 38 | foreach_neighbor(b, c, { 39 | group_t g = group_at(b, c); 40 | if (board_at(b, c) == color && board_group_info(b, g).libs == 2) 41 | mq_add(q, g, 0); 42 | }); 43 | } 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /tactics/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | OBJS=dragon.o seki.o 1lib.o 2lib.o nlib.o ladder.o nakade.o selfatari.o util.o 3 | 4 | all: lib.a 5 | lib.a: $(OBJS) 6 | 7 | 8 | -include ../Makefile.lib 9 | -------------------------------------------------------------------------------- /tactics/nakade.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_TACTICS_NAKADE_H 2 | #define PACHI_TACTICS_NAKADE_H 3 | 4 | /* Piercing eyes. */ 5 | 6 | #include "board.h" 7 | #include "debug.h" 8 | 9 | /* Find an eye-piercing point within the @around area of empty board 10 | * internal to group of color @color. 11 | * Returns pass if the area is not a nakade shape or not internal. */ 12 | coord_t nakade_point(board_t *b, coord_t around, enum stone color); 13 | 14 | /* big eyespace can be reduced to one eye */ 15 | bool nakade_dead_shape(board_t *b, coord_t around, enum stone color); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /tactics/nlib.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_TACTICS_NLIB_H 2 | #define PACHI_TACTICS_NLIB_H 3 | 4 | /* N-liberty semeai defense tactical checks. */ 5 | 6 | #include "board.h" 7 | #include "debug.h" 8 | 9 | void group_nlib_defense_check(board_t *b, group_t group, enum stone to_play, move_queue_t *q, int tag); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /tactics/seki.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_TACTICS_SEKI_H 2 | #define PACHI_TACTICS_SEKI_H 3 | 4 | #define MOGGY_MIDDLEGAME (board_rsize2(b) * 10 / 25) /* 19x19: 144 */ 5 | #define MOGGY_ENDGAME (board_rsize2(b) * 100 / 164) /* 19x19: 220 */ 6 | 7 | #define check_special_sekis(b, m) \ 8 | (b->moves > MOGGY_MIDDLEGAME && !immediate_liberty_count(b, m->coord)) 9 | 10 | #define check_endgame_sekis(b, m, random_move) \ 11 | (b->moves > MOGGY_ENDGAME && (random_move)) 12 | 13 | bool breaking_local_seki(board_t *b, selfatari_state_t *s, group_t c); 14 | bool breaking_false_eye_seki(board_t *b, coord_t coord, enum stone color); 15 | bool breaking_3_stone_seki(board_t *b, coord_t coord, enum stone color); 16 | 17 | #endif /* PACHI_TACTICS_SEKI_H */ 18 | -------------------------------------------------------------------------------- /tools/autobook/README: -------------------------------------------------------------------------------- 1 | This is a shell-based UCT implementation. ;-) 2 | 3 | From another perspective, this is a tool for automated opening book 4 | construction. The book is based on UCT tree with large exploration 5 | coefficient and fed with results from games against a compenent 6 | opponent. 7 | 8 | The UCT tree is stored in a directory tree, directories are nodes, 9 | UCT statistics are stored in the 'stats' file of each directory 10 | (first line is # of wins, second is # of playouts). Start the book 11 | building by running the 12 | 13 | autobook.sh PACHI_CMD OPPONENT_CMD BOOKDIR 14 | 15 | script, specifying complete Pachi and opponent's invocation details 16 | in the two parameters. If BOOKDIR exists, autobook.sh will continue 17 | an existing opening book build; multiple autobook.sh scripts may 18 | be running too. Just break it (Ctrl-C) when you want to stop. 19 | 20 | These helper scripts are used by autobook.sh: 21 | 22 | walk.sh A single iteration of the algorithm 23 | eval.sh Choose next move to choose in the current directory (node) 24 | expand.sh Create subdirectories (followup nodes) in the cwd 25 | 26 | The built autobook can be converted to an opening book in the fbook 27 | format (on the most-simulated basis) using: 28 | 29 | autobook2fbook.sh BOOKDIR 30 | -------------------------------------------------------------------------------- /tools/autobook/autobook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 3 ]; then 4 | echo "Usage: $0 PLAYER1 PLAYER2 BOOKDIR" >&2 5 | exit 1 6 | fi 7 | 8 | export CMDDIR=$(pwd) 9 | export SEQDIR=$(mktemp -d) 10 | 11 | if [ ! -d "$3" ]; then 12 | mkdir "$3" 13 | { echo 12; echo 24; } >"$3"/stats 14 | fi 15 | 16 | while true; do 17 | (cd "$3"; "$CMDDIR"/walk.sh "$1" "$2") 18 | sleep 5 19 | done 20 | -------------------------------------------------------------------------------- /tools/autobook/autobook2fbook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Config: 4 | # Minimal number of simulations for the result to be considered trustworthy 5 | min_sims=50 6 | 7 | if [ $# -ne 1 ]; then 8 | echo "Usage: $0 BOOKDIR" >&2 9 | exit 1 10 | fi 11 | 12 | export CMDDIR=$(pwd) 13 | 14 | scan() { 15 | seq="$1" 16 | for i in */; do echo $(sed -ne 2p $i/stats) $i; done | sort -rn | 17 | { first=1 18 | while read sims move; do 19 | move="${move%/}" 20 | if [ "$sims" -lt "$min_sims" ]; then 21 | break; 22 | fi 23 | [ -z "$first" ] || echo "$seq | $move" 24 | first= 25 | (cd "$move"; scan "$seq $move") 26 | done 27 | } 28 | } 29 | 30 | cd "$1" 31 | scan "" 32 | -------------------------------------------------------------------------------- /tools/autobook/eval.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Choose next move to choose in the current directory (node) 4 | 5 | # Config: 6 | # Exploration coefficient 7 | explore_p=0.8 8 | 9 | best_move= 10 | best_val=-9999 11 | 12 | { read mwins; read msims; } "$move"/stats 25 | done 26 | -------------------------------------------------------------------------------- /tools/board_print_to_tunit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Convert ascii board diagrams from board_print() to t-unit board format. 3 | # (remove borders and just keep the stones basically) 4 | # Usage: ./board_print_to_tunit > foo.t 5 | # copy paste the diagram with header, ^D 6 | 7 | use utf8; 8 | binmode STDIN, ":utf8"; 9 | binmode STDOUT, ":utf8"; 10 | 11 | my $size = 0, $komi = 7.5, $handicap = 0; 12 | foreach my $s () 13 | { 14 | # Get komi and handicap from board header, if present 15 | if ($s =~ m/^Move: *[0-9]+ *Komi: ([0-9.-]+) *Handicap: ([0-9]+)/) 16 | { $komi = $1; $handicap = $2; next; } 17 | 18 | $s =~ s/·/./g; # color boards 19 | $s =~ s/\*/./g; # target move 20 | if ($s =~ m/^ *([0-9]+) [ |]+(([.OX][ )])+)[ |]+/) 21 | { 22 | $s = $2; 23 | if ($size == 0) 24 | { 25 | $size = split("", $s) / 2; 26 | print "boardsize $size\n"; 27 | if ($komi != 7.5) { print "komi $komi\n"; } 28 | if ($handicap != 0) { print "handicap $handicap\n"; } 29 | } 30 | $s =~ s/ *$//; 31 | print "$s\n"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tools/gentbook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | size="$1" # board size 3 | opts="$2" # UCT engine options; must NOT specify different policy 4 | popts="$3" # UCT policy options 5 | [ -n "$size" ] || size=9 6 | [ -z "$opts" ] || opts=",$opts" 7 | [ -z "$popts" ] || popts=":$popts" 8 | 9 | if [ "$size" -le 13 ]; then 10 | games=400000 11 | else 12 | games=200000 13 | fi 14 | 15 | rm ucttbook-$size-7.5.pachitree 16 | n=0 17 | gentbook1() 18 | { 19 | echo "[#$n:$1]" 20 | n=$((n+1)) 21 | echo -e 'boardsize '$size'\nclear_board\nkomi 7.5\npachi-gentbook b' | 22 | ./pachi -t =$games "policy=ucb1amaf:explore_p=$1$popts$opts" 23 | } 24 | gentbook1 0.0 25 | gentbook1 0.1 26 | gentbook1 0.2 27 | gentbook1 2.0 28 | gentbook1 0.2 29 | gentbook1 2.0 30 | gentbook1 0.1 31 | gentbook1 0.0 32 | gentbook1 0.0 33 | gentbook1 0.0 34 | -------------------------------------------------------------------------------- /tools/gtp2board_print: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # process gtp stream and print ascii board. 3 | # usage: gtp2board_print < file.gtp 4 | 5 | dir=`dirname "$0"`/.. 6 | cd $dir 7 | 8 | # we don't need any engine really, using replay because it starts up fast. 9 | ( cat; echo "showboard" ) | ./pachi -e replay --nojoseki 2>/dev/null | 10 | tail -24 | grep -A 24 Move | sed -e 's/^= //' 11 | -------------------------------------------------------------------------------- /tools/kgslog2gtp.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # usage: kgslog2gtp.pl < kgs.log > games.gtp 3 | # Convert kgsGtp log file to GTP command stream 4 | # 5 | # The command stream contains extra game info as echo commands: 6 | # echo GAME_START_TIMESTAMP 7 | # echo starting game as COLOR against OPPONENT 8 | # echo final result SCORE 9 | 10 | foreach () { 11 | # timestamps 12 | # Jul 8 07:42:12 (short timestamp format) 13 | if (s/^(... .. ..:..:..) //) { $timestamp = $1; } 14 | # Jul 08, 2020 10:37:12 AM com.gokgs.client.gtp.GtpClient main (standard) 15 | if (m/^(.*) com.gokgs.client/) { $timestamp = $1; } 16 | 17 | # game start 18 | # FINE: Starting game as white against Mateman 19 | elsif (m/^FINE:.*as (\S+) against (\w+)/) { 20 | $color = substr($1, 0, 1); 21 | if ($timestamp ne "") { print "echo $timestamp\n"; } 22 | print "echo starting game as $1 against $2\n"; 23 | } 24 | 25 | # gtp commands sent 26 | # FINEST: Command sent to engine: kgs-rules japanese 27 | # FINEST: Command queued for sending to engine: boardsize 19 28 | # FINEST: Queued command sent to engine: boardsize 19 29 | elsif (m/command sent to engine: (.*)$/i && 30 | not m/(genmove|time|name|version|final_status)/) { print "$1\n"; } 31 | 32 | # genmove answers 33 | # FINEST: Got successful response to command "genmove b": = D16 34 | # FINEST: Got successful response to command "kgs-genmove_cleanup b": = D16 35 | elsif (m/Got successful response to command ".*genmove.*": = (.*)$/) { 36 | printf("play $color %s\n", lc($1)); 37 | } 38 | 39 | # game over 40 | # FINE: Game is over and scored (final result = B+13.5) 41 | elsif (m/Game is over and scored \(final result = (.*)\)/) { print "echo final result: $1\n"; } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /tools/moggy_games: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Moggy text-mode screensaver =) 3 | # Adjust speed by giving it an extra runs=n argument. 4 | 5 | cd `dirname $0` 6 | while true ; do 7 | echo boardsize 9 ; echo clear_board 8 | for f in `seq 1 70` ; do 9 | echo genmove b ; echo genmove w; 10 | done 11 | done | 12 | (cd ..; ./pachi -e replay "$@") 13 | 14 | -------------------------------------------------------------------------------- /tools/sgf-analyse.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Simple script using Pachi for game analysis of SGF. 3 | # Pachi will analyse each move in the SGF and suggest the winrate 4 | # for either player and winrate it estimated for in-game followup. 5 | # 6 | # Usage: tools/sgf-analyse.pl COLOR SGF PACHIARGS... 7 | # 8 | # Note that this script assumes dynkomi=none and does not show 9 | # dynamic komi information. (Would be trivial to add but it's tricky 10 | # to interpret the data.) 11 | # 12 | # This script is dirty and insecure for untrusted input! 13 | # 14 | # Example: tools/sgf-analyse.pl W progame.sgf -t =2000 -d 0 dynkomi=none 15 | # ...to get 2000 simulations per move, and winrates from white perspective. 16 | # 17 | # To plot the output in gnuplot: 18 | # set yr [0:1] 19 | # set ytics 0,0.25,1 20 | # plot "datafile.csv" using 1:5 with lines 21 | 22 | use warnings; 23 | use strict; 24 | 25 | my $mcolor = shift @ARGV; 26 | my $sgf = shift @ARGV; 27 | 28 | sub one { 29 | my ($move) = @_; 30 | 31 | # Move of the other color - supposedly. 32 | return if ($move % 2 == ($mcolor eq 'B' ? 0 : 1)); 33 | 34 | # Get pachi output from GTP stream that contains the SGF up to 35 | # given move, with information about the originally made move 36 | # included. 37 | my $line = $move + 3; # board_size, clearboard, komi 38 | my $rest = $line + 1; 39 | open my $g, "tools/sgf2gtp.pl < \"$sgf\" | sed -e '$line s/play \\(.*\\) \\(.*\\)/1 echo \\1 \\2\\n2 genmove \\1\\n3 pachi-result/' -e '$rest,\$ d' | ./pachi @ARGV |" or die $!; 40 | 41 | # Parse the GTP output. 42 | my ($color, $realmove, $genmove, $winrate) = @_; 43 | while (<$g>) { 44 | chomp; 45 | if (/^=1 (.*) (.*)/) { 46 | $color = $1; $realmove = uc $2; 47 | } elsif (/^=2 (.*)/) { 48 | $genmove = $1; 49 | } elsif (/^=3 (.*) (.*) (.*) (.*)/) { 50 | $winrate = $mcolor eq $color ? $3 : 1.0 - $3; 51 | } 52 | } 53 | 54 | # Pass value is not interesting since Pachi might want 55 | # to clarify some groups yet. 56 | return if $realmove eq 'PASS'; 57 | 58 | # Generate summary line. 59 | print join(', ', $move, $color, $realmove, $genmove, $winrate) . "\n"; 60 | } 61 | 62 | print "# $sgf @ARGV\n"; 63 | 64 | my $moves = `tools/sgf2gtp.pl < \"$sgf\" | wc -l` - 3; 65 | one($_) for (1 .. $moves); 66 | -------------------------------------------------------------------------------- /tools/sgf-ratemove.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Simple script using Pachi for rating all moves in a given situation. 3 | # Pachi will analyse each followup move and suggest a winrate for it; 4 | # higher is better. 5 | # 6 | # Usage: tools/sgf-ratemove.sh SGF MOVENUM PACHIARGS... 7 | # 8 | # Note that this script assumes dynkomi=none and does not show 9 | # dynamic komi information. (Would be trivial to add but it's tricky 10 | # to interpret the data.) 11 | # 12 | # This script is dirty and insecure for untrusted input! 13 | # 14 | # Example: tools/sgf-ratemove.sh progame.sgf 120 -t =500 -d 0 15 | # ...to get 500 simulations per each possible move in programe.sgf 16 | # at move 120. 17 | # 18 | # If you want to know more details on what is Pachi thinking about the 19 | # various moves, remove the `-d 0` part. To improve the accuracy of values 20 | # (at the expense of run time), raise the value of 500 (try 2000 or 10000; 21 | # 100000 will usually already take couple of hours). The values will be 22 | # most useful in the middle game; in fuseki and most yose situations, 23 | # expect a lot of noise. 24 | 25 | sgf=$1; shift 26 | movenum=$1; shift 27 | tools/sgf2gtp.pl -g -n $movenum <"$sgf" | 28 | sed -e 's/genmove/0 pachi-evaluate/' | 29 | ./pachi "$@" | 30 | sed -ne '/^=0/,${s/^=0 //;p}' | 31 | sort -r -n -t ' ' -k 2 32 | -------------------------------------------------------------------------------- /tools/sgflib/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /tools/sgflib/__init__.py: -------------------------------------------------------------------------------- 1 | from sgflib import * 2 | -------------------------------------------------------------------------------- /uct/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I.. 2 | SUBDIRS= 3 | 4 | OBJS := dynkomi.o tree.o uct.o prior.o search.o walk.o 5 | 6 | ifeq ($(PLUGINS), 1) 7 | SUBDIRS += plugins 8 | OBJS += plugins.o 9 | endif 10 | 11 | ifeq ($(DISTRIBUTED), 1) 12 | OBJS += slave.o 13 | endif 14 | 15 | all: lib.a 16 | +@make all-recursive 17 | 18 | lib.a: $(OBJS) 19 | 20 | clean:: clean-recursive 21 | 22 | 23 | -include ../Makefile.lib 24 | -------------------------------------------------------------------------------- /uct/plugins.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_UCT_PLUGINS_H 2 | #define PACHI_UCT_PLUGINS_H 3 | 4 | 5 | /* The pluginset structure of current UCT context. */ 6 | typedef struct uct_pluginset uct_pluginset_t; 7 | uct_pluginset_t *pluginset_init(board_t *b); 8 | void pluginset_done(uct_pluginset_t *ps); 9 | 10 | /* Load a new plugin with DLL at path, passed arguments in args. */ 11 | void plugin_load(uct_pluginset_t *ps, char *path, char *args); 12 | 13 | /* Query plugins for priors of a node's leaves. */ 14 | void plugin_prior(uct_pluginset_t *ps, tree_node_t *node, prior_map_t *map, int eqex); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /uct/plugins/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES = -I../.. 2 | CFLAGS += -fPIC 3 | LDFLAGS = -shared 4 | LIBS = 5 | 6 | OBJS = example.o wolf.o 7 | 8 | PLUGINS = $(OBJS:%.o=%.so) 9 | 10 | all: $(PLUGINS) 11 | 12 | example.so: example.o 13 | $(call cmd,link) 14 | 15 | wolf.so: wolf.o 16 | $(call cmd,link) 17 | 18 | clean:: 19 | -@rm $(PLUGINS) 2>/dev/null 20 | 21 | -include ../../Makefile.lib 22 | -------------------------------------------------------------------------------- /uct/policy.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_UCT_POLICY_H 2 | #define PACHI_UCT_POLICY_H 3 | 4 | 5 | typedef tree_node_t* (*uctp_choose)(uct_policy_t *p, tree_node_t *node, board_t *b, enum stone color, coord_t exclude); 6 | typedef floating_t (*uctp_evaluate)(uct_policy_t *p, tree_t *tree, tree_node_t *node, int parity); 7 | typedef tree_node_t* (*uctp_descend)(uct_policy_t *p, tree_t *tree, tree_node_t *node, int parity, bool allow_pass); 8 | typedef tree_node_t* (*uctp_winner)(uct_policy_t *p, tree_t *tree, tree_node_t *node); 9 | typedef void (*uctp_prior)(uct_policy_t *p, tree_t *tree, tree_node_t *node, board_t *b, enum stone color, int parity); 10 | typedef void (*uctp_update)(uct_policy_t *p, tree_t *tree, tree_node_t *node, enum stone node_color, enum stone player_color, playout_amafmap_t *amaf, board_t *final_board, floating_t result); 11 | typedef void (*uctp_done)(uct_policy_t *p); 12 | 13 | typedef struct uct_policy { 14 | uct_t *uct; 15 | uctp_choose choose; 16 | uctp_winner winner; 17 | uctp_evaluate evaluate; 18 | uctp_descend descend; 19 | uctp_update update; 20 | uctp_prior prior; 21 | uctp_done done; 22 | bool wants_amaf; 23 | void *data; 24 | } uct_policy_t; 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /uct/policy/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES=-I../.. 2 | OBJS=generic.o ucb1.o ucb1amaf.o 3 | 4 | all: lib.a 5 | lib.a: $(OBJS) 6 | 7 | 8 | -include ../../Makefile.lib 9 | -------------------------------------------------------------------------------- /uct/prior.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_UCT_PRIOR_H 2 | #define PACHI_UCT_PRIOR_H 3 | 4 | #include "move.h" 5 | #include "stats.h" 6 | 7 | typedef struct tree_node tree_node_t; 8 | typedef struct uct uct_t; 9 | 10 | /* Applying heuristic values to the tree nodes, skewing the reading in 11 | * most interesting directions. */ 12 | 13 | typedef struct uct_prior { 14 | /* Equivalent experience for prior knowledge. MoGo paper recommends 15 | * 50 playouts per source; in practice, esp. with RAVE, about 6 16 | * playouts per source seems best. */ 17 | int eqex; 18 | int even_eqex, plugin_eqex; 19 | int joseki_eqex, pattern_eqex; 20 | int dcnn_eqex_high, dcnn_eqex_low; 21 | bool prune_ladders; 22 | bool boost_pass; 23 | } uct_prior_t; 24 | 25 | typedef struct prior_map { 26 | board_t *b; 27 | enum stone to_play; 28 | int parity; 29 | /* [board_size2(b)] array, move_stats are the prior 30 | * values to be assigned to individual moves; 31 | * move_stats.value is not updated. */ 32 | move_stats_t *prior; 33 | /* [board_size2(b)] array, whether to compute 34 | * prior for the given value. */ 35 | move_queue_t *consider; 36 | } prior_map_t; 37 | 38 | /* @value is the value, @playouts is its weight. */ 39 | static void add_prior_value(prior_map_t *map, coord_t c, floating_t value, int playouts); 40 | 41 | void uct_prior(uct_t *u, tree_node_t *node, prior_map_t *map); 42 | 43 | uct_prior_t *uct_prior_init(char *arg, board_t *b, uct_t *u); 44 | void uct_prior_done(uct_prior_t *p); 45 | 46 | 47 | static inline void 48 | add_prior_value(prior_map_t *map, coord_t c, floating_t value, int playouts) 49 | { 50 | floating_t v = map->parity > 0 ? value : 1 - value; 51 | /* We don't need atomicity: */ 52 | move_stats_t s = move_stats(v, playouts); 53 | stats_merge(&map->prior[c], &s); 54 | } 55 | 56 | /* Display node's priors best moves */ 57 | void print_node_prior_best_moves(board_t *b, tree_node_t *parent); 58 | void get_node_prior_best_moves(tree_node_t *parent, coord_t *best_c, float *best_r, int nbest); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /uct/slave.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_UCT_SLAVE_H 2 | #define PACHI_UCT_SLAVE_H 3 | 4 | #include "move.h" 5 | #include "distributed/distributed.h" 6 | 7 | 8 | void uct_slave_init(uct_t *u, board_t *b); 9 | enum parse_code uct_notify(engine_t *e, board_t *b, int id, char *cmd, char *args, gtp_t *gtp); 10 | char *uct_genmoves(engine_t *e, board_t *b, time_info_t *ti, enum stone color, 11 | char *args, bool pass_all_alive, void **stats_buf, int *stats_size); 12 | struct tree_hash *uct_htable_alloc(int hbits); 13 | void uct_htable_reset(tree_t *t); 14 | 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /uct/uct.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_UCT_UCT_H 2 | #define PACHI_UCT_UCT_H 3 | 4 | #include "engine.h" 5 | 6 | void uct_engine_init(engine_t *e, board_t *b); 7 | 8 | bool uct_gentbook(engine_t *e, board_t *b, time_info_t *ti, enum stone color); 9 | void uct_dumptbook(engine_t *e, board_t *b, enum stone color); 10 | bool uct_is_slave(engine_t *e); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /uct/walk.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_UCT_WALK_H 2 | #define PACHI_UCT_WALK_H 3 | 4 | void uct_progress_status(uct_t *u, tree_t *t, board_t *b, enum stone color, int playouts, coord_t *final); 5 | 6 | int uct_playout(uct_t *u, board_t *b, enum stone player_color, tree_t *t); 7 | int uct_playouts(uct_t *u, board_t *b, enum stone color, tree_t *t, time_info_t *ti); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- 1 | #ifndef PACHI_VERSION_H 2 | #define PACHI_VERSION_H 3 | 4 | #include "build.h" 5 | 6 | #define PACHI_VERNUM 12.86 7 | #define PACHI_VERNUMS "12.86" 8 | 9 | /* 00. Wang Zhi 10 | * 01. Sansa Meijin 1612-1623 11 | * 02. Sanetsu 8-Dan 1630-1658 12 | * 03. Doetsu 7-Dan 1658-1677 13 | * 04. Dosaku Meijin 1677-1702 14 | * (h) Doteki 7-Dan (1684-1690) 15 | * (h) Sakugen 7-Dan (1692-1699) 16 | * 05. Dochi Meijin 1702-1727 17 | * 06. Chihaku 6-Dan 1727-1733 18 | * 07. Shuhaku 6-Dan 1733-1741 19 | * 08. Hakugen 6-Dan 1741-1754 20 | * 09. Satsugen Meijin 1754-1788 21 | * 10. Retsugen 8-Dan 1788-1808 22 | * 11. Genjo 8-Dan 1808-1827 23 | * 12. Jowa Meijin 1827-1839 24 | * 13. Josaku 7-Dan 1839-1847 25 | * 14. Shuwa 8-Dan 1847-1873 26 | * (h) Shusaku 7-Dan (1848-1862) 27 | * 15. Shuetsu 6-Dan 1873-1879 28 | * 16. Shugen 4-Dan 1879-1884 29 | * 17. Shuei 7-Dan 1884-1886 30 | * 18. Shuho 8-Dan 1886 31 | * 19. Shuei Meijin 1887-1907 32 | * 20. Shugen 6-Dan 1907-1908 33 | * 21. Shusai Meijin 1908-1940 */ 34 | #define PACHI_VERNAME "Jowa" 35 | 36 | #define PACHI_VERSION PACHI_VERNUMS 37 | #define PACHI_VERSION_FULL PACHI_VERNUMS " (" PACHI_VERNAME ")" 38 | #define PACHI_VERGIT PACHI_GIT_HASH " (" PACHI_GIT_BRANCH ")" 39 | 40 | #ifdef DCNN 41 | #define PACHI_VERBUILD PACHI_BUILD_TARGET " dcnn build, " PACHI_BUILD_DATE 42 | #else 43 | #define PACHI_VERBUILD PACHI_BUILD_TARGET " !dcnn build, " PACHI_BUILD_DATE 44 | #endif 45 | 46 | #endif 47 | --------------------------------------------------------------------------------