SSブログ

Aperyのdebug無しビルドでbenchが通らない [コンピュータ将棋]

 置換表いじってたら、そもそもpullしたやつで以下の様な現象が出てしまったので、問題が分かる人は是非教えて下さい。

■環境
 Windows 8.1 64bit

 $ g++ --version
g++.exe (Rev4, Built by MSYS2 project) 5.2.0

Ubuntu ではg++ 5.2.1で問題なし


■コミット

commit e923d2764e54795bab465ee7ce87b0de2529acf1
Author: HiraokaTakuya 
Date:   Tue Jan 12 23:14:54 2016 +0900

    key取得コマンド追加


■ビルドオプションの変更

 -DNDEBUG => なし
 -Ofast => -O0 -g


■ビルド

make clean && make -j4

■方法

 benchコマンドを実行する

bench
sfen l6nl/5+P1gk/2np1S3/p1p4Pp/3P2Sp1/1PPb2P1P/P5GS1/R8/LN4bKL w GR5pnsg 1
info string optimum_search_time = 9500
info string maximum_search_time = 9500
info string book_ply 32767
info depth 1 seldepth 1 score cp -648 nodes 211 nps 14066 time 15 multipv 1 pv  G*1g

info depth 2 seldepth 2 score cp -367 nodes 613 nps 9887 time 62 multipv 1 pv  G*1g R*3a

info depth 3 seldepth 3 score cp -526 nodes 1646 nps 8108 time 203 multipv 1 pv  G*1g 4c3d N*4e

info depth 4 seldepth 6 score cp -463 nodes 7985 nps 7670 time 1041 multipv 1 pv  3i5g+ G*3h G*1g 2i2h

info depth 5 seldepth 6 score cp 1121 nodes 11396 nps 8234 time 1384 multipv 1 pv  3i1g+ G*1c 1b1c R*3c 6f3c

info depth 6 seldepth 7 score cp 1673 nodes 13909 nps 8847 time 1572 multipv 1 pv  3i1g+ G*1c 1b1c R*3c 6f3c 9h3h

info depth 7 seldepth 8 score cp 2612 nodes 17241 nps 9304 time 1853 multipv 1 pv  3i1g+ G*1c 1b1c R*3c 6f3c 2i3h R*2h 3h4g 2h9h+

info depth 8 seldepth 9 score cp 2612 nodes 18498 nps 9207 time 2009 multipv 1 pv  3i1g+ G*1c 1b1c R*3c 6f3c 2i3h R*2h 3h4g 2h9h+

Error! failedStep = 1
prevKey = 2204564077694724662
currKey = 9196037520415893749
'  9  8  7  6  5  4  3  2  1
P1-KY *  *  *  *  *  * -KE-KY
P2 *  *  *  *  * +TO * -KI *
P3 *  * -KE-FU * +GI * +FU *
P4-FU * -FU *  *  *  *  * -FU
P5 *  *  * +FU *  * +GI-FU *
P6 * +FU+FU-KA *  * +FU * +FU
P7+FU *  *  *  *  * +KI+GI-UM
P8+HI *  *  *  *  *  *  *  *
P9+KY+KE *  *  *  *  * +OU+KY
P-00FU00FU00FU00FU00FU
P-00KE
P-00GI
P-00KI00KI
P-00HI
-

key = 9196037520415893749

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Assertion failed!

Program: apery.exe
File: position.cpp, Line 383

Expression: isOK()


 後手の王が消えてるっぽい
<追記>

止まるときはとにかく玉が無い

Breakpoint 2, Position::isOK (this=0x3c02b6e0 )
    at position.cpp:1518
1518                            goto incorrect_position;
(gdb) info locals
kingCount = {0, 0}
prevKey = 16772494420517875973
debugAll = true
debugBitboards = true
debugKingCount = true
debugKingCapture = true
debugCheckerCount = true
debugKey = true
debugStateHand = true
debugPiece = true
debugMaterial = true
failedStep = 1
(gdb) frame 1
#1  0x00000000004089da in Position::doMove (
    this=0x3c02b6e0 , move=..., newSt=..., ci=...,
    moveIsCheck=false) at position.cpp:383
383             assert(isOK());
(gdb) info locals
boardKey = 14013623207675726940
handKey = 3405590672570798104
us = White
to = SQ64
ptCaptured = PTPromote
ptTo = Pawn
(gdb) c
Continuing.

Breakpoint 5, Position::isOK (this=0x3c02b6e0 )
    at position.cpp:1595
1595            std::cout << "Error! failedStep = " << failedStep << std::endl;
(gdb) c
Continuing.
Error! failedStep = 1
prevKey = 16772494420517875973
currKey = 17419213880246525044
'  9  8  7  6  5  4  3  2  1
P1-KY *  *  *  *  *  * -KE-KY
P2 *  *  *  *  * +TO * -KI *
P3 *  * -KE *  * +GI *  * -OU
P4-FU * -FU-FU *  *  * +FU-FU
P5 *  *  * +FU *  * +GI-FU *
P6 * +FU+FU-UM *  * +FU * +FU
P7+FU *  * -KI *  * +KI+GI-UM
P8+HI *  *  *  *  *  * -KI *
P9+KY+KE *  *  *  *  *  * +KY
P+00HI
P-00FU00FU00FU00FU00FU
P-00KE
P-00GI
+

key = 17419213880246525044



こんどは先手玉行方不明・・・

上記のやつのCapture = PromoteはEnum定義のせいだった
King と Promote数がともに数字上は8なので、先に定義されているPromoteが表示されていた

Kingがいない理由はCaptureされていたからだった

(gdb) frame 1
#1  0x00000000004089d4 in Position::doMove (
    this=0x3c02b6e0 , move=..., newSt=..., ci=...,
    moveIsCheck=false) at position.cpp:383
383             assert(isOK());
(gdb) info locals
boardKey = 14013623207675726940
handKey = 3405590672570798104
us = White
to = SQ64
ptCaptured = King
ptTo = Pawn
(gdb) bt
#0  Position::isOK (this=0x3c02b6e0 )
    at position.cpp:1518
#1  0x00000000004089d4 in Position::doMove (
    this=0x3c02b6e0 , move=..., newSt=..., ci=...,
    moveIsCheck=false) at position.cpp:383
#2  0x000000000047fdb6 in Searcher::search<(NodeType)2> (pos=...,
    ss=0x3e2dd748, alpha=1424, beta=1425, depth=OnePly, cutNode=true)
    at search.cpp:1191
#3  0x0000000000480169 in Searcher::search<(NodeType)2> (pos=...,
    ss=0x3e2dd700, alpha=-1425, beta=-1424, depth=4, cutNode=false)
    at search.cpp:1224
#4  0x0000000000480169 in Searcher::search<(NodeType)2> (pos=...,
    ss=0x3e2dd6b8, alpha=1424, beta=1425, depth=4, cutNode=true)
    at search.cpp:1224
#5  0x000000000047ffd1 in Searcher::search<(NodeType)2> (pos=...,
    ss=0x3e2dd670, alpha=-1425, beta=-1424, depth=8, cutNode=true)
    at search.cpp:1210
#6  0x0000000000480169 in Searcher::search<(NodeType)2> (pos=...,
    ss=0x3e2dd628, alpha=1424, beta=1425, depth=8, cutNode=false)
    at search.cpp:1224
#7  0x0000000000480169 in Searcher::search<(NodeType)2> (pos=...,
    ss=0x3e2dd5e0, alpha=-1425, beta=-1424, depth=10, cutNode=true)
    at search.cpp:1224
#8  0x000000000047d6bf in Searcher::search<(NodeType)1> (pos=...,
    ss=0x3e2dd598, alpha=1424, beta=1456, depth=14, cutNode=false)
    at search.cpp:1210
#9  0x000000000047d999 in Searcher::search<(NodeType)1> (pos=...,
    ss=0x3e2dd550, alpha=-1456, beta=-1424, depth=16, cutNode=false)
    at search.cpp:1232
#10 0x000000000047d999 in Searcher::search<(NodeType)1> (pos=...,
    ss=0x3e2dd508, alpha=1424, beta=1456, depth=16, cutNode=false)
    at search.cpp:1232
#11 0x000000000047d999 in Searcher::search<(NodeType)1> (pos=...,
    ss=0x3e2dd4c0, alpha=-1456, beta=-1424, depth=16, cutNode=false)
    at search.cpp:1232
#12 0x000000000047d999 in Searcher::search<(NodeType)1> (pos=...,
    ss=0x3e2dd478, alpha=1424, beta=1456, depth=16, cutNode=false)
    at search.cpp:1232
#13 0x000000000047d999 in Searcher::search<(NodeType)1> (pos=...,
    ss=0x3e2dd430, alpha=-1456, beta=-1424, depth=16, cutNode=false)
    at search.cpp:1232
#14 0x000000000047bcee in Searcher::search<(NodeType)0> (pos=...,
    ss=0x3e2dd3e8, alpha=1424, beta=1456, depth=18, cutNode=false)
    at search.cpp:1232
#15 0x000000000043d14b in Searcher::idLoop (pos=...) at search.cpp:597
#16 0x000000000043eddd in Searcher::think () at search.cpp:1546
#17 0x0000000000444112 in MainThread::idleLoop (this=0x3c9467f0)
    at thread.cpp:59


givesCheckもinCheckも両方共falseで王手放置で探索が進んでいるのが原因っぽい

王手放置 > 指し手をすすめる(この場合△64歩で玉を取る) > isOKでエラー



nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:パソコン・インターネット

nice! 0

コメント 0

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

トラックバック 0

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。