Skip to content

Automatically detect board size from SGF SZ property#16

Open
Samtroulcode wants to merge 3 commits into
9beach:masterfrom
Samtroulcode:feature/automatic-board-size
Open

Automatically detect board size from SGF SZ property#16
Samtroulcode wants to merge 3 commits into
9beach:masterfrom
Samtroulcode:feature/automatic-board-size

Conversation

@Samtroulcode

Copy link
Copy Markdown

Summary

Automatically set KataGo's boardXSize and boardYSize from the SGF root
SZ property.

This allows 9x9, 13x13, 19x19, and rectangular boards to be analyzed without
manually overriding the board dimensions for each file.

Behavior

  • SZ[9] sets a 9x9 board
  • SZ[13] sets a 13x13 board
  • SZ[19] sets a 19x19 board
  • SZ[13:9] sets a 13x9 rectangular board
  • Missing or invalid SZ values preserve the configured board dimensions
  • Explicit command-line board-size overrides remain supported

Changes

  • Parse square and rectangular SGF board sizes
  • Apply detected dimensions to KataGo analysis queries
  • Use the detected board height when formatting variations
  • Add unit tests for valid, invalid, missing, and rectangular sizes
  • Document automatic board-size detection

Tests

  • npm test
  • npm run lint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant