pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
514 stars 117 forks source link

Pachi doesn't work with latest kgsGtp 3.5.23 #132

Closed NotReallyADeveloper closed 4 years ago

NotReallyADeveloper commented 4 years ago

Pachi 12.45 crashes out whenever starting a game. Board is rendered and pachi quits with no meaningful error message in either kgsGtp or pachi log (-d 5). All files present in same folder and using --kgs makes no difference.

Doesn't exhibit same behaviour with kgsGtp v3.5.11 (as suggested by documentation).

NotReallyADeveloper commented 4 years ago

config:

engine=./pachi --kgs -o pachi.log -d 5 -t =5000:15000 name=xxx password=xxx room=Computer Go mode=custom server.host=goserver.gokgs.com server.port=2379 reconnect=true opponent=xxx rules=japanese rules.boardSize=9 rules.time=1:00+5x0:30 talk=Test Bot verbose=t gameNotes=Pachi on Mac

lemonsqueeze commented 4 years ago

Hi, Thanks for reporting.

I don't think i've ever got any of the recent kgsgtp's to work. In my case it's not Pachi but kgsgtp itself which crashes when starting a game. For example with kgsGtp-3.5.23:

FINEST: Queued command sent to engine: clear_board
Apr 19, 2020 4:32:13 PM com.gokgs.client.gtp.GtpClient clientEvent
SEVERE: Fatal internal error
java.lang.NullPointerException
        at com.gokgs.client.gtp.GtpConvo.handleChat(GtpConvo.java:70)
        at com.gokgs.client.gtp.GtpConvo.handleConvoEvent(GtpConvo.java:64)
        at org.igoweb.util.Multicaster.handleEvent(Multicaster.java:107)
        at org.igoweb.util.Emitter.emit(Emitter.java:85)
        at org.igoweb.igoweb.client.CChannel.appendChat(CChannel.java:249)
        at com.gokgs.client.KCGame.extractChats(KCGame.java:393)
        at com.gokgs.client.KCGame.applyTreeEvent(KCGame.java:376)
        at com.gokgs.client.KCGame.readGameUpdate(KCGame.java:366)
        at org.igoweb.igoweb.client.CGame.handleMessage(CGame.java:163)
        at com.gokgs.client.KCGame.handleMessage(KCGame.java:156)
        at org.igoweb.igoweb.client.Client.connEventIn(Client.java:465)
        at org.igoweb.igoweb.client.Conn.doEmit(Conn.java:267)
        at org.igoweb.igoweb.client.Conn.lambda$emit$0(Conn.java:257)
        at org.igoweb.igoweb.client.LockConnMutex.dispatcher(LockConnMutex.java:128)
        at java.lang.Thread.run(Thread.java:745)

But then i'm on linux so your case might be different. If you're unsure try hooking gnugo instead of pachi that should tell us if it's really engine-related.

iirc there was a post about it in computer-go mailing list, you need a special java version or something. Basically i just stick to 3.5.11 which just works.

NotReallyADeveloper commented 4 years ago

I’ve tried it both on raspian and Mac OS. Also, kgsGtp 3.5.23 works fine with other engines (e.g. leelaz and katago)

On Apr 19, 2020, at 10:52 AM, lemonsqueeze notifications@github.com wrote:

Hi, Thanks for reporting.

I don't think i've ever got any of the recent kgsgtp's to work. In my case it's not Pachi but kgsgtp itself which crashes when starting a game. For example with kgsGtp-3.5.23:

