KataGo planned rules - drafted

For discussing go rule sets and rule theory
RobertJasiek
Judan
Posts: 6273
Joined: Tue Apr 27, 2010 8:54 pm
GD Posts: 0
Been thanked: 797 times
Contact:

Re: KataGo planned rules - drafted

Post by RobertJasiek »

Matti
Lives in gote
Posts: 309
Joined: Tue Apr 27, 2010 11:05 pm
Rank: 5 dan
GD Posts: 0
Has thanked: 3 times
Been thanked: 41 times

Re: KataGo planned rules - drafted

Post by Matti »

lightvector wrote:Thanks. Okay, I am going to amend the drafted rules to assign ko-blocks to the stone being recaptured, rather than the empty point of the ko. They will also persist as long as the stone remains on the board. I think the complexity of these rules is almost the same as the earlier draft (slightly simpler in some regards, slightly more wordy in others). It's about as easy to actually code up too.

I think this should get both of Matti's positions correct. It will still show anomalies for *even longer* chains of kos due to assigning a block to only a stone rather than the pair of stones of a ko, but whatever, that's fine. It will also still share the "rules beast" issue in the other thread of position B for J89 rules where a double ko death can be won, but the most "obvious" interpretation of J89 also shares that issue, so I'm going to just accept that anomaly for these too.
Have you already constructed a position with *even longer* chain of kos?
lightvector
Lives in sente
Posts: 759
Joined: Sat Jun 19, 2010 10:11 pm
Rank: maybe 2d
GD Posts: 0
Has thanked: 114 times
Been thanked: 916 times

Re: KataGo planned rules - drafted

Post by lightvector »

Yes.

White group A, Black group B, White group C, all in the middle of the board, no edges needed. A is safe and connected to other stuff, B and C are racing.

A and B share a multi-step-ko chain of arbitrarily long length. B only controls one spot in the chain, and has no outside liberties, so is in atari. B is racing against C, which has 2 outside liberties. If only B could get a free move to not be in atari, it could fill a liberty of C and win the race.

The net effect of the rules being anomalous here is that KataGo will "misevaluate" the position by a single point, thinking that White needs a defense before the end of the main phase. Or rather, it would if the neural net were to see this position frequently enough to learn it - probably this will not be the case and the neural net will be giving evaluations with significant noise/error anyways. And at this point I'm okay for having KataGo make a "mistake" of only 1 point in a position that will almost never happen in exchange for avoiding messy implementation complexity (which assigning a block to pairs of points would do). KataGo will already be making mistakes far more than 1 point in far more common situations.

And I could still always patch this in the future if a simple fix is found.
jaeup
Dies with sente
Posts: 73
Joined: Thu Jun 13, 2019 5:08 pm
Rank: 5d
GD Posts: 0
Has thanked: 7 times
Been thanked: 17 times
Contact:

Re: KataGo planned rules - drafted

Post by jaeup »

lightvector wrote:
Click Here To Show Diagram Code
[go]$$cB
$$ ----------------------
$$ | X X X X X X X O . . .
$$ | X O X . X . X O O . .
$$ | O . O X O X O X O . .
$$ | . O O O O O O X O . .
$$ | O O X X X X X X . . .
$$ | X X X . . . . . . . .
$$ | . . . . . . . . . . .
$$ | . . . . . . . . . . .[/go]

Maybe it is too late to jump into this subject, but I just want to make sure you are trying to reproduce the "right" conclusion.

Regarding the "standard molasses ko" shape, I am quite sure if it occurs in a pro match, the game will end with a draw. The logic is simply that one player cannot afford to make a pass if he wants to keep his group (thus the game will never end with two passes, though it is a tricky claim). A few Korean pros who saw this shape agreed with such a conclusion, after a few eyeball rolling. I don't think Korean and Japanese rule will work differently here.

