Ray icon indicating copy to clipboard operation
Ray copied to clipboard

Question: Is Ray accounting for the number of handicap stones for score calculation?

Open pnprog opened this issue 7 years ago • 3 comments

Hi,

For this question, I am assuming Ray is playing according to Chinese rule (area scoring). Please correct me if I am wrong.

There is not 100% consensus regarding area scoring and handicap games, but it is usual to add the number of handicap stones to the points made by White. So that White score, after removing all dead stones, will be the sum of :

  • the number of empty points surrounded by white stones only
  • the number of living white stones on the board
  • the value of komi (usually 0.5 point for handicap game)
  • the number of handicap stones

For instance, Leela Zero accounts for it: https://github.com/gcp/leela-zero/blob/5958e02cf539d42ee20704b664043036d5c3c18b/src/FastState.cpp#L150 And one can make the assumption that Leela does the same. GNU Go does the same as well (http://git.savannah.gnu.org/cgit/gnugo.git/tree/engine/aftermath.c#n1185).

From what I can read in the code; Ray does not account for it: https://github.com/zakki/Ray/blob/e5b2cadd7baf43630da7b860eb1812705323624a/src/Gtp.cpp#L520

Could you confirm?

pnprog avatar Feb 19 '18 17:02 pnprog

@kobanium Is handicap game always 0.5 point komi? https://github.com/zakki/Ray/blob/e5b2cadd7baf43630da7b860eb1812705323624a/src/DynamicKomi.cpp#L99

zakki avatar Feb 20 '18 11:02 zakki

Hi!

I got my answer: I crafted the enclosed SGF file (9 handicap stones, komi 11.5) and asked Ray to evaluate final_score. Result for Ray: B+132.5

In the same time, Leela, Leela Zero and GnuGo give B+112.5

If I count myself (Chinese rule):

  • Black: area: 247
  • White: (area 114) + (komi 11.5) + (handicap 9) = 134.5
  • Result: B+112.5

Now, even without accounting for the handicap stone, it should be B+121.5 and not B+132.5 which seems to indicate that Ray does not accound neither for handicap (<- this might be ok depending on rule set) neither for komi.

pnprog-vs-pnprog.zip

pnprog avatar Feb 21 '18 14:02 pnprog

@zakki Yes. Komi is always 0.5 points on a handicap game.

@pnprog Ray always considers 0.5 points komi on a handicap game.

  • Ray's output : B+132.5 (komi 0.5 <- wrong value)
  • Correct result : B+121.5 (komi 11.5)

Difference of score : 132.5 - 121.5 = 11.0 Difference of komi value : 11.5 - 0.5 = 11.0

This is Ray's bug. I will fix it.

kobanium avatar Feb 21 '18 15:02 kobanium