Skip to content

feat: add pure-Go grid traversal (k-ring/disk/ring) to x/h3go - #127

Open
justinhwang wants to merge 1 commit into
justinhwang/purego-phase-cfrom
justinhwang/purego-phase-d
Open

feat: add pure-Go grid traversal (k-ring/disk/ring) to x/h3go#127
justinhwang wants to merge 1 commit into
justinhwang/purego-phase-cfrom
justinhwang/purego-phase-d

Conversation

@justinhwang

Copy link
Copy Markdown
Collaborator

Implement the grid traversal family in pure Go, verified against the cgo reference:

  • GridDisk (+ method), GridDisksUnsafe
  • GridDiskDistances / Unsafe / Safe (+ methods)
  • GridRing / GridRingUnsafe (+ methods)
  • Cell.IsNeighbor

The core is neighborRotations, which steps to an adjacent cell while threading base-cell rotation state and pentagon distortion. The fast ("Unsafe") spiral fails near pentagons and falls back to a breadth-first "Safe" traversal. Adds the base-cell neighbor/rotation tables and the Class II/III digit-adjustment tables, plus ErrPentagon and a setBaseCell helper.

@coveralls

coveralls commented Jun 17, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30594620870

Coverage at 100.0% (no base build to compare)

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 361 of 361 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2551
Covered Lines: 2551
Line Coverage: 100.0%
Coverage Strength: 2760278.01 hits per line

💛 - Coveralls

Implement the grid traversal family in pure Go, verified against the
cgo reference:

- GridDisk (+ method), GridDisksUnsafe
- GridDiskDistances / Unsafe / Safe (+ methods)
- GridRing / GridRingUnsafe (+ methods)
- Cell.IsNeighbor

The core is neighborRotations, which steps to an adjacent cell while
threading base-cell rotation state and pentagon distortion. The fast
("Unsafe") spiral fails near pentagons and falls back to a breadth-first
"Safe" traversal. Adds the base-cell neighbor/rotation tables and the
Class II/III digit-adjustment tables, plus ErrPentagon and a setBaseCell
helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@justinhwang
justinhwang force-pushed the justinhwang/purego-phase-d branch from 316e23e to af54dc9 Compare July 31, 2026 00:49
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.

2 participants