For the above shape, the situation is slightly different. Both Black and White can safely pass at this shape, and the likely conclusion is a local seki.
Jaeup Kim
Professor in Physics, Ulsan National Institute of Science and Technology, Korea
Author of the Book "Understanding the Rules of Baduk", available at https://home.unist.ac.kr/professor/juki ... ce&wr_id=5
jaeup
Dies with sente
Posts: 73
Joined: Thu Jun 13, 2019 5:08 pm
Rank: 5d
GD Posts: 0
Has thanked: 7 times
Been thanked: 17 times
Contact:

Re: KataGo planned rules - drafted

Post by jaeup »

I love using KataGo and I really feel like to help you. As you can see from my signature, I wrote a book "Understanding the Rules of Baduk". Many questions you have about Go rules are probably already included there, but I regret that I did not finish its translation in English.
lightvector wrote:For AlphaZero-like self-play training purposes, neural net input/output representation, and compatibility with existing protocols for computer Go playing and game representation (GTP, SGF), I would like a ruleset that:

* Does not include any hypothetical play, branching of the game (i.e. copying the game to determine something) or any rollback of state upon determining the status of a chain, or a ko, or an area of the board. The game and all statuses are determined through alternating actions alone.

* All possible actions in any phase of the game are either a pass or are "naturally" representable as being associated with one or more locations on the board, such that these locations are disjoint between actions on a given turn (implications: any location has at most one possible action associated with it, the maximum number of possible legal actions on a 19x19 board is 362, there are no actions like "communicate a list of group and their proposed statues to be agreed upon" that cannot be naturally be encoded in such a way, etc.).

* Will still produce some result even with fairly badly-behaved players. Such as players that play completely at random, or do not understand when play are necessary or not, or that "mistakenly" take actions that result in the game ending "prematurely". Self-play rules must be able to handle such players.

* Can be efficiently implemented in an actual computer program without too much difficulty. I think the current draft is not too bad on this - only a small number of additional concepts are defined such "state" and "atari" beyond those that a computer implementation would need to implement anyways such as "region", and simple combinations of those concepts are enough to define the most complex concepts like "independent-life-region" without any more layers of definitions. And as for efficiency, everything is computable directly, for example no tree search over move sequences is necessary to implement any of the rules.

* Subject to the above technical requirements/restrictions, still does a reasonable job of matching most common situation results in the Japanese rules so long as the players ARE reasonably-well-behaved and act self-interestedly.
It is a nice summary of your objective. I mostly agree with you that a rule (for both human and AI) must seek for such goals, and actually the above sentences can be a good summary of Ch. 5 of my book.
lightvector wrote:
For most area-scoring rulesets, it is not hard to come up with a version that satisfies all the above technical requirements, in fact many of them pretty much do already
Now it is difficult for me to agree with this. Maybe you think some rulesets adopting superko rules (T-T, AGA, NZ or whatever) can achieve this, but I've yet to see a superko-adopting rule that does not have an anomaly. Ch. 10 of my book is devoted to explain all the anomalies of superko rules.

Ch. 12 of the book introduces a new ruleset which is pretty much a reproduction of the current Chinese ruleset. (I feel like to say that by applying this ruleset, the result of the game will match with the intention of the current Chinese rule.) The rule text is at this link.
http://home.unist.ac.kr/~jukim/?module= ... 1a9b1ec6f1

Even though it is basically an area scoring rule, if you are looking for a ruleset that results in draws for triple and quadruple kos and prevents trolling (such as sending-two-returning-one, repeatedly touching double ko seki, not giving up separated moonshine life, etc.) maybe it is worth reading. Unfortunately, the commentary of the ruleset is yet to be translated, and without the whole book in English, it won't be easy for you to understand how the rule can really survive all possible attacks. If you have specific questions, I can at least answer them.

