Practical guide

SGF Point Ranges: Expand Rectangles and Find Duplicate Points

A compressed SGF point value such as aa:cc selects an inclusive rectangle. Expand it before counting stones or marks: that rectangle contains nine points. Overlapping values can repeat a point, and a one-point rectangle must instead be written as a single point.

Go learners, teachers and people checking SGF records · 6 minute read · Published

One value can select several points

The SGF FF4 specification permits compressed rectangles in appropriate lists of points. The first corner is the upper left and the second is the lower right; both are included. For Go, stone values reduce to points, so the same notation can appear in setup-stone lists such as AB. [1]

Count the expanded intersections, not the number of bracketed values. AB[aa:cc] has one bracketed value but supplies nine black setup points. It does not describe one move, nine successive moves or a claim that those stones arose from legal play.

The two-letter coordinates begin at the upper-left intersection: the first letter is the column and the second is the row. [3] Our diagrams use a declared 9×9 board. For translating coordinates to printed row numbers, use the existing full SGF reading guide.

Expand aa:cc on a complete 9×9 board

(;FF[4]GM[1]CA[UTF-8]SZ[9]AB[aa:cc])

Columns a through c give three choices and rows a through c give three choices: 3 × 3 = 9. The complete black set is aa, ab, ac, ba, bb, bc, ca, cb, cc. There are no white stones; every other point is empty.

Complete 9 by 9 board with nine black setup stones in the upper-left three-by-three rectangle.
Original complete-board illustration. Its printed columns are A–I and rows count from 9 at the top to 1 at the bottom; these are display labels, not extra SGF properties. Open the full-size diagram.

Download the nine-point setup rectangle. Keep your own record unchanged; these are original teaching examples.

For AB, these are setup placements. The property specification says setup does not perform captures, suicide handling or prisoner counting. A successfully reconstructed diagram is not a certification that its position is reachable under your chosen Go rules. [2]

A rectangle and a single point can share one property

(;FF[4]GM[1]CA[UTF-8]SZ[9]AB[aa:bb][dd])

The rectangle aa:bb contributes aa, ab, ba, bb. The single value dd contributes one different point. Together the complete black set has five points; white is empty and every unlisted intersection is empty.

Download the five-point mixed list. Keep your own record unchanged; these are original teaching examples.

On a narrow screen, scroll the comparison sideways. Keyboard users can focus the table and use the arrow keys.

Four lists and their actual point counts
AB valuesExpanded occurrencesUnique pointsFF4 list check
[aa:cc]99Valid rectangle
[aa:bb][dd]55Valid nonoverlapping mixed list
[aa:cc][cc:dd]1312Invalid: cc occurs twice
[aa:aa]11Invalid one-point rectangle; use [aa]

The single point does not require a colon. A value list with several members is still one AB property in the node; do not repeat AB as a second property identifier to add another point. FF4 requires each property identifier to occur only once per node. [1]

An overlap is a duplicate, even if a viewer normalizes it

In AB[aa:cc][cc:dd], the first rectangle contributes nine occurrences and the second contributes four: cc, cd, dc, dd. Point cc appears in both. The sum is thirteen occurrences but only twelve distinct intersections. FF4 requires unique points and prohibits overlapping compressed lists. [1]

Deliberately faulty diagnostic file: Download the intentionally overlapping list. Keep your own record unchanged; these are original teaching examples.

For a corrected explicit union, the twelve unique points are aa, ab, ac, ba, bb, bc, ca, cb, cc, cd, dc, dd. This list describes the union only if that was the author’s intended diagram. Do not silently decide the intended position in an unknown record.

The grammar parser used for these examples can read the bracketed values. Its higher-level point conversion normalizes the overlap into twelve unique points. That useful normalization does not prove the raw input met the uniqueness rule. Inspect the raw values as well as the resulting set.

Check the corners and the board boundary

A one-point rectangle such as aa:aa is not allowed in this compressed notation; write aa as an ordinary point. A reversed pair is not an upper-left-to-lower-right rectangle. Resolve the root SZ before deciding whether every expanded point lies on the board. [1]

Deliberately faulty diagnostic file: Download the intentionally invalid one-point rectangle. Keep your own record unchanged; these are original teaching examples.

  1. Read the root board size, including both dimensions for a rectangle.
  2. Expand each single point or inclusive rectangle into intersections.
  3. Verify corner order and bounds; reject a one-point rectangle form.
  4. Count occurrences before deduplication, then compare that count with the unique set.
  5. If they differ, find the repeated points and preserve the original while clarifying the intended diagram.

On a 9×9 board, both letters must select one of the nine available columns or rows. On a rectangular board, the limits differ. Do not apply the row limit to the first letter by habit; the SZ guide shows the columns-first convention.

Two range decisions

AB has one value, aa:cc. Should I draw one stone at aa and one at cc?

Draw the nine setup intersections in the inclusive three-by-three rectangle.

The endpoints delimit the whole rectangle. Expand both axes, take their combinations and compare the complete nine-point list above. This is a setup diagram, with no white stones and every other point empty; the file does not establish a move sequence.

My reader displays twelve stones from two overlapping ranges without an error. Is the file valid?

Check the raw list: the overlap still repeats cc.

The two ranges produce thirteen occurrences but twelve unique points. A reader can normalize the set and hide the duplicate. Preserve the original, determine the intended union, and use a nonoverlapping representation if correcting it. Opening the file alone is insufficient evidence of FF4 uniqueness.

Use the point set with its property’s meaning

Expansion answers which points are selected. The property tells you what to do there: AB places black setup stones; marks annotate intersections; VW selects visibility. The same rectangle is not the same board operation in all three contexts. Read the marks guide or view guide before treating every selected point as occupied.

The four original records were checked for grammar separately from the corner, duplicate and one-point rules. The diagram and point arithmetic were compared against their exact saved files. These teaching records are not played games or engine evaluations.

Sources and further reading

  1. SGF FF4: file format specificationText escaping, property scope and compressed point-list rules.
  2. SGF FF4: AB propertySetup stones and unique point lists.
  3. SGF FF4: Go-specific coordinates and movesColumn-first Go coordinates, pass conventions and move interpretation.