KataGo planned rules - drafted

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

Re: KataGo planned rules - drafted

Post by RobertJasiek »

lightvector wrote: * "Bent 4 in corner, double ko death, are dead regardless of ko threats"
* "Basic moonshine life is not possible, the false eye group will actually die during cleanup play"
These positions do not even remotely describe Japanese rules behaviour sufficiently.

So you do NOT want minimally simple Japanese-style rules.

You may indeed need ko-pass-like rules. More importantly, you will need locality and capturability as in the Japanese 2003 Rules. Including local-3 and capturable-3 because dissolution of direct kos is a feature of Japanese-style rules based on fulfilling precedents.

Let Matti show you bent-4-in-the-corner that is a seki.

Why do you create problems for yourself? You take J1989 as the model. Why not take Verbal European-Japanese Rules as the model?
http://home.snafu.de/jasiek/j_verbal_status.pdf
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 »

lightvector wrote:* "No territory in seki"
* "No gain for filling one-sided seki dame during cleanup"
* "Bent 4 in corner, double ko death, are dead regardless of ko threats"
This level of compatibility is not easy indeed, but this goes beyond what the average player considers "Japanese-style". IGS - despite being a Japanese server - used to count territory in seki, for example. And one-sided dame does not seem any different than reverting to the earlier result for three points without capturing - a natural consequence of temperature change.
When you use this with superko where passes lift bans, it has an actual purpose. Without that, from a practical point having an n-fold repetition rule, a two-pass rule AND a separate pass-repetition rule still seems redundant.
Then you can think of it as a fail-safe provision. No matter how you tinker with other rules, it is there to stop play in a reasonable spot. :)
Taking it out without adding anything else means that sending-two-returning-one is highly problematic under Area Scoring + Simple Ko - one does not want this position to be a no result. This rule is an effective way to bound that case, and also any future cases that I can't think of. One could also adopt a "count how many stones were captured of each color during this long cycle" rule, or something like that. That would be a different way to solve it. Either way, one actually does need a rule here rather than just having nothing.
That's what I suggested: since you already have n-fold repetition, that could also handle this without another rule (n-th repetition is draw/win/loss depending on captures - a common solution in computer go).
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 »

moha wrote:
lightvector wrote:* "No territory in seki"
* "No gain for filling one-sided seki dame during cleanup"
* "Bent 4 in corner, double ko death, are dead regardless of ko threats"
This level of compatibility is not easy indeed, but this goes beyond what the average player considers "Japanese-style". IGS - despite being a Japanese server - used to count territory in seki, for example. And one-sided dame does not seem any different than reverting to the earlier result for three points without capturing - a natural consequence of temperature change.
On the other hand, given that the current ruleset works, and has been loosely verified in test runs, it would be nice if when people analyze a pro game with Lizzie using KataGo it produces the correct result given these details, except in cases that are dozens of times rarer.
moha wrote:
Then you can think of it as a fail-safe provision. No matter how you tinker with other rules, it is there to stop play in a reasonable spot. :)
Taking it out without adding anything else means that sending-two-returning-one is highly problematic under Area Scoring + Simple Ko - one does not want this position to be a no result. This rule is an effective way to bound that case, and also any future cases that I can't think of. One could also adopt a "count how many stones were captured of each color during this long cycle" rule, or something like that. That would be a different way to solve it. Either way, one actually does need a rule here rather than just having nothing.
That's what I suggested: since you already have n-fold repetition, that could also handle this without another rule (n-th repetition is draw/win/loss depending on captures - a common solution in computer go).
From a computer perspective, it's not obvious that looping through all positions intermediate to the last repetition to count quantity of captures should necessarily be simpler than checking if there exists an earlier repetition with a pass. Both are pieces of logic that have to be implemented - and implemented in addition to just noticing that there is a repetition at all. So it's not as if one of them is "a new rule" and yet the other one is "not a new rule". Nonetheless, it may be very slightly simpler to implement, so I'll consider it.
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 »

Matti wrote:
lightvector wrote: Additionally, your very own example indicates some difficulty if ko-blocking persists forever and is never cleared when a ko dissolves, at least as it is currently formulated. Maybe a different formulation of the "location associated to a ko-block" would work though.
Click Here To Show Diagram Code
[go]$$c
$$ ----------------------
$$ | . X O . O X . . .
$$ | X O . O O X . . .
$$ | . X O O X X . . . .
$$ | X O O X X . . . . .
$$ | O O X X . . . . . .
$$ | X X X X . . . . . .
$$ | . . . . . . . . . .
$$ | . . . . . . . . . .
$$ | . . . . . . . . . .
$$[/go]
One possibility to solve this problem would be to define ko as a pair: the stone to be captured and the point where the new stone is to be played. A ko-block is assigned to this pair. In the position above the ko captured from different direction would be another ko without a ko block, and blck stones can be killed.
Assigning a block to the pair greatly complicates the implementation and I'm going to just bite the bullet and not do it if that's the only way, because with pairs it's not possible (for example) in any computer implementation to store just a 19x19 grid of marked spots or to provide a nice 19x19 input to a neural net. How about assigning the block purely only to the opponent stone to be recaptured? So:

* When capturing in a ko, the new stone played is marked with a block.
* Capturing (i.e. re-capturing) a ko where the stone to be captured is blocked is prohibited.
* The opponent may spend a turn to remove a block.

I can still construct an anomalous position, but it seems to increase by 1 the length of "ko recapture chains" necessary to produce the anomaly, making the possibility even more "rulesbeasty" and unlikely and is no more complicated to state or to implement. I'm willing to bite the bullet and just accept the remaining anomaly, unless this making this change causes the rules to break in a more trivial way.

@Matti - I'd still be interested in your thoughts on molasses ko and what your reasoning is for needing to unblock each stage in it separately being better. Thank you so much for your comments already.
Click Here To Show Diagram Code
[go]$$c Molasses ko?
$$ ----------------------
$$ | X X O . O X . . .
$$ | X O . O O X . . .
$$ | X X O O X X . . . .
$$ | X . X O X . . . . .
$$ | X . X O X . . . . .
$$ | X X O O X . . . . .
$$ | O O O X X . . . . .
$$ | X X X X . . . . . .
$$ | . . . . . . . . . .
$$[/go]
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: @Matti - I'd still be interested in your thoughts on molasses ko and what your reasoning is for needing to unblock each stage in it separately being better. Thank you so much for your comments already.
Let's compare a molasses ko and a two stage ko with two additional single kos.
Click Here To Show Diagram Code
[go]$$c Molasses ko?
$$ ----------------------
$$ | X X O . O X . . .
$$ | X O . O O X . . .
$$ | X X O O X X . . . .
$$ | X . X O X . . . . .
$$ | X . X O X . . . . .
$$ | X X O O X . . . . .
$$ | O O O X X . . . . .
$$ | X X X X . . . . . .
$$ | . . . . . . . . . .
$$[/go]
With the rule to unblock ko each stage separately black can kill in the molasses ko. With the rule to unblock only one ko, stones cannot be killed.
--
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]
With the rule unblock ko each stage separately this is seki. With the rule to unblock only one ko, stones can be killed.

The rules work in opposite ways in the positions. I estimate molasses ko to be more rare that the second position. Therefore I would prefer rules which makes the second position seki. Another possibility is to introduce ko-blocks where a string of more than one stone gets repeatedly captured, bt I think that opens another can of worms.
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 »

Molasses ko is actually very hot. When the rules allow passes into the mix, strange things can happen.

Anyway, molasses ko has only been known to have occurred once in go history. If it had occurred in top play, even 1,000 years ago, I expect that word would have spread, and some record would have survived. Ancient texts show hanezeki, which may not even have occurred in actual play. How could they not show molasses ko, if they knew about it?

In all the millions of self play games by bots, has molasses ko occurred even once? Should we worry about it in rules for training?
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
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 »

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.

Unless anyone finds anything seriously broken with this, I'll go ahead and finish KataGo's implementation and start the next official run shortly, supporting these rules (yay). If all goes well, in few weeks we should have some very strong new KataGo nets.
------------------
Amendments (in bold)
------------------

A pseudolegal move consists of a player performing the following:
  • Coloring an empty point with the player's color.
  • Then resolving captures of the opponent's color.
  • Then resolving captures of the player's color.
...
...
For any regions emptied by the steps of resolving captures, we say that the move captures those regions.

Cleanup Phase Basics and Definitions
A ko-move for a player in a position is any pseudolegal move M where the opponent would have a pseudolegal move in response, the ko-reply, that would result in exactly the grid coloring prior to M. (Note: It is not hard to prove that any ko-move captures exactly one region, with that region containing exactly one point, the same point that the ko-reply would color.)
In addition to the grid coloring, points on the grid may be marked as ko-recapture-blocked. (Note: this is no longer per-player, since it is implicitly differentiated by the color of the stone being marked)
The state during cleanup phases consists of the grid coloring together with the ko-recapture-blocked status of all points and the color of the player next to take a turn.

Cleanup Phase Play
Cleanup lasts for two phases[6]. In each phase, starting with the grid coloring from the end of the previous phase, the players alternate turns, starting with the opponent of the player who took the last turn of the previous phase. A turn in the cleanup is either a pass, a legal move, or an unblock-ko-recapture action.[7]

...

A legal move by a player during a cleanup phase is any pseudolegal move for that player that either...
  • Is NOT a ko-move.
  • Is a ko-move that both...
    • Does NOT capture a region that contains any point marked as ko-recapture-blocked.
    • AND where that player did NOT on any earlier turn during the same cleanup phase make a legal move on exactly the same point with exactly
      the same grid coloring.
    Then, followed by marking the point colored by that move as ko-recapture-blocked.
Then, followed by unmarking all ko-recapture-blocked points whose grid color is empty.

An unblock-ko-recapture action consists of a player choosing a ko-move for that player that would capture a region containing a point marked as ko-recapture-blocked, and removing that mark (with no changes to the coloring of the grid).
Last edited by lightvector on Wed Dec 11, 2019 10:36 am, edited 2 times in total.
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 »

Bill Spight wrote:
I like to think that the current draft, despite the flaws, actually does a pretty good job of achieving the above objectives. If someone does see a simple change that would be a clear improvement, that would be great. Otherwise, I'm likely go just go ahead with it (after pondering for a little longer if any simple clear improvements are possible), unless someone comes up with something massively better. :)
I think you are doing a great job! :clap: :clap: :clap: :salute: :salute: :salute:
And thanks, Bill, for the support.
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 »

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.
You may have intended this, but it seems to me that the block on a single ko stone should allow it to captured along with other stones in one move.
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
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 »

Bill, what do you mean?

In the new formulation posted above, a ko-recapture-blocked stone can be captured without spending a turn to unblock if it is via a move that is not a ko-move. So basically, it only stops capture of that stone in a ko-mouth shape.

Was that what you meant/were remarking on, or do you mean something else?
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 »

It seems feasible to continue with these rules. Anyway, if a serious problem with these rules is found after some years, it would be a reasonably small task to train the bot under new modified rules.
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 »

lightvector wrote:Bill, what do you mean?

In the new formulation posted above, a ko-recapture-blocked stone can be captured without spending a turn to unblock if it is via a move that is not a ko-move. So basically, it only stops capture of that stone in a ko-mouth shape.

Was that what you meant/were remarking on, or do you mean something else?
That's what I had in mind, thanks. :)
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
YeGO
Dies with sente
Posts: 82
Joined: Mon Feb 23, 2015 8:41 pm
GD Posts: 0
Has thanked: 19 times
Been thanked: 46 times

Re: KataGo planned rules - drafted

Post by YeGO »

Any plans to support Ing ko rules? ;-)
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 »

YeGO wrote:Any plans to support Ing ko rules? ;-)
Surely you jest.
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
YeGO
Dies with sente
Posts: 82
Joined: Mon Feb 23, 2015 8:41 pm
GD Posts: 0
Has thanked: 19 times
Been thanked: 46 times

Re: KataGo planned rules - drafted

Post by YeGO »

Yes, just kidding, hence the winking emoji.

However, it would be interesting to see the Ing ko rules formalized for bot play ...

I never managed to understand those rules. Is there a clear article explaining them somewhere online?
Post Reply