Repository navigation
conformance: cover the edge, count and convenience functions it skipped - #187
Merged
Merged
Conversation
An audit of the public API against the suite found functions that no record or runner check held to the reference. Two need the reference's answers, so the edges group records them, computed from the edges it already writes with no new draws: - reverses: reverseDirectedEdge for each edge. - vertexes: edgeToVertexes for each edge, as its start and end vertex. The function is new in v4.6.0. Only edges/cells.jsonl and its manifest hash change. With the two keys removed, every record is byte for byte the same as before. The rest follow from data the suite already has, so the runner checks them without regenerating: - DirectedEdge#Cells is the subject cell and the recorded destination. - GridDiskDistancesSafe is built from the rings, as GridDiskDistances is. - GridDisksUnsafe on one origin refuses exactly when GridDiskUnsafe does, and otherwise returns the same cells. - ImmediateParent and ImmediateChildren are the last recorded parent and the recorded children. - NumCells is each resolution's digest count, and Pentagons returns twelve valid pentagons in ascending order. Neither enumerates the grid, so every resolution is checked, however many a run digests. The README spec gains the two keys, a fresh example row, and the checks a consumer in another language should also make. Swapping the return order of Vertexes or Cells makes TestEdges fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage Report for CI Build 44578498678Coverage remained the same at 100.0%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
I audited the public API against the conformance suite: every function in the v4.6.0
h3api.h, and every exported Go function and method. Several were not held to the reference by any record or runner check. This PR covers them.New reference data
Two functions need the reference's answers, so the
edgesgroup records them. Both are computed from the edges each record already writes, with no new random draws:reversesreverseDirectedEdge(e)for each edgevertexesedgeToVertexes(e)for each edge, as[start, end](new in v4.6.0)Only
edges/cells.jsonland its manifest hash change. With the two keys removed, every record is byte for byte the same as before, and the record count stays at 542.Checks derived from existing data
These follow from data the suite already records, so the runner checks them without regenerating:
DirectedEdge#CellsGridDiskDistancesSafeGridDiskDistancesalready isGridDisksUnsafe(one origin)diskUnsafeoutcome, and otherwiseGridDiskUnsafe's cellsImmediateParent,ImmediateChildrenNumCellscountPentagonsNumCellsandPentagonsdon't enumerate the grid, so they run for every resolution regardless ofH3_CONFORMANCE_DIGESTS_MAXRES.The README spec gains the two keys, a fresh example row taken from the regenerated file, and the checks a consumer in another language should also make:
directedEdgeToCells,gridDiskDistancesSafe,getNumCellsandgetPentagons.Not covered, on purpose
CellToBoundary,CellToVertexes,VertexToLatLngandCellToChildPos, plusGeoPolygon.Cells. Each is a one-line call to a method the suite already checks.MarshalText/UnmarshalText,LatLngToCellString,NewLatLng. They have no C counterpart and are covered by unit tests.describeH3Error,maxGridRingSize,res0CellCount,pentagonCount. Go uses error values and constants for these.stringToH3on invalid input. Where C returns an error, Go'sIndexFromStringreturns a sentinel (0 for an empty string or a non-hex character, all ones on overflow) and leaves validation to the caller. Valid strings are parsed throughout the suite.Testing
Vertexesor ofCellsmakesTestEdgesfail, with 3,060 failed assertions each.-Wall -Wextra -Werror -pedantic.