The ruleset introduces some unfamiliar concepts, but you are a programmer and you will quickly realize that its programming is actually quite easy because all you need to do is to write down a few if, then, else sentences. (There is no implicit statement such as "resolve the situation".) Probably the only drawback is the introduction of two different passes, one for the ko capture and one for the game ending. (The situation will be worse for you because you are seeking for a territory scoring rule, and the game is played through multiple phases.) I tried really hard to see if I can make a ruleset with only one type of pass, but my temporarily conclusion is No. To defend a game from all wicked trolls, two different passes are probably inevitable.
Jaeup Kim
Professor in Physics, Ulsan National Institute of Science and Technology, Korea
Author of the Book "Understanding the Rules of Baduk", available at https://home.unist.ac.kr/professor/juki ... ce&wr_id=5
Bill Spight
Honinbo
Posts: 10905
Joined: Wed Apr 21, 2010 1:24 pm
Has thanked: 3651 times
Been thanked: 3373 times

Re: KataGo planned rules - drafted

Post by Bill Spight »

jaeup wrote:Regarding the "standard molasses ko" shape, I am quite sure if it occurs in a pro match, the game will end with a draw. The logic is simply that one player cannot afford to make a pass if he wants to keep his group (thus the game will never end with two passes, though it is a tricky claim). A few Korean pros who saw this shape agreed with such a conclusion, after a few eyeball rolling. I don't think Korean and Japanese rule will work differently here.
As I said, a molasses ko is quite hot. Unless either player makes a sufficiently large threat, the game is likely to end in resignation when one player's only legal play on the board is to put one of his own groups into atari. Effectively, on the board outside the molasses ko, the game becomes one of no pass go.
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
Bill Spight
Honinbo
Posts: 10905
Joined: Wed Apr 21, 2010 1:24 pm
Has thanked: 3651 times
Been thanked: 3373 times

Re: KataGo planned rules - drafted

Post by Bill Spight »

jaeup wrote:
lightvector wrote:
For most area-scoring rulesets, it is not hard to come up with a version that satisfies all the above technical requirements, in fact many of them pretty much do already
Now it is difficult for me to agree with this. Maybe you think some rulesets adopting superko rules (T-T, AGA, NZ or whatever) can achieve this, but I've yet to see a superko-adopting rule that does not have an anomaly. Ch. 10 of my book is devoted to explain all the anomalies of superko rules.
How do you define a go anomaly? The Japanese 1949 rules required single kos to be filled or otherwise resolved, but Honinbo Shusai had disagreed, and Go Seigen still did. The question came up in a game between him and Takagawa, which Go Seigen had not agreed would be played under Nihon Kiin rules. An anomaly has arisen under the J89 rules, because of their redefinition of seki. Correct play appears to be for the players to leave groups with two eyes as seki. Ikeda warns against chasing anomalies. But Ing ended up chasing anomalies his whole life.
jaeup wrote:Probably the only drawback is the introduction of two different passes, one for the ko capture and one for the game ending. (The situation will be worse for you because you are seeking for a territory scoring rule, and the game is played through multiple phases.) I tried really hard to see if I can make a ruleset with only one type of pass, but my temporarily conclusion is No. To defend a game from all wicked trolls, two different passes are probably inevitable.
Before the 20th century go games ended by agreement. For some reason modern rulesmakers wanted to end play by passes, even though a player might pass without wishing to end play, because she wanted to take a ko. If you allow a pass to lift a ko ban, then that pass cannot be used in itself to end play, because it requires play to continue in order for it to be possible to take the ko. You can get around that with my rule, which stops play when the same player makes a second pass in the same whole board position. That usually means that three consecutive passes end play. Ing got around it with a four pass rule. Having different types of passes is another possibility.

For territory scoring the natural place to end play is at temperature 0, where the hottest play gains no points. This, OC, is the dame stage. However, questions may arise about unresolved kos, the life and death of stones, and standoffs such as Three Points Without Capturing and Bent Four in the Corner. All such questions may be addressed in an encore played at temperature -1, where placing a stone on the board costs a point. But, as Ing discovered, even play at territory temperature -1 can still present difficult questions when an unresolved ko remains on the board. But in any event, if you have play stop by passes at temperature 0 and then have play end by passes at temperature -1, the two kinds of passes are different. The J89 rules elect to stop play at temperature 0 and use hypothetical play after that. Hypothetical passes are different from actual passes.

