KataGo icon indicating copy to clipboard operation
KataGo copied to clipboard

When katago is playing, the result shows that katago is illegal

Open Harder-Run opened this issue 2 years ago • 16 comments

When Katago was almost finished a game, it sometimes shows that katago was illegal. For example, katago is black, and the result is W+illegal. There is a sgf file: http://www.yss-aya.com/cgos/viewer.cgi?9x9/SGF/2022/09/09/1345415.sgf http://www.yss-aya.com/cgos/9x9/SGF/2022/09/09/1345415.sgf How can I solve it?

Harder-Run avatar Sep 10 '22 05:09 Harder-Run

You probably configured KataGo to use the wrong rules. Check CGOS's documentation for what its rules are, then specify those rules in KataGo's config.

lightvector avatar Sep 10 '22 06:09 lightvector

CGOS's rule is tromp-taylor, and config's rule is tt, too.

Harder-Run avatar Sep 10 '22 07:09 Harder-Run

No, I remember from before CGOS's rule is not tromp-taylor, it's something else. Please check the documentation for CGOS carefully.

lightvector avatar Sep 10 '22 11:09 lightvector

aha? I will check again carefully.

Harder-Run avatar Sep 10 '22 22:09 Harder-Run

Programs that play on CGOS use rules very similar to the Tromp/Taylor rules (sometimes referred to as "The Logical Rules") but prohibit suicide. These are also rather similar to Chinese rules but the games are played out to the end, then no further stones are removed, and the ko rules are clarified to be Positional Superko. So, should I use Chinese or tt rules?

Harder-Run avatar Sep 10 '22 23:09 Harder-Run

Seems like you should use neither one. Since CGOS uses neither Chinese rules nor Tromp-Taylor rules, but instead uses an alternative version of Tromp Taylor rules where suicide is prohibited, you need to also manually specify every separate aspect of the rules rule (scoring, ko, suicide, etc) to the way it should be to make it match.

lightvector avatar Sep 10 '22 23:09 lightvector

Oh. How should I do?

Harder-Run avatar Sep 11 '22 12:09 Harder-Run

Take a look at this section in the config. https://github.com/lightvector/KataGo/blob/master/cpp/configs/gtp_example.cfg#L94-L115

lightvector avatar Sep 11 '22 13:09 lightvector

in your KATAGO config file, locate "multiStoneSuicideLegal = true" and change it to "multiStoneSuicideLegal = false". Then you should be fine when playing on CGOS. I ran into this problem before (https://github.com/lightvector/KataGo/issues/554)

hwj-111 avatar Sep 11 '22 19:09 hwj-111

Thanks a lot. @lightvector @hwj-111

Harder-Run avatar Sep 12 '22 04:09 Harder-Run

but, it shows "Cannot both specify 'rules' and individual rules like multiStoneSuicideLegal"

Harder-Run avatar Sep 17 '22 10:09 Harder-Run

??

Harder-Run avatar Sep 17 '22 10:09 Harder-Run

This was explained a little bit up thread:

Since CGOS uses neither Chinese rules nor Tromp-Taylor rules, but instead uses an alternative version of Tromp Taylor rules where suicide is prohibited, you need to also manually specify every separate aspect of the rules rule (scoring, ko, suicide, etc) to the way it should be to make it match.

For CGOS, if it's just Tromp Taylor without suicide you'll probably want:

koRule = POSITIONAL   # Positional superko
scoringRule = AREA  # Territory scoring (uses a sort of special computer-friendly territory ruleset)
taxRule = NONE  # All surrounded empty points are scored
multiStoneSuicideLegal = false  # Is multiple-stone suicide legal? (Single-stone suicide is always illegal).
hasButton = false # Set to true when area scoring to award 0.5 points to the first pass.
friendlyPassOk = false  # Set to true except for computer rulesets that requires capturing all stones before passing.
whiteHandicapBonus = 0    # In handicap games, give white no compensation for black's handicap stones (Tromp-taylor, NZ, JP)

See https://lightvector.github.io/KataGo/rules.html for details on what TT rules actually are. I just took these rules and changed the suicide rule from true to false.

Disclaimer, I have never run a bot on CGOS.

OmnipotentEntity avatar Sep 17 '22 15:09 OmnipotentEntity

@OmnipotentEntity Thanks! I think scoringRule should be AREA instead since if you're tromp-taylor rules with a modification, then you're going to be area scoring as a baseline? @dergo853 - sorry for the long back and forth, see if that gets things working for you?

lightvector avatar Sep 17 '22 15:09 lightvector

Good catch. Fixed. I knew that but somehow deleted the wrong line on accident.

OmnipotentEntity avatar Sep 17 '22 16:09 OmnipotentEntity

ok. i'll try

Harder-Run avatar Sep 18 '22 02:09 Harder-Run