Skip to content

conformance: add the polygons and validity digest streams - #157

Merged
justinhwang merged 1 commit into
masterfrom
conformance/digest-streams
Oct 5, 2026
Merged

justinhwang merged 1 commit into
masterfrom
conformance/digest-streams

Conversation

@justinhwang

Copy link
Copy Markdown
Collaborator

Summary

Adds the two digest streams the suite was missing. Both change the shape of the digest files, so they land together and before the format is carried anywhere else.

polygons, a thirteenth per-cell stream in digests/resolutions.jsonl and digests/baseCells.jsonl. For every cell at resolutions 0 through 2: the boundary scaled about its center by 0.8 and by 1.2, exactly as the regions group scales it, filled two resolutions finer by polygonToCellsExperimental in center, full, overlapping and overlappingBbox, eight sets per line. The key is present only on rows at or below resolution 2, so finer rows keep twelve keys. That is 5,882 cells and 47,056 fills. Resolution 3 would be seven times that for the same code paths and measured about 25 seconds per run in the Go runner, so it was left out.

validity, in a new digests/patterns.jsonl. A stream of 64-bit words that are mostly not cells, one line each with isValidCell, isValidIndex, isValidDirectedEdge and isValidVertex. Uniform random words are invalid on the mode bits alone almost every time, so seven draws in eight take a valid cell and disturb one field: mode, reserved bits, resolution, base cell, one digit, the high bit, or the mode set to edge or vertex with random reserved bits. That is where validators that stop at the mode and resolution are caught. Digests are recorded at 100,000, 1,000,000 and 10,000,000 patterns of the same stream, so a runner computes all three in one pass. The Go runner checks to one million by default; H3_CONFORMANCE_PATTERNS_MAXCOUNT raises it.

The README specifies both: the line formats, the scaling, and the draw order of every pattern kind.

Results

Both streams pass in pure Go on the first run against the C-generated digests.

Check Time (no race)
Validity stream, all three tiers to ten million patterns 1.8 s
Resolution and base-cell digests to res 3, with polygons to res 2 4.4 s
Whole conformance package under -race 27 s

Every file outside digests/ is byte-identical to before; the manifest changes only in the two digest entries and the new patterns entry.

Test plan

  • go test -count=1 -race -cover ./x/h3go/conformance/ passes with 100% coverage
  • H3_CONFORMANCE_PATTERNS_MAXCOUNT=10000000 passes
  • golangci-lint run ./x/h3go/conformance/... clean
  • Regenerated with generate.sh; every file outside digests/ is byte-identical

🤖 Generated with Claude Code

@coveralls

coveralls commented Oct 5, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 37258179900

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 1 of 1 lines across 1 file 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: 4539
Covered Lines: 4539
Line Coverage: 100.0%
Coverage Strength: 2694571.53 hits per line

💛 - Coveralls

Two streams the digests group was missing, both format additions, landed
together so the digest files change shape once.

polygons: for every cell at resolutions 0 through 2, the boundary scaled
about its center by 0.8 and by 1.2, exactly as the regions group scales
it, filled two resolutions finer by polygonToCellsExperimental in the four
containment modes; eight sets per line. It is a thirteenth stream in the
existing resolutions and baseCells files, present only on rows at or
below resolution 2, so a mismatch still localises to a base cell.
Resolution 3 would be seven times the fills for the same code paths and
about 25 seconds per run in Go.

validity: digests/patterns.jsonl, a stream of 64-bit words that are not
cells, each line giving isValidCell, isValidIndex, isValidDirectedEdge and
isValidVertex. Uniform words are almost always invalid on the mode bits
alone, so seven of eight draws take a valid cell and disturb one field:
mode, reserved bits, resolution, base cell, a digit, the high bit, or the
mode set to edge or vertex with random reserved bits. Digests are recorded
at one hundred thousand, one million and ten million patterns of the same
stream. The Go runner checks to one million by default and
H3_CONFORMANCE_PATTERNS_MAXCOUNT raises it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@justinhwang
justinhwang force-pushed the conformance/digest-streams branch from 41b9553 to abb84dd Compare October 5, 2026 03:08
@justinhwang
justinhwang merged commit 0fbbb7c into master Oct 5, 2026
14 checks passed
@justinhwang
justinhwang deleted the conformance/digest-streams branch October 5, 2026 15:57
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