You may be interested in a different approach which uses hypothetical play but no pass for ko rule. It makes use of Berlekamp's komaster idea. It is still a work in progress. :) See viewtopic.php?f=45&t=17091

BTW, I saw a Korean rule set online some years ago, translated into English. I found it quite difficult to understand. I cannot find an English tranlation of the new rule set online. My impression now is that the older rule set may have allowed a player with enough ko threats to claim a point in a ko that was unresolved when the last dame was played. Do you know? Thanks. :)
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
moha
Lives in gote
Posts: 311
Joined: Wed May 31, 2017 6:49 am
Rank: 2d
GD Posts: 0
Been thanked: 45 times

Re: KataGo planned rules - drafted

Post by moha »

jaeup wrote:
lightvector wrote:For most area-scoring rulesets, it is not hard to come up with a version that satisfies all the above technical requirements, in fact many of them pretty much do already
Now it is difficult for me to agree with this. Maybe you think some rulesets adopting superko rules (T-T, AGA, NZ or whatever) can achieve this, but I've yet to see a superko-adopting rule that does not have an anomaly. Ch. 10 of my book is devoted to explain all the anomalies of superko rules.
I agree on superko anomalies, but those rulesets have deeper problem: they cannot even attempt to describe the game as it is / was played in practice (triple ko draws). Your rules seem to use a similar conditional n-fold repetition rule I suggested. This, I think, leaves a simple ko area scoring ruleset in a situation territory rules start at: no problems until after the first stop (or dispute).

How should the rules work after that stop (moonshine etc) is quite subjective and depends on one's objectives. Simplicity-wise the hack mentioned earlier (superko only after first stop) seems like an alternative, both for human and bot rules.
Bill Spight wrote:For some reason modern rulesmakers wanted to end play by passes, even though a player might pass without wishing to end play, because she wanted to take a ko. If you allow a pass to lift a ko ban, then that pass cannot be used in itself to end play, because it requires play to continue in order for it to be possible to take the ko.
I don't think this is a real problem because resumption should always be possible (even if there is a potential question about the order).
Bill Spight
Honinbo
Posts: 10905
Joined: Wed Apr 21, 2010 1:24 pm
Has thanked: 3651 times
Been thanked: 3373 times

Re: KataGo planned rules - drafted

Post by Bill Spight »

moha wrote:
Bill Spight wrote:For some reason modern rulesmakers wanted to end play by passes, even though a player might pass without wishing to end play, because she wanted to take a ko. If you allow a pass to lift a ko ban, then that pass cannot be used in itself to end play, because it requires play to continue in order for it to be possible to take the ko.
I don't think this is a real problem because resumption should always be possible (even if there is a potential question about the order).
How do you prevent infinite resumption with a double ko seki?
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
moha
Lives in gote
Posts: 311
Joined: Wed May 31, 2017 6:49 am
Rank: 2d
GD Posts: 0
Been thanked: 45 times

Re: KataGo planned rules - drafted

Post by moha »

Bill Spight wrote:How do you prevent infinite resumption with a double ko seki?
OC there must be some limit on the number of resumptions (even without double ko seki), but I see this as something that could be left to tournament rules. It can be a server dependent hard limit or something else, doesn't really matter as long as it's not too strict. Not the same kind of actual problem as sending-two-returning-one for example, which really needs some minimal change to ko rules to allow the game to reach stop.
jaeup
Dies with sente
Posts: 73
Joined: Thu Jun 13, 2019 5:08 pm
Rank: 5d
GD Posts: 0
Has thanked: 7 times
Been thanked: 17 times
Contact:

Re: KataGo planned rules - drafted

Post by jaeup »

Bill Spight wrote: Effectively, on the board outside the molasses ko, the game becomes one of no pass go.
I think you are assuming a kind of superko rule is in effect. Using SSK, the game will likely end leaving the local shape as a seki. Using PSK, ugly(?) no pass go will result.

