I must be misunderstanding something. I thought that ko was a situation where the board position has to be changed to one that has not occurred before in the current game, and that repeating a board position is as illegal as suicide or playing multiple stones.
So, to enforce the rule of ko, wouldn’t the OGS software have to store a perfect hash value representing each board position, and ensure that no hash value is ever repeated? If there are 200 stones maximum on the board at any time, wouldn’t that mean that only 200 hash values have to be checked (by one or two integer comparisons) for each move?
Since checking for a repeat in board position is so easy for the software, and assuming for some reason it is not currently being done, why not just add the check?
Your understanding of a decent implementation of superko is correct. The points I think you are missing:
There is a distinction between Ko and Superko. The former only takes into account the previous moves.
Japanese rules have a ko rule, and it works as you describe: repeating a board position is illegal.
Under Japanese rules, superko will end the game with noresult (?)
Pedants feel free to correct me if I mistated that somehow. But what I’m trying to convey is that it’s not simply a forbidden move like it is in other rulesets.
OGS does implement a superko check for other rulesets.
As an aside, the search space that OGS checks for superko is capped at 30 moves. The number is a bit arbitrary, but I imagine the occurrence of superko drops dramatically after the triple ko (6 moves).
As benjito said the KO rule and a SUPERKO rule is different, and for some reason this tends to be misunderstood in the West.
In Japan, “ko” refers to the shape where back-and-forth single stone captures are possible, and the ko rule forbids IMMEDIATE recapture in that shape.
So you don’t need hashes or game history, since this is only loosely related to the board position. You can also recapture in a ko after a pass, even if the board position didn’t change (which is actually essential for territory scoring to work correctly).
Since this allows repeated board positions, long cycles remain possible. Hence the “no result” outcome - which is thought of as roughly the same as if there were no special long cycle rule at all, and the game would actually continue infinitely: No scoring thus no result.
You do not really need a full-blown hash if you just record the number of stones of each colour after each move. It is fairly rare for both of these not to exceed their previous maximum value and for both to repeat. If they do, I expect the logic for undoing moves could be used to see if any spot has changed occupancy. Also one only needs to go back to the first move which can have the current number of stones on the board, i.e. the move with that number.
An alternative approach might be to observe that most moves occupy a previously unoccupied spot.
That’s an interesting idea. I guess even in the cases where dead stones are removed during play, the numbers of black and white stones might repeat separately, but I guess you’re saying it’s possibly unlikely that both match up exactly as a pair at the same time.
(N,M) black atari,
(N-x, M+1) White removes some dead stones
(N-x+1,M+1) Black plays somewhere
(N-x+1, M+2) White Ataris somewhere
(N-x+2, M+2-y) black captures removes some dead stones
I guess if similar sized groups are removed somewhat consecutively maybe the numbers could repeat. Maybe a mirror go game or something?