Repository navigation
conformance: add the polygons and validity digest streams - #157
Merged
Merged
Conversation
Coverage Report for CI Build 37258179900Coverage remained the same at 100.0%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - 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
force-pushed
the
conformance/digest-streams
branch
from
October 5, 2026 03:08
41b9553 to
abb84dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 indigests/resolutions.jsonlanddigests/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 bypolygonToCellsExperimentalincenter,full,overlappingandoverlappingBbox, 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 newdigests/patterns.jsonl. A stream of 64-bit words that are mostly not cells, one line each withisValidCell,isValidIndex,isValidDirectedEdgeandisValidVertex. 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_MAXCOUNTraises 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.
-raceEvery 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% coverageH3_CONFORMANCE_PATTERNS_MAXCOUNT=10000000passesgolangci-lint run ./x/h3go/conformance/...cleangenerate.sh; every file outsidedigests/is byte-identical🤖 Generated with Claude Code