However, Japanese, Korean and Chinese rules do not adopt any superko rules. They don't mind the same shape repeats. Some of the whole board repetition (triple ko, quadruple ko, etc.) results in a draw, some (sending-two-returning-one, double ko trick, separated moonshine life, etc.) are not. For combined moonshine life, Japanese rule thinks its dead, but Korean and Chinese rules say a draw may result. Their real problem is to present a clear algorithm distinguishing the two cases.

What I tried to say was that... for the standard molasses ko shape, pros think it is "the type of repetition that a draw is allowed".
Jaeup Kim
Professor in Physics, Ulsan National Institute of Science and Technology, Korea
Author of the Book "Understanding the Rules of Baduk", available at https://home.unist.ac.kr/professor/juki ... ce&wr_id=5
jaeup
Dies with sente
Posts: 73
Joined: Thu Jun 13, 2019 5:08 pm
Rank: 5d
GD Posts: 0
Has thanked: 7 times
Been thanked: 17 times
Contact:

Re: KataGo planned rules - drafted

Post by jaeup »

Bill Spight wrote: How do you define a go anomaly?
This was the first research project I worked on as a rule theoretician, and I soon realized that it is impossible. Anomaly is something that most strong players do not want the rule to allow, but it is certainly a subjective concept. However, when the subjective thoughts are gathered to form a certain opinion, it is not something one can easily ignore. If, let's say, a rule is carelessly written so that sending-two-returning-one results in a draw, 99% of the pros will look at it and say "I can't accept it. Change the rule!".

Maybe for one or two shapes, we can find a clever algorithm to distinguish anomaly. (For the sending-two-returning-one, we may count the captured prisoner difference.) What I am saying is that I cannot imagine a few sentences defining all anomalies, because anomaly is a subjective concept.

