1.2くらいから考える将棋ブログ

わかった気になるも、よくわからないことを考えていく?

やねうら王のテラショック定跡コマンドで遊ぶー2

jotcut-jshakki.hatenablog.com

続き

今回の記事では、sfenを集めて thinkと build_treeを一周回した結果を書く(やねさん記事でいうstep1, step2, step3, step5 に相当、本記事でもstep1, step2, step3, step5 とする)

Step 1. 思考対象の棋譜を用意

今回は先手袖飛車の定跡を題材にしてみようと思ったので、orqhaを袖飛車側、相手をQQR、Apery(2018)、技巧2、nozomi(2018)、Novice mini(2018)、shogi686(161024)、BlunderXX(20130508)、おから饅頭(20160722)、Bonanza6(usi ver)で棋譜を150個くらい作った。手数は32手まで(←これは微妙だったかも)
用意した棋譜

Step 2. 棋譜から思考させる

Threads 12
Hash 8192
MultiPV 3
makebook think Sodebisha_Proj.sfen sode.db startmoves 1 moves 2 depth 27 nodes 1000000000
makebook think Sodebisha_Proj.sfen sode.db startmoves 2 moves 32 depth 26 nodes 1000000000
一個目のthinkがtotal 2 nodesで3分くらい、二個目がtotal 2732 nodesで260分くらい

Step 3. テラショック形式にビルドさせる

makebook build_tree sode.db sodeshock.db
こんな感じの出力が出て、すぐに終わった。

info string Error! : can't read book/standard_book.db
info string Hash Clear begin , Hash size = 8192[MB]
info string Hash Clear done.
makebook build_tree ..
read_book_name = sode.db
write_book_name = sodeshock.db
black_contempt = 50
white_contempt = 150

0....................................................................................................
1000....................................................................................................
2000..........................................................................
write sodeshock.db
info string Error! : can't read book/standard_book.db
info string Hash Clear begin , Hash size = 8192[MB]
info string Hash Clear done.
done.

現在はこの定跡を載せたソフトをfloodgateに流している。

http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=Apery190224-YO487-Sode
http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=tanuki-ng-YO487-Sode
http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=tanuki-ng-1018-YO487-Sode
http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=Sode-YO485-KW
http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=orqha-1018-YO487-Sode
http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=Sodelmo0501-YO485
http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=Sodelmo0506-YO485
http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=illqha4-YO487-Sode

Step 5. extend_treeで延長する局面を書き出す

Step 4のStep 1→Step 2ループをサボるため行う代わりに、Step 5のextend_treeコマンドを試した。(とりあえずやってみた)

makebook extend_tree sode.db Sodebisha_Proj.sfen Write.sfen black_eval_limit -100 white_eval_limit -200
info string Error! : can't read book/standard_book.db
info string Hash Clear begin , Hash size = 8192[MB]
info string Hash Clear done.
makebook extend tree ..
read_book_name = sode.db
read_sfen_name = Sodebisha_Proj.sfen
write_sfen_name = Write.sfen
black_eval_limit = -100
white_eval_limit = -200
extend[0] : startpos moves 3g3f 3c3d 2h3h 4a3b 3i2h 6a5b 2h3g 4c4d 3f3e 3d3e 3g2f 4d4e 3h3e 8c8d 3e3f 8d8e 6i7h 5b4c 5i6h 6c6d 2i3g 7a7b 6h6i 7b6c 7i6h 6c5d 9g9f P3d 6i7i 3a4b P3e 3d3e
extend[1] : startpos moves 3g3f 3c3d 2h3h 8b3b 3i4h 3a4b 9g9f 5a6b 9f9e 6b7b 5i6h 7b8b 5g5f 9a9b 6h7h 8b9a 4h5g 7a8b 5g4f 4b3c 3f3e 3d3e 4f3e P3d 3e4f 6a7a 7g7f 3c4d 7i6h 4a5a 3h3f 5a4b
extend[2] : startpos moves 3g3f 3c3d 2h3h 8b3b 3i4h 5a6b 5i6h 6b7b 9g9f 7b8b 2g2f 9a9b 6h7h 8b9a 2f2e 7a8b 4i5h 6a7a 5g5f 3a4b 9f9e 5c5d 7g7f 4c4d 4h5g 7c7d 6g6f 4b5c 5h6g 2b3c 6f6e 4a5b
(中略)
extend[12] : startpos moves 3g3f 8c8d 3f3e 8d8e 6i7h 4a3b 3i4h 8e8f 8g8f 8b8f P
8g 8f8e 7g7f 8e3e 2g2f 3e3f 7h7g 7a7b 4h3g 3f3d 2f2e 5a6b 5i6h 6b7a 9g9f 3a4b 7g6f 4b5a 9f9e 5a6b 7i7h 1c1d
extend[13] : startpos moves 3g3f 8c8d 3f3e 8d8e 6i7h 4a3b 3i4h 8e8f 8g8f 8b8f P8g 8f8e 7g7f 8e3e 2g2f 3e3f 7h7g 3f3d 5i6h 3a4b 2f2e 5a6b
0|16.extend[14] : startpos moves 3g3f 8c8d 3f3e 8d8e 6i7h 4a3b 2h3h 5a4a 3i4h 7a6b 7g7f 7c7d 2g2f 8e8f 8g8f 8b8f 3h3f 6b7c P
8g 8f8d 5i5h 7c6d 2f2e 7d7e 7f7e 6d7e 4i5i 3a4b 2i3g P7f 7i6h 4a3a
(中略)
extend[142] : startpos moves 3g3f 3c3d 2h3h 8c8d 6i7h 8d8e 3f3e 3d3e 3h3e 8e8f 8g8f 8b8f P
8g 8f8b 3e3f 7a6b 3i4h 7c7d 4i3h 6b7c 4g4f 4a3b 7g7f 5a4b 5i6h 2c2d 2g2f 3b2c 4h4g 6a5b 3f3g 7c6d
extend[143] : startpos moves 3g3f 3c3d 2h3h 8c8d 6i7h 8d8e 3f3e 3d3e 3h3e 8e8f 8g8f 8b8f P8g 8f8b 3i4h 7a6b 4g4f 7c7d 7g7f 2b8h+ 7i8h 3a2b B3b P3d 3e3d 2b3c 3d3c+ 2a3c 3b2c+ P3b P3d 3c2e
extend[144] : startpos moves 3g3f 3c3d 2h3h 8c8d 6i7h 8d8e 3i2h 8e8f 8g8f 8b8f P
8g 8f8b 2h3g 7a7b 3g4f 7c7d 3f3e 3d3e 4f3e 7b7c 3h3f 3a4b 3e4f 7c6d 1g1f 4b3c 7g7f 3c4d 2i3g 1c1d 5i6i 9c9d

done.

こうして出来上がったWrite.sfenだが、パット見はほとんど変わったように見えずよくわからなかった。
(よく見るとextend[13]は一手増え、棋譜が3つになっているが、他の棋譜はほとんど変わってない。延長処理のされた棋譜に0|16みたいな処理結果が書かれる?)
startpos moves 3g3f 8c8d 3f3e 8d8e 6i7h 4a3b 3i4h 8e8f 8g8f 8b8f P8g 8f8e 7g7f 8e3e 2g2f 3e3f 7h7g 3f3d 5i6h 3a4b 2f2e 5a6b 9g9f
startpos moves 3g3f 8c8d 3f3e 8d8e 6i7h 4a3b 3i4h 8e8f 8g8f 8b8f P
8g 8f8e 7g7f 8e3e 2g2f 3e3f 7h7g 3f3d 5i6h 3a4b 2f2e 5a6b 4h3g
startpos moves 3g3f 8c8d 3f3e 8d8e 6i7h 4a3b 3i4h 8e8f 8g8f 8b8f P*8g 8f8e 7g7f 8e3e 2g2f 3e3f 7h7g 3f3d 5i6h 3a4b 2f2e 5a6b 7g6f

そのため、extend_tree(とendless_extend_tree)については、 別途別の局面で試すこととした。

雑感

extend_treeについてはもう少し使用感を得ないとなんとも言えないが、このコマンドによってStep1の対局の手間が省けるかというと、あまりそういう感じもなさそうだと感じた。
この辺については、tibigameさんも 労力が改善された訳ではなく、結局は普通に定跡を掘っていくしかないと述べている。