FINEST: Queued command sent to engine: clear_board Apr 19, 2020 4:32:13 PM com.gokgs.client.gtp.GtpClient clientEvent SEVERE: Fatal internal error java.lang.NullPointerException at com.gokgs.client.gtp.GtpConvo.handleChat(GtpConvo.java:70) at com.gokgs.client.gtp.GtpConvo.handleConvoEvent(GtpConvo.java:64) at org.igoweb.util.Multicaster.handleEvent(Multicaster.java:107) at org.igoweb.util.Emitter.emit(Emitter.java:85) at org.igoweb.igoweb.client.CChannel.appendChat(CChannel.java:249) at com.gokgs.client.KCGame.extractChats(KCGame.java:393) at com.gokgs.client.KCGame.applyTreeEvent(KCGame.java:376) at com.gokgs.client.KCGame.readGameUpdate(KCGame.java:366) at org.igoweb.igoweb.client.CGame.handleMessage(CGame.java:163) at com.gokgs.client.KCGame.handleMessage(KCGame.java:156) at org.igoweb.igoweb.client.Client.connEventIn(Client.java:465) at org.igoweb.igoweb.client.Conn.doEmit(Conn.java:267) at org.igoweb.igoweb.client.Conn.lambda$emit$0(Conn.java:257) at org.igoweb.igoweb.client.LockConnMutex.dispatcher(LockConnMutex.java:128) at java.lang.Thread.run(Thread.java:745) But then i'm on linux so your case might be different. If you're unsure try hooking gnugo instead of pachi that should tell us if it's really engine-related.

iirc there was a post about it in computer-go mailing list, you need a special java version or something. Basically i just stick to 3.5.11 which just works.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pasky/pachi/issues/132#issuecomment-616153137, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACP3TK6VCWMINAXZIHEVXN3RNMF2BANCNFSM4MLZKFSA.

lemonsqueeze commented 4 years ago

That's interesting, are you getting the java.lang.NullPointerException too ?

NotReallyADeveloper commented 4 years ago

Among other things, yes. Full output from launch to the crash:

java -jar kgsGtp-3.5.23.jar pachibot.ini

Apr. 19, 2020 11:29:55 A.M. com.gokgs.client.gtp.GtpClient main FINE: KGS GTP Client v3.5.23 starting up Apr. 19, 2020 11:29:55 A.M. com.gokgs.client.gtp.GtpClient showErrors FINER: EOF from engine's stderr Apr. 19, 2020 11:29:55 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "list_commands": = protocol_version name echo version list_commands known_command quit boardsize clear_board komi play genmove time_left time_settings set_free_handicap place_free_handicap fixed_handicap final_score final_status_list undo showboard kgs-game_over kgs-rules kgs-genmove_cleanup kgs-time_settings kgs-chat pachi-predict pachi-tunit pachi-gentbook pachi-dumptbook pachi-evaluate pachi-result pachi-score_est pachi-setoption pachi-getoption lz-analyze lz-genmove_analyze predict tunit score_est gogui-analyze_commands gogui-livegfx gogui-influence gogui-score_est gogui-final_score gogui-best_moves gogui-winrates gogui-joseki_moves gogui-joseki_show_pattern gogui-pattern_best gogui-pattern_colors gogui-pattern_rating gogui-pattern_features gogui-pattern_gammas gogui-show_spatial gogui-spatial_size gogui-color_palette gogui-analyze_commands Apr. 19, 2020 11:29:55 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Queued command sent to engine: name Apr. 19, 2020 11:29:55 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "name": = Pachi Apr. 19, 2020 11:29:55 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Queued command sent to engine: version Apr. 19, 2020 11:29:55 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "version": = Pachi 12.45, Have a nice game ! Apr. 19, 2020 11:29:56 A.M. com.gokgs.client.gtp.GtpClient clientEvent FINE: Login successful. Apr. 19, 2020 11:29:56 A.M. com.gokgs.client.gtp.State canPlayRanked FINE: Auth level is not ROBOT_RANKED, can only play free games Apr. 19, 2020 11:29:56 A.M. com.gokgs.client.gtp.GtpClient foundRoom FINER: Found room Computer Go, will join Apr. 19, 2020 11:29:56 A.M. com.gokgs.client.gtp.GtpClient roomEvent FINE: Joined room "Computer Go" Apr. 19, 2020 11:29:56 A.M. com.gokgs.client.gtp.GtpClient startGame FINER: No games to join. Creating an open game. Apr. 19, 2020 11:29:56 A.M. com.gokgs.client.gtp.GtpChal handleEvent FINER: Joined challenge Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpChal handleEvent FINER: Got challenge from “xxx", testing engine response. Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Command sent to engine: boardsize 9 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "boardsize 9": = Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpChal receivedBoardSizeResponse FINEST: Board size 9 is acceptable Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Command sent to engine: kgs-time_settings byoyomi 60 30 5 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "kgs-time_settings byoyomi 60 30 5": = Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpChal receivedTimeResponse FINEST: Time system is acceptable Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpChal receivedTimeResponse FINEST: Sending challenge back to server Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient gameEvent FINER: Joined game Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Command sent to engine: kgs-rules japanese Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.ClientGtpGame FINE: Starting game as white against xxx Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Command queued for sending to engine: boardsize 9 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Command queued for sending to engine: clear_board Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Command queued for sending to engine: komi 6.5 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Command queued for sending to engine: kgs-time_settings byoyomi 60 30 5 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.ClientGtpGame startOpponentTimer WARNING: Opponent has left game. Will give them 5 minutes to return. Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "kgs-rules japanese": = Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Queued command sent to engine: boardsize 9 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "boardsize 9": = Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Queued command sent to engine: clear_board Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.ClientGtpGame waitForOpponentReturn FINE: Opponent has returned. Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "clear_board": = Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Queued command sent to engine: komi 6.5 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient clientEvent SEVERE: Fatal internal error java.lang.NullPointerException at com.gokgs.client.gtp.GtpConvo.handleChat(GtpConvo.java:70) at com.gokgs.client.gtp.GtpConvo.handleConvoEvent(GtpConvo.java:64) at org.igoweb.util.Multicaster.handleEvent(Multicaster.java:107) at org.igoweb.util.Emitter.emit(Emitter.java:85) at org.igoweb.igoweb.client.CChannel.appendChat(CChannel.java:249) at com.gokgs.client.KCGame.extractChats(KCGame.java:393) at com.gokgs.client.KCGame.applyTreeEvent(KCGame.java:376) at com.gokgs.client.KCGame.readGameUpdate(KCGame.java:366) at org.igoweb.igoweb.client.CGame.handleMessage(CGame.java:163) at com.gokgs.client.KCGame.handleMessage(KCGame.java:156) at org.igoweb.igoweb.client.Client.connEventIn(Client.java:465) at org.igoweb.igoweb.client.Conn.doEmit(Conn.java:267) at org.igoweb.igoweb.client.Conn.lambda$emit$0(Conn.java:257) at org.igoweb.igoweb.client.LockConnMutex.dispatcher(LockConnMutex.java:128) at java.base/java.lang.Thread.run(Thread.java:832)

Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "komi 6.5": = Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Queued command sent to engine: kgs-time_settings byoyomi 60 30 5 Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient protocolEvent FINEST: Got successful response to command "kgs-time_settings byoyomi 60 30 5": = java.io.EOFException at java.base/java.io.DataInputStream.readShort(DataInputStream.java:319) at org.igoweb.igoweb.client.Conn.waitForMessages(Conn.java:303) at java.base/java.lang.Thread.run(Thread.java:832) Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient clientEvent FINE: Normal disconnection from server. Apr. 19, 2020 11:30:01 A.M. com.gokgs.client.gtp.GtpClient go FINE: Will wait 5 minutes, then try to connect again.

On Apr 19, 2020, at 11:01 AM, lemonsqueeze notifications@github.com wrote:

That's interesting, are you getting the java.lang.NullPointerException too ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pasky/pachi/issues/132#issuecomment-616155616, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACP3TK6Z7C7Z356CJ3YNYNDRNMG6PANCNFSM4MLZKFSA.

lemonsqueeze commented 4 years ago

This is related to the kgs-chat command: Pachi handles it whereas leela-zero doesn't. Indeed, if i disable kgs-chat command in gtp.c now it works.

Somehow kgsgtp sees that Pachi supports kgs-chat, that triggers some code that otherwise wouldn't be used and it trips over.

lemonsqueeze commented 4 years ago

http://www.computer-go.org/pipermail/computer-go/2017-December/010616.html

I think kgs-chat command does not work since kgsGtp 3.5.20. Not supporting kgs-chat command may be safe.

lemonsqueeze commented 4 years ago

I'll disable kgs-chat command by default from now on this way it works with any kgsgtp version. Those who need it can use kgsGtp-3.5.11 with pachi --kgs-chat Code is in PR #133