If there exists a clear definition of a go anomaly so that when a sequence (Q16, D4, ...) is given a program beeps that "78th move initiates anomaly!", it is so easy to remove the anomaly from the rule. You simply write down the rule you want, and add one sentence "the player who initiates an anomaly (defined by the following algorithm) forfeits."
BTW, I saw a Korean rule set online some years ago, translated into English. I found it quite difficult to understand. I cannot find an English tranlation of the new rule set online. My impression now is that the older rule set may have allowed a player with enough ko threats to claim a point in a ko that was unresolved when the last dame was played. Do you know? Thanks. :)
R. Jasiek uploaded the translated version in his homepage. ( http://home.snafu.de/jasiek/k2016.html )
The old Korean rule (assuming you are talking about 1992 rule) allows the player to leave an n-move apporach ko, but not a direct ko. The conclusion is the same for the current rule, but the principle has changed.
Last edited by jaeup on Sat Dec 21, 2019 5:12 pm, edited 2 times in total.
Jaeup Kim
Professor in Physics, Ulsan National Institute of Science and Technology, Korea
Author of the Book "Understanding the Rules of Baduk", available at https://home.unist.ac.kr/professor/juki ... ce&wr_id=5
jaeup
Dies with sente
Posts: 73
Joined: Thu Jun 13, 2019 5:08 pm
Rank: 5d
GD Posts: 0
Has thanked: 7 times
Been thanked: 17 times
Contact:

Re: KataGo planned rules - drafted

Post by jaeup »

moha wrote: I agree on superko anomalies, but those rulesets have deeper problem: they cannot even attempt to describe the game as it is / was played in practice (triple ko draws). Your rules seem to use a similar conditional n-fold repetition rule I suggested. This, I think, leaves a simple ko area scoring ruleset in a situation territory rules start at: no problems until after the first stop (or dispute).
In my ruleset, the game never temporarily stops. (I have this luxury because it is an area scoring rule.) All anomaly attacks will ultimately be penalized by sequence analysis. (The analysis is easy for a computer program). Any long period repetition which are not penalized ends the game with a draw.
Jaeup Kim
Professor in Physics, Ulsan National Institute of Science and Technology, Korea
Author of the Book "Understanding the Rules of Baduk", available at https://home.unist.ac.kr/professor/juki ... ce&wr_id=5
moha
Lives in gote
Posts: 311
Joined: Wed May 31, 2017 6:49 am
Rank: 2d
GD Posts: 0
Been thanked: 45 times

Re: KataGo planned rules - drafted

Post by moha »

jaeup wrote:However, Japanese, Korean and Chinese rules do not adopt any superko rules. They don't mind the same shape repeats. Some of the whole board repetition (triple ko, quadruple ko, etc.) results in a draw, some (sending-two-returning-one, double ko trick, separated moonshine life, etc.) are not. For combined moonshine life, Japanese rule thinks its dead, but Korean and Chinese rules say a draw may result. Their real problem is to present a clear algorithm distinguishing the two cases.
This is why I suggested dividing the game before and after first stop (like is the case naturally with Japanese or Korean rules). With a good repetition rule that also handles unbalanced cycles, the answer is simpler: any (balanced) repetition before first stop is a real draw, the rest is much easier handled in dispute/resumption phases. The point here is the simplicity gained for the first phase (which is usually the only phase) - most players won't learn complicated rule additions anyway.

BTW, allowing connected moonshine to live gives the game a weird turn where one side cannot really lose anymore.
jaeup wrote:
moha wrote:This, I think, leaves a simple ko area scoring ruleset in a situation territory rules start at: no problems until after the first stop (or dispute).
In my ruleset, the game never temporarily stops. (I have this luxury because it is an area scoring rule.) All anomaly attacks will ultimately be penalized by sequence analysis. (The analysis is easy for a computer program). Any long period repetition which are not penalized ends the game with a draw.
For some players dead stone agreement may imply a kind of stopped state, though you are right this is not absolutely necessary. But I also feel the kind of sequence analysis you use - however interesting theoretically - may not form attractive rules for practical human play. I can imagine even just reaching adoption of conditional n-fold repetition rule would not be easy.
jaeup
Dies with sente
Posts: 73
Joined: Thu Jun 13, 2019 5:08 pm
Rank: 5d
GD Posts: 0
Has thanked: 7 times
Been thanked: 17 times
Contact:

Re: KataGo planned rules - drafted

Post by jaeup »

moha wrote: any (balanced) repetition before first stop is a real draw, the rest is much easier handled in dispute/resumption phases.
It is not much easier in my experience. Yes, if repetition occurs after the first phase, there is a high chance that someone is just trolling. But who is to blame? In a rule where a connected moonshine life is allowed to live, the repetition after the first phase may still result in a draw, and no one is to blame. The purpose of the sequence analysis to identify who is to blame and penalized.
BTW, allowing connected moonshine to live gives the game a weird turn where one side cannot really lose anymore.
I don't understand the exact situation you are talking about. For me, whichever decision (draw or dead) is acceptable for the connected moonshine life. The problem is that the sequence of repetition for connected moonshine life and separated moonshine life are virtually the same, which means a logical rule allowing the life of a connected moonshine life is likely to allow a separated one to live, and most people will hate to see it happening. In my ruleset, the player who does not give up the connected moonshine life is penalized.
But I also feel the kind of sequence analysis you use - however interesting theoretically - may not form attractive rules for practical human play. I can imagine even just reaching adoption of conditional n-fold repetition rule would not be easy.
For players who are playing normally, they wouldn't even notice that a sequence analyzer is included in the rule. Only when some weird situation occurs or someone is really trolling, it's the time a program or referee to come up and try sequence analysis. The defender does not need to worry about the sequence analyzer, because he will never be penalized by it. Once the troll learns that all wicked attacks are penalized by the opponent's normal play, no one will try it any more.

Anyway, most games I play are online games, and I don't mind a sequence analyzer program working background while I am playing, as long as it is working properly.
Jaeup Kim
Professor in Physics, Ulsan National Institute of Science and Technology, Korea
Author of the Book "Understanding the Rules of Baduk", available at https://home.unist.ac.kr/professor/juki ... ce&wr_id=5